Reject negative TRT-LLM seed values#8822
Open
fallintoplace wants to merge 1 commit into
Open
Conversation
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
This rejects negative
seedvalues when building TRT-LLM-format generation requests.The public OpenAI schemas currently allow signed 64-bit seeds, but the TRT-LLM request path sends the value as a
uint64tensor. Without this check, schema-valid negative values fail during NumPy conversion instead of returning a clear client error.Why
A request such as
seed: -1should be handled as invalid input for this request format before request tensor construction. Returningseed must be non-negativekeeps the error actionable and prevents an implementation-level overflow failure.Tests
git diff --check -- python/openai/openai_frontend/engine/utils/triton.py python/openai/tests/test_triton_utils.pypython3 -m py_compile python/openai/openai_frontend/engine/utils/triton.py python/openai/tests/test_triton_utils.pyI could not run the targeted pytest locally because this checkout's Python environment is missing the OpenAI frontend test/runtime packages (
numpy,pydantic,pytest, andtritonserver).