Skip to content

[Spec] Fix DFLASH verify mask policy for wrapped attention backends - #43054

Merged
nvpohanh merged 7 commits into
sgl-project:mainfrom
elvischenv:fix-dflash-mask
Oct 14, 2026
Merged

nvpohanh merged 7 commits into
sgl-project:mainfrom
elvischenv:fix-dflash-mask

Conversation

@elvischenv

@elvischenv elvischenv commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

With DFLASH and split attention backends (--prefill-attention-backend flashinfer --decode-attention-backend trtllm_mha, default --speculative-attention-mode prefill), target-verify output is corrupted (GSM8K 0.03).

resolve_dflash_verify_mask_policy checks the skip list by class name, so HybridAttnBackend is not matched and verify CUDA graphs are captured with a custom mask. DFLASH replay always passes custom_mask=None, so FlashInfer runs the captured custom-mask kernel on a stale mask buffer.

Modifications

  • Resolve HybridAttnBackend / TboAttnBackend to the backend that runs TARGET_VERIFY before checking the skip list.
  • FlashInfer: raise if a verify graph captured with a mask buffer is planned without a mask.
  • Add unit tests.

Accuracy Tests

Nemotron-3.5-Super NVFP4 + DFLASH (LiLiCorr), DGX SPARK(GB10), lm_eval GSM8K 5-shot:

flexible / strict accept len
before 0.027 / 0.005 3.75
after 0.923 / 0.848 5.51
--speculative-attention-mode decode (reference) 0.922 / 0.850 5.50

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ✅ Run #38254580606
Latest PR Test (Extra): ❌ Run #38254580401
Latest PR Test (AMD ROCm 10): ❌ Run #38254580590

Resolve HybridAttnBackend / TboAttnBackend to the backend that runs
TARGET_VERIFY before checking the skip list, so split prefill/decode
backends no longer capture verify graphs with an unused custom mask.
Add a FlashInfer guard against mask-less plans on masked graph wrappers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elvischenv

Copy link
Copy Markdown
Contributor Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Oct 11, 2026

@nvpohanh nvpohanh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[by Claude Code] Severity: style | Confidence: High

Issue

The GSM8K before/after table has no commands, so others cannot rerun it. The description does not include:

  • the server launch command: the target and DFLASH draft model paths, the --speculative-* flags (algorithm and number of draft tokens), and the attention backend flags;
  • the lm_eval command: task, limit, concurrency, and sampling settings.

Fix

Add both commands for the before and after runs. If the Nemotron-3.5-Super checkpoint or the LiLiCorr draft is not public, one before/after GSM8K run on a public DFLASH target/draft pair with --prefill-attention-backend flashinfer --decode-attention-backend trtllm_mha is enough.

@nvpohanh

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/attention/unittests/dense/test_flashinfer.py test/registered/attention/unittests/swa/test_flashinfer.py test/registered/spec/dflash/test_dflash.py test/registered/e2e/models/test_kimi_k3_b300.py

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🚀 4-gpu-b200 (2 tests): ✅ View workflow run

cd test/ && python3 registered/attention/unittests/dense/test_flashinfer.py
cd test/ && python3 registered/attention/unittests/swa/test_flashinfer.py

🚀 1-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/attention/unittests/dense/test_flashinfer.py
cd test/ && python3 registered/attention/unittests/swa/test_flashinfer.py

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/spec/dflash/test_dflash.py

🚀 8-gpu-b300 (1 test): ✅ View workflow run

cd test/ && python3 registered/e2e/models/test_kimi_k3_b300.py

@Jiminator Jiminator left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nvpohanh

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] I've started babysitting the NVIDIA CI of this PR. I'll check it every 30 minutes until all NV pipelines pass. If a relevant job fails, I may rerun it, merge the latest main into this branch, push a small test-only fix, or post a note here.

Anyone can stop me at any time: just post a comment asking me to stop (for example, stop babysitting). I'll stop at my next check, within 30 minutes, and take no further action on this PR.

@nvpohanh
nvpohanh enabled auto-merge (squash) October 12, 2026 13:32
@nvpohanh

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] All NV pipelines have passed.

@nvpohanh

Copy link
Copy Markdown
Collaborator

@kpham-sgl could you help us to merge this? Thanks!

@nvpohanh

Copy link
Copy Markdown
Collaborator

merging since @Jiminator has approved and this is a small change and CI has passed.

@nvpohanh
nvpohanh disabled auto-merge October 14, 2026 09:15
@nvpohanh
nvpohanh merged commit df1a089 into sgl-project:main Oct 14, 2026
295 of 329 checks passed
@elvischenv
elvischenv deleted the fix-dflash-mask branch October 14, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants