[V1][Metrics] Initial speculative decoding metrics - #15151
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
cd3ecad to
4cac140
Compare
There was a problem hiding this comment.
I'm a bit uncertain whether to include this in the count ... it matches what I was getting at the rejection sampler level, but ... I guess it depends what we want the system efficiency metric to mean.
Will dig into it, but thoughts welcome!
There was a problem hiding this comment.
See commit 586f1233797b3401ce2d25cb2d9983d2dd9d6943
[V1][Speculative Decoding] Properly account for ngram drafter
When the ngram drafter proposes zero tokens, we should treat
this as a proposal of num_spec_tokens which were all rejected.
This will allow us to compare fairly across ngram vs draft
models.
Encode a zero-token proposal in ModelRunnerOutput as an
empty list, whereas None means no speculating was done. This
also requires Request.spec_token_ids empty list to be
interpretted this way by the scheduler.
7f4ecd7 to
4cac140
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
4cac140 to
5bb7953
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
5bb7953 to
478238d
Compare
|
I've rebased and pulled out a bunch of stuff from this PR to try and simplify the discussion:
On the topic of properly tracking
This PR will calculate |
|
I've removed |
|
Note also, at @WoosukKwon's request we retain the most simplistic behavior for ngram prompt lookup - for |
|
For reference, here is a mini design doc we've been using to discuss the above |
Fixes vllm-project#13990, part of vllm-project#10582 Omitting system efficiency for now. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Now just num_accepted_tokens, num_draft_tokens, and acceptance rate. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
19b10b8 to
840f4ce
Compare
|
Rebased to pull in CI fix from #15757 |
|
Looks generally good to me. However, as we discussed offline, I think the draft & accepted number of tokens per position (0, 1, ..., |
Absolutely. I think there's a lot more ideas to explore. I'd like to take this incrementally though and start by adding back the acceptance rate metric that we had in V0. This lays the groundwork for adding future metrics also. |
Unless we think the acceptance rate metric (i.e. num_draft and num_accepted) itself is useless and we want to deprecate those too! I don't believe so, though. I think we will continue to want a single metric to compare performance over time and between models. |
WoosukKwon
left a comment
There was a problem hiding this comment.
@markmc Got it. Looks good to me as the first step.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: xinyuxiao <xinyuxiao2024@gmail.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
…alidation + workload acceptance analysis - SUB_071 (500p × 8192in × 8192max, 4 cell): chat vanilla 2,186 → spec7+cap8 3,007 (+37.5%) / code vanilla 6,965 → spec 5,347 (−23.2% 회귀) - SUB_047 best 는 workload-shape 의존 (sonnet-like 만 가속) 확정. production 적용 시 workload-aware gating (code 검출 → spec OFF) 필수. - analysis/workload_acceptance_analysis_20260524.md (680 lines) 신규: R/K 정량 모델 + Leviathan 2022 closed-form alignment + workload별 prompt 구조 분석 + workload-aware gating heuristic + 40 외부 reference (Leviathan/Chen/PLD/EAGLE/Medusa/REST/Lookahead/SuffixDecoding + vLLM PR vllm-project#24986/vllm-project#12193/vllm-project#15151/vllm-project#29779 + issue vllm-project#16258/vllm-project#19254 + Spec-Bench/Cascade/Nightjar/DSDE 등) + §11 SUB_047 vs literature 8개 구현 차별점 정리 - planning/SUB_071_workload_large_chatcode.md, measurements/sub071_workload_large_20260524/RESULTS.md 신규 - id_registry: SUB_071 완료 entry 추가, 다음 부여 번호 072 - Best_SpecDecode_10778tps.md §7.3 + INDEX.md §1/§4/§6 cross-link 갱신 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Fixes #13990, part of #10582
cc @WoosukKwon @LiuXiaoxuanPKU @sroy745