Skip to content

[ROCm][CI] Align spec decode logprob test prefill settings - #41335

Merged
tjtanaa merged 2 commits into
vllm-project:mainfrom
ROCm:akaratza_fix_logprobs
May 4, 2026
Merged

[ROCm][CI] Align spec decode logprob test prefill settings#41335
tjtanaa merged 2 commits into
vllm-project:mainfrom
ROCm:akaratza_fix_logprobs

Conversation

@AndreasKaratzas

Copy link
Copy Markdown
Member

This PR fixes a ROCm-only failure in test_spec_decode_logprobs for the ngram speculative decoding cases. The test compares logprobs from a regular base-model run against logprobs from a speculative decoding run. For that comparison to isolate speculative decoding, both LLM instances need to use the same execution settings. Before this change, the spec-decode LLM forced chunked prefill with enable_chunked_prefill=True and max_num_batched_tokens=32, while the reference LLM did not.

On ROCm, floating-point reductions can vary with batch geometry and scheduling. That means the two runs could produce slightly different logprobs even when speculative decoding itself was behaving correctly. The observed failure was a logprob difference of about 0.235, which exceeded the test tolerance.

This change factors the shared LLM options into llm_kwargs and passes them to both the reference and spec-decode LLMs. The only intended difference between the two runs is now the speculative decoding configuration, so the test better serves its original purpose.

cc @kenroche

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas AndreasKaratzas added the rocm Related to AMD ROCm label Apr 30, 2026
@AndreasKaratzas
AndreasKaratzas marked this pull request as ready for review April 30, 2026 05:05
@github-project-automation github-project-automation Bot moved this to Todo in AMD Apr 30, 2026

@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.

@mergify mergify Bot added the v1 label Apr 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the test_spec_decode_logprobs test to use a shared configuration dictionary for both the reference and speculative LLM instances. By enforcing consistent chunked prefill settings and batch sizes, the changes ensure that logprob comparisons remain deterministic and isolated from batch geometry variations on ROCm hardware. I have no feedback to provide as there were no review comments.

@Bortlesboat Bortlesboat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks right. Worth flagging that this also narrows what the test exercises — the prior setup had ref_llm running in default scheduling and spec_llm in chunked prefill, so the comparison was implicitly mixing "spec decode correctness" with "logprobs are stable across scheduling shifts." The cross-scheduling part is what was producing the ROCm noise in the first place. Forcing both runs into the same enable_chunked_prefill=True / max_num_batched_tokens=32 isolates it to spec decode only, which is the test's actual job. The shared llm_kwargs factoring also makes any future drift between the two configs impossible by construction.

@tjtanaa tjtanaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@tjtanaa tjtanaa added the ready ONLY add when PR is ready to merge/full CI is needed label May 4, 2026
@tjtanaa
tjtanaa enabled auto-merge (squash) May 4, 2026 03:38
@tjtanaa
tjtanaa merged commit 01d4d1a into vllm-project:main May 4, 2026
17 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD May 4, 2026
@AndreasKaratzas
AndreasKaratzas deleted the akaratza_fix_logprobs branch May 4, 2026 04:54
chaojun-zhang pushed a commit to chaojun-zhang/vllm that referenced this pull request May 6, 2026
Copilot AI pushed a commit to hongbolv/vllm that referenced this pull request May 7, 2026
…ect#41335)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Co-authored-by: hongbolv <33214277+hongbolv@users.noreply.github.com>
ikaadil pushed a commit to ikaadil/vllm that referenced this pull request May 7, 2026
…ect#41335)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Ifta Khairul Alam Adil <ikaadil007@gmail.com>
weifang231 pushed a commit to weifang231/eb-vllm that referenced this pull request May 13, 2026
mfylcek pushed a commit to mfylcek/vllm that referenced this pull request May 19, 2026
jhu960213 pushed a commit to jhu960213/vllm that referenced this pull request May 20, 2026
mvanhorn pushed a commit to mvanhorn/vllm that referenced this pull request Jun 4, 2026
…ect#41335)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants