Fix MockDSV4ModelRunner missing spec_algorithm - #31056
Conversation
DSpark (sgl-project#30261) switched DeepseekV4AttnBackend.__init__ from reading server_args.speculative_algorithm to model_runner.spec_algorithm, which the attention-unittest mock runner does not define, so every dsv4 backend construction through the kit crashes with AttributeError. Give the mock SpeculativeAlgorithm.NONE, matching the pre-DSpark behavior for non-spec cases (needs_cpu_seq_lens unset, is_dspark_draft False).
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/tag-run-ci-label |
|
/rerun-test registered/attention/unittests/dsv4/test_deepseek_v4.py |
|
⛔ Please ask a maintainer to run this command, or use the normal CI flow. |
|
/rerun-stage base-b-test-4-gpu-b200 |
|
Stage granularity is too coarse — a stage usually doesn't map to one feature, so rerunning a stage re-pays the cost of unrelated tests. If you don't know which exact test files to rerun, you shouldn't be using Use one of these instead:
AMD CI: stage-level dispatch is still available via Actions UI → PR Test (AMD) / PR Test ROCm 7.2 (AMD) → Run workflow → pick a stage from the dropdown. |
|
/tag-and-rerun-ci |
|
/rerun-test test_deepseek_v4.py |
|
Results for 🚀 🚀 |
Motivation
DSpark (#30261) switched
DeepseekV4AttnBackend.__init__from readingserver_args.speculative_algorithmtomodel_runner.spec_algorithm, which theattention-unittest mock runner does not define, so every dsv4 backend construction
through the kit crashes with
AttributeError: 'MockDSV4ModelRunner' object has no attribute 'spec_algorithm'(e.g. alldsv4_c4_*cases intest/registered/attention/unittests/dsv4/test_deepseek_v4.py). This breaks CI forevery PR based on current main.
Modifications
Give the mock
SpeculativeAlgorithm.NONE, matching the pre-DSpark behavior fornon-spec cases: the old gate was
server_args.speculative_algorithm is not None,which the mock overrides to
None, so withNONEthe new gate resolves identically(
needs_cpu_seq_lensunset,is_dspark_draftFalse). One attribute plus its import inpython/sglang/test/kits/attention_unittest/attention_methods/dsv4_attention.py;is_draft_worker, the other attribute the new code reads, was already defined.Accuracy Tests
N/A — test-kit-only change; no runtime code touched.
Speed Tests and Profiling
N/A.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #29281398333
Latest PR Test (Extra): ❌ Run #29281398028