Skip to content

Explore topK overflow/non-determinism - #53287

Draft
LopezCastroRoberto wants to merge 3 commits into
vllm-project:mainfrom
LopezCastroRoberto:codex/fix-topk-candidate-overflow
Draft

LopezCastroRoberto wants to merge 3 commits into
vllm-project:mainfrom
LopezCastroRoberto:codex/fix-topk-candidate-overflow

Conversation

@LopezCastroRoberto

@LopezCastroRoberto LopezCastroRoberto commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Context: #51782, #52149

The evaluation shows no measurable accuracy regression in MAIN, meaning that either overflow is never hit in real use-cases/data-distributions, or that non-determinism in top-K doesn't affect model accuracy. Note that, even when overflow occurs (which is a rare event) the discarded candidates will have the same high bits as the retained ones. Retained and discarded candidates belong to the same current radix-threshold bin. Therefore, they share the radix prefix, meaning their values are close.

dsv4_mrcr



A double-check of this is that no performance regressions were observed in our e2e evals with the current PR, reinforcing the idea that overflow doesn't happen, or it is very rare. Even with this PR, where overflow situations were optimized, there is a non-trivial overhead vs non-overflow cases kernel-wise.

handle_overf

This PR pretends to be a go-to if this becomes a real issue in the future.

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: LopezCastroRoberto <rocastro@redhat.com>
@mergify mergify Bot added the bug Something isn't working label Aug 21, 2026
LopezCastroRoberto and others added 2 commits August 21, 2026 17:45
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: LopezCastroRoberto <rocastro@redhat.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: LopezCastroRoberto <rocastro@redhat.com>
@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @LopezCastroRoberto.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant