Repository navigation
[Test] Add get_swa_key_page_size to the Q8KV8 sparse-prefill fake KV pool - #42211
Merged
nvpohanh merged 1 commit intoOct 2, 2026
Merged
Conversation
…pool sgl-project#42128 made DeepseekV4AttnBackend read the SWA page size through token_to_kv_pool.get_swa_key_page_size(), but the fake _TokenToKVPool in test_q8kv8_sparse_prefill_backend.py does not define it. Four tests in the jit-kernel 1-gpu-large shard now fail on main with AttributeError. Add the accessor to the fake pool, mirroring the real pool's default branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
/rerun-test test/registered/kernels/ops/attention/test_q8kv8_sparse_prefill_backend.py |
Contributor
|
Results for 🚀 |
Collaborator
Author
|
force-merging since this is a very local test change and the test has passed. and this is to fix a wide-spread CI failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[by Claude Code]
Motivation
#42128 changed
DeepseekV4AttnBackendto read the SWA page size throughtoken_to_kv_pool.get_swa_key_page_size()instead oftoken_to_kv_pool.swa_kv_pool.page_size. The fake_TokenToKVPoolintest/registered/kernels/ops/attention/test_q8kv8_sparse_prefill_backend.pydoes not define that method. Since #42128 merged, four tests fail onmainin thejit-kernel-unit-test-1-gpu-largeshard:test_q8kv8_sparse_prefill_helper_builds_fp8_workspace_matching_bf16_path[0|4|128]test_q8kv8_sparse_prefill_real_kernel_matches_bf16_sparse_pathThis breaks every PR that runs the jit-kernel suite, regardless of what the PR changes. Examples:
Also, the shard stops at the first failing file, so the tests scheduled after this one in that shard never run.
Modifications
Add
get_swa_key_page_size()to the fake pool. It returnsswa_kv_pool.page_size, matching the realDeepSeekV4TokenToKVPoolwhen no request window is configured. This is a 3-line, test-only change with no production code changes.This is the same change as commit 94d21e3 in #41251, split out so
mainis unblocked without waiting for that larger perf PR. The hunk is identical, so #41251 should merge cleanly on top of it.Test Escape Postmortem
Summary: #42128 broke this test on
main, but its ownPR Test Baserun passed. The suite that contains this test never ran on #42128, and the same gap let #38954 break the same fake pool in September.Timeline (UTC)
PR Test Baserun passes (run 36928953138). Itscheck-changesstep logsFilter jit_kernel = false, socall-jit-kernel-testswas skipped.mainpasses, including bothjit-kernel-unit-test-1-gpu-largeshards (run 36939300008). It ran onf17f7705a5, which predates #42128.ef867fa40d.mainrun, the first one that would run this suite with #42128 included.Why CI didn't catch it
test_q8kv8_sparse_prefill_backend.pylives undertest/registered/kernels/and is registered in thebase-b-kernel-unitstage. That stage runs only insidecall-jit-kernel-tests.call-jit-kernel-testsruns only whencheck-changessetsjit_kernel=true..github/workflows/_pr-test-check-changes.ymlmatches only kernel and CI paths:test/registered/kernels/**,python/sglang/kernels/**,.github/workflows/pr-test.yml,.github/workflows/pr-test-jit-kernel.yml, andpython/pyproject.toml.python/sglang/srt/layers/attention/deepseek_v4_backend.py,python/sglang/srt/mem_cache/deepseek_v4_memory_pool.py, andtest/registered/unit/mem_cache/test_dsv4_compressed_pools.py.DeepseekV4AttnBackend._forward_prefill_sparseinsrtthrough a hand-written fake_TokenToKVPool. Any change to the pool interface that the backend calls can therefore break the test without triggering it.mainruns (11:10 and 23:10 UTC) run every suite.srtbackend or memory pool this test depends on.srtfiles and unit tests, renamed a pool field, and broke the same fake pool with anAttributeError; [Test] Fix Q8KV8 sparse-prefill pool fixture after page-size rename #39019 fixed it. Both times the fake pool drifted from the realDeepSeekV4TokenToKVPool, and the path filter kept the breaking PR from running the test.Remediation (follow-ups, not in this PR)
srtpaths this test depends on to thejit_kernelfilter: at leastpython/sglang/srt/layers/attention/deepseek_v4_backend.py,python/sglang/srt/layers/attention/dsv4/**, andpython/sglang/srt/mem_cache/deepseek_v4_memory_pool.py.DeepSeekV4TokenToKVPoolinterface, for example by subclassing it or usingcreate_autospec, instead of hand-listing methods. Accessors added to the real pool are then inherited or fail at the fixture, rather than surfacing only when the suite happens to run.Accuracy Tests
jit-kernel-unit-test-1-gpu-large (1)shard passed: https://github.com/sgl-project/sglang/actions/runs/36967456129/job/110714360608. Before the change, the same shard failed with the signature above: https://github.com/sgl-project/sglang/actions/runs/36959032864/job/110688647087.deepseek_v4_backend.py,dsv4/sparse_prefill_utils.py, the DSV4 KV-layout and accessor kernels).mainsince [Fix][DSV4.1] SWA page size with bounded replay #42128 touches those modules either.BLACK_NUM_WORKERS=1 SKIP=no-commit-to-branch pre-commit run --all-files --show-diff-on-failurepasses.Speed Tests and Profiling
Not applicable: test-only change.
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #36980423210
Latest PR Test (Extra): ❌ Run #36980422882
Latest PR Test (AMD ROCm 10): ❌ Run #36980423204