Repository navigation
Use runtime token widths for Triton speculative verification - #39859
Merged
Merged
Conversation
Resolve eager and graph verification widths from runtime metadata, preserve the shared optional attention-mask contract, and use actual prefix lengths for deterministic sliding-window attention. Co-authored-by: raghotham <853234+raghotham@users.noreply.github.com>
merrymercy
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
Ying1123,
hebiao064,
hnyls2002 and
ispobock
as code owners
September 16, 2026 22:08
Collaborator
Author
|
/tag-and-rerun-ci |
Initialize the per-runner enum expected by decode_num_tokens_per_req. This matches the published non-speculative configuration; verification widths continue to come from runtime SpecInput metadata. Validation: all nine Triton MLA tests passed on GB300, including target verification and draft CUDA graphs. Scoped pre-commit checks passed.
merrymercy
commented
Sep 17, 2026
Collaborator
|
/tag-and-rerun-ci |
Collaborator
Author
|
/rerun-test test_spec_eagle_triton.py |
Contributor
|
Results for 🚀 |
merrymercy
deleted the
lianmin/spec-verify-runtime-metadata-20260916
branch
September 18, 2026 18:07
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.
Summary
Triton target verification can omit the bonus token when it uses the draft proposal count for query and mask offsets. Use the speculative input's runtime token width, falling back to the model runner's capture width when metadata is absent or unset. Deterministic sliding-window attention also uses the actual prefix length and resolved verification width.
Give speculative inputs a shared optional attention-mask default while preserving Eagle's required constructor fields. Add CPU regression coverage for eager metadata, capture, padded replay, and sliding-window offsets.
Test plan
LD_PRELOAD=/usr/lib64/libnuma.so.1 uv run --no-sync python -m pytest -q test/registered/unit/layers/attention/test_triton_verify_metadata.py test/registered/unit/spec/test_eagle_worker_v2_topk1_fastpath.py— 19 tests and 7 subtests passed.CUDA_VISIBLE_DEVICES=1 LD_PRELOAD=/usr/lib64/libnuma.so.1 uv run --no-sync python -m pytest -q test/registered/attention/unittests/dense/test_triton.py— 10 tests and 42 subtests passed on NVIDIA GB300, including eager speculative verification and CUDA-graph cases.with-proxy uv run --project "$SYNC_LINT_ENV" --no-sync pre-commit run --files python/sglang/srt/layers/attention/triton_backend.py python/sglang/srt/speculative/eagle_info.py python/sglang/srt/speculative/spec_info.py test/registered/unit/spec/test_eagle_worker_v2_topk1_fastpath.py test/registered/unit/layers/attention/test_triton_verify_metadata.py— passed using the installed lint environment.git diff --cached --check— passed.Original commits
50ef144be241dc09ca871f03315e18a8048b67c0CI States
Latest PR Test (Base): 🚫 Run #35199622054
Latest PR Test (Extra): ❌ Run #35199621976
Latest PR Test (AMD ROCm 10): ❌ Run #35199622067