Skip to content

[Feat] hisparse: reject unvalidated speculative algorithms by name - #48846

Merged
ispobock merged 4 commits into
sgl-project:mainfrom
mlleo:pr/hisparse-spec-gate
Nov 12, 2026
Merged

ispobock merged 4 commits into
sgl-project:mainfrom
mlleo:pr/hisparse-spec-gate

Conversation

@mlleo

@mlleo mlleo commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reject speculative algorithms that have not been validated with --enable-hisparse at startup. Workers that do not bind HiSparse verify slots can otherwise write target-verify KV through incorrect device mappings.

Allow EAGLE, EAGLE3, and UNO; retain the existing linear-speculation and no-adaptive-speculation restrictions. STANDALONE and FROZEN_KV_MTP share the EAGLE verify path but remain excluded until draft-input staging and draft-pool sizing are validated.

Validation

  • Local AST comparison confirms that removing the explanatory comments leaves production behavior unchanged.
  • Python syntax, git diff --check, and all applicable pre-commit checks passed.
  • No new committed tests. GPU/model validation was not run for this cleanup.

CI States

Latest PR Test (Base): ✅ Run #43065719414
Latest PR Test (Extra): ❌ Run #43065719130
Latest PR Test (AMD ROCm 10): ⏳ Run #43065719204

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

HiSparse spec support lives in the EAGLE-family and UNO workers
(run_eagle_verify binds the verify slots via
HiSparseCoordinator.prepare_spec_verify / commit_spec_accept_tokens).
A worker that never binds those slots writes target-verify KV through
unmapped device locations -- silent corruption, not an error. Gate
unvalidated algorithms (DFLASH, DSPARK, NGRAM, STANDALONE,
FROZEN_KV_MTP, plugins) with a named startup error listing the
validated combinations.

STANDALONE and FROZEN_KV_MTP subclass EAGLEWorkerV2 and inherit the
same verify path, so the binding mechanism covers them; they remain
rejected only because the combination is unvalidated (draft-input
staging, draft-pool sizing), and can be enabled after testing.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mlleo

mlleo commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@hnyls2002 @ShangmingCai could you review this? This adds a startup gate rejecting unvalidated speculative algorithms (which would otherwise corrupt KV silently)

@alphabetc1 alphabetc1 added the run-ci CI: run the baseline test suite on this PR label Nov 11, 2026
@ispobock
ispobock merged commit 4464374 into sgl-project:main Nov 12, 2026
204 of 215 checks passed
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