[Spec] Fix spec_accept_rate and unify accept/draft naming#23530
Merged
[Spec] Fix spec_accept_rate and unify accept/draft naming#23530
spec_accept_rate and unify accept/draft naming#23530Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
a65d933 to
e0594c0
Compare
spec_accept_rate and unify accept/draft naming
Collaborator
Author
|
/rerun-test registered/8-gpu-models/test_deepseek_v3_mtp.py test_step3p5_flash_chain_mtp.py test_dsa_models_mtp.py test_deepseek_v32_fp4_mtp_4gpu.py |
Contributor
|
✅ ✅ |
4 tasks
vguduruTT
pushed a commit
to vguduruTT/sglang
that referenced
this pull request
May 2, 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.
Summary
spec_accept_ratebias (was(accepted+1)/(proposed+1)instead ofaccepted/proposed)accept+draft→ strict drafts-only count; name containsacceptwithoutdraft→ includes bonus tokenBug Fix
(num_accepted_drafts + bs) / (bs * num_draft_tokens)had two errors:1/num_draft_tokensinstead of 0)-1)(k-m)/(k(k+1))num_accepted_drafts / (bs * num_proposed_drafts)is strict drafts-accepted / drafts-proposedmeta_info["spec_accept_rate"]computationRenames (drafts-only counts)
GenerationBatchResult.num_accepted_tokens→num_accepted_draftsReq.spec_accepted_tokens→Req.spec_accepted_draftsBatchTokenIDOutput.spec_accepted_tokens→spec_accepted_drafts(IPC dataclass field)update_spec_metrics(num_accepted_tokens)/report_decode_stats(num_accepted_tokens=)parametereagle_worker,ngram_worker,dflash_worker,multi_layer_eagle_worker,ngram_infoExternal
meta_infokeysmeta_info["spec_accept_token_num"]→spec_accepted_draftsmeta_info["spec_draft_token_num"]→spec_proposed_draftsmeta_info["spec_accept_rate"],meta_info["spec_accept_length"],meta_info["spec_verify_ct"]unchangedPreserved (follow convention:
acceptwithoutdraft→ includes bonus)Scheduler.spec_num_accepted_tokens/spec_total_num_accepted_tokens(per-log-interval / lifetime accumulators)sglang:spec_accept_lengthPrometheus gauge (mean output tokens per forward, includes bonus)Breaking
sglang:spec_accept_ratePrometheus value changes (intermediate rates de-biased; endpoints unchanged at 0/1)meta_infokey renames aboveTest Plan
test_eagle_infer.pytest_ngram_infer.py