Fix DFlash sliding attention causality defaults - #34524
Merged
Merged
Conversation
Collaborator
Author
|
/rerun-test test/registered/spec/test_gemma4_dflash_31b_extra.py test/registered/spec/dflash/test_muse_glimmer_dflash_assistant_gsm8k.py |
Contributor
|
Results for 🚀 🚀 |
hnyls2002
approved these changes
Aug 12, 2026
zixi-qi
added a commit
to zixi-qi/vllm
that referenced
this pull request
Aug 13, 2026
Muse-Glimmer-30B-assistant has five sliding_attention layers and declares no causality, so it resolves causal under the layer-type default. vllm-project#51655 handled that by treating any uniform layer_types as non-causal, which changes the default for every DFlash and DSpark drafter and breaks test_dflash_causality.py::test_dflash_has_any_non_causal[config3-False] -- the only failure in the amd-v1-spec-decode-mi300-1 job of build 83669. Drop that change, leaving _dflash_layer_causal byte-identical to main, and declare the head's causality on MuseGlimmerAssistantConfig instead. The head is bidirectional over the draft block: transformers' modeling_muse_glimmer_assistant sets is_causal = False and builds bidirectional masks for both layer types, and SGLang declares the same on its config class. SGLang widened the default first and reverted it in sgl-project/sglang#34524 after gemma-4-31B-it-DFlash acceptance fell from 5.62 to 5.27. Checkpoints that declare their own causality are unaffected either way: poolside/Laguna-S-2.1-DFlash, poolside/Laguna-XS-2.1-DFlash and the nvidia Nemotron DSpark head all ship dflash_config.causal, and a checkpoint-supplied value still overrides the default added here. Test: pytest v1/spec_decode/test_dflash_causality.py -> 10 passed, with the test file byte-identical to upstream. Signed-off-by: zixi-qi <zixi@inferact.ai> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
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.
Motivation
PR #34262 changed DFlash sliding-attention layers from the legacy causal behavior to bidirectional attention when a checkpoint does not declare
is_causal. Thez-lab/gemma-4-31B-it-DFlashconfig has four sliding-attention layers and nois_causalfield, so its average speculative accept length regressed from approximately 5.62 to 5.27 and failedtest_gemma4_dflash_31b_extra.py's 5.4 threshold.This change restores compatibility for existing DFlash checkpoints while retaining Muse Glimmer's intended bidirectional draft attention.
Modifications
is_causal:AttentionType.DECODER) attention;AttentionType.ENCODER_ONLY) attention.is_causal=Trueandis_causal=Falsecheckpoint declarations for every DFlash attention layer.MuseGlimmerAssistantConfig.is_causal = Falseso Muse Glimmer explicitly retains bidirectional full and sliding draft attention.config.get_text_config()for canonical text-config resolution.Accuracy Tests
The regression boundary was confirmed from scheduled CI runs:
ceeaec20785.61731546965fc725.62095857910bd355.30446; retry5.27089Local configuration-path validation loaded the cached checkpoints through SGLang's actual config parser and evaluated every draft layer:
DECODER; the full layer resolved toENCODER_ONLY.ENCODER_ONLY.is_causal=Falseandis_causal=Trueboth override the legacy defaults consistently.The Gemma-4 DFlash acceptance test passed locally on 2x NVIDIA H100 80GB GPUs with TP=2 and the Extra CI runtime environment:
This restores the accept length from the regressed
5.27-5.30range to the historical5.61-5.62range. CI should also run the Muse-specific acceptance test to confirm its explicit bidirectional behavior end to end:test/registered/spec/dflash/test_muse_glimmer_dflash_assistant_gsm8k.pyAdditional checks:
git diff --checkpython -m compileall -qon both modified filesSpeed Tests and Profiling
No standalone speed benchmark or profile was run. The local Gemma-4 DFlash acceptance test completed its 200-example GSM8K evaluation in 19.885 seconds at 1246.108 output tokens/s. This change restores the acceptance behavior guarded by the existing test and does not add work to the inference path.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #31564810857
Latest PR Test (Extra): ❌ Run #31564810558