[Pooling] Validate non-negative rerank top_n#46119
Merged
yewentao256 merged 2 commits intoJun 22, 2026
Merged
Conversation
yewentao256
reviewed
Jun 20, 2026
Member
There was a problem hiding this comment.
We don't need to have this unit test spcially for this small update
Contributor
Author
There was a problem hiding this comment.
Removed the unit test commit.
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
ed7d500 to
6918f14
Compare
yewentao256
approved these changes
Jun 20, 2026
yewentao256
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the work!
nkzhenhua
pushed a commit
to nkzhenhua/vllm
that referenced
this pull request
Jun 24, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
qli88
pushed a commit
to qli88/vllm
that referenced
this pull request
Jun 26, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Signed-off-by: Qiang Li <qiang.li2@amd.com>
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.
Purpose
top_nrepresents a result count for rerank requests, so negative values are invalid input. Before this change, top_n=-1 was silently accepted and treated the same astop_n=0, returning all rerank results. This could hide client-side bugs and make request behavior harder to reason about.This PR adds request-level validation so
top_nmust be non-negative, while preserving the existing behavior thattop_n=0means “return all results” and values larger than the document count are accepted. It also adds protocol-level tests for the default, valid, oversized, and negative cases.Test Plan
Run the standard
pre-commit hookTest Result
Tests pass