fix(test): remove dead num_worst_tokens test from internode file - #697
fix(test): remove dead num_worst_tokens test from internode file#697Syan-Lin wants to merge 1 commit into
Conversation
| if with_topk: | ||
| # Test `num_worst_tokens != 0` (intranode only; multi-RDMA-rank | ||
| # internode dispatch does not support this feature — see Buffer::dispatch) | ||
| if with_topk and buffer.runtime.get_num_rdma_ranks() <= 1: |
There was a problem hiding this comment.
🔵 suggestion: The internode test always runs multi-RDMA-rank (num_ranks > 8), where this block is now skipped entirely, so it is dead code in this file. The same block in test_intranode.py already covers the supported single-RDMA case. Consider either deleting the block from the internode test, or narrowing it to a documented single-RDMA-rank scenario, and exposing a public buffer.num_rdma_ranks/buffer.is_internode instead of the private buffer.runtime.
🤖 v4
🤖 ds-review-bot Code Reviewv6The guard matches Buffer.dispatch's existing restriction and prevents the unsupported internode test path. Static compilation and diff checks pass. v4Verification/cleanup complete for the v3The change adds a Files reviewed: 1 |
The num_worst_tokens feature is documented as intranode-only: - legacy.py docstring: 'this flag is for intranode only' - docs/legacy.md: 'this flag is for intranode only' - Buffer::dispatch asserts num_worst_tokens == 0 when runtime.get_num_rdma_ranks() > 1 The test_internode.py file included a copy-pasted num_worst_tokens test block from test_intranode.py. Since the internode test always runs with multi-RDMA-rank (num_ranks > 8), this block was dead code that crashed when triggered. Remove the block entirely. Coverage remains in test_intranode.py where the feature is supported. Fixes: deepseek-ai#670
54566d3 to
df07e62
Compare
|
Hi @sphish @LyricZhao, gentle ping on this PR. It's a small test-only cleanup: the num_worst_tokens block in test_internode.py is dead code, since the feature is documented as intranode-only and Buffer::dispatch asserts it to be 0 for multi-RDMA-rank runs. Coverage stays in test_intranode.py, and this would also close #670. The branch is up to date with main. Happy to rebase or adjust anything if needed. Thanks for your time! |
Problem
test_internode.pyincluded a copy-pastednum_worst_tokens != 0test block from
test_intranode.py. This block was dead code —Buffer::dispatchassertsnum_worst_tokens == 0for multi-RDMA-rankinternode dispatch (
legacy.py:378-379), so the test could never run.When triggered, it crashed the test suite.
Fix
Remove the block entirely from
test_internode.py. Coverage ispreserved in
test_intranode.pywhere the feature is supported.References
deep_ep/buffers/legacy.py:354-355: "this flag is for intranode only"docs/legacy.md:172: "this flag is for intranode only"