Repository navigation
[Refactor] speculative: One definition of logit adjustments and truncated sampling for verify gates - #52159
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
/rerun-test test_eagle_post_verify_graphs.py test_sharded_verify.py test_dspark_sampling_accept_graph.py test_dspark_blockwise_rejection.py test_spec_eagle.py test_eagle_constrained_decoding.py test_eagle_reject_sampling.py test_dspark_simulated_bonus.py test_uno.py test_uno_request_validation.py |
|
🚀 🚀 🚀 🚀 |
|
/run-cpu-ci |
|
🚀 Running |
Motivation
Speculative verify decides in many places whether a step adjusts its logits or truncates the target distribution, and so whether it may use vocab shards, a CUDA graph, or a fused or temperature-only accept. Each place had its own copy of the condition, and the copies had drifted: some missed the custom logit processor, the watermark, the grammar, or min-p.
Modifications
adjusts_logits(info, *, has_grammar)(grammar, penalties, logit bias, custom logit processor, watermark) andneed_truncated_sampling(info)(top-k, top-p, min-p) next toSamplingBatchInfo.sampling_allows_vocab_shardstakes the caller'sadjusts_logitsanswer. The sample-time check ineagle_samplemay see the provider'sVerifySamplingView, which carries no custom-processor flag, so it passes the adjustmentseagle_sampleapplies itself (grammar mask, watermark, penalties, logit bias), as before._verify_logits_unadjustedand the per-site field lists. Conditions that belong to one path (seeds, sampling masks, logprobs, top-k in a graph key) stay at their sites.GraphSamplingInfogainsneed_min_p_sampling, which the blockwise-rejection gate now reads.Behavior changes
Each gate now refuses a step that the path behind it does not handle:
--enable-watermarkrejects both algorithms. UNO's separate errors for grammar, penalties, logit bias, and custom processors become one error.Accuracy Tests
This change moves gate conditions and does not touch any kernel or sampling math.
test/registered/unit/{spec,speculative,sampling}: 713 passed and 40 skipped. 9 failed, and the same 9 fail on main (test_eagle_seeded_coinsx6,test_fast_prefill_planx2,test_rust_sampling_schema_stays_in_lockstep).Checklist
CI States
Latest PR Test (Base): ⊘ Skipped -- add the
run-cilabel to run CI tests.Latest PR Test (Extra): ⊘ Skipped -- add the
run-cilabel to run CI tests.Latest PR Test (AMD ROCm 10): ⊘ Skipped -- add the
run-cilabel to run CI tests.Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: