fix(trtllm): [cherry-pick 1.5.0] stop a configured --context-length being silently discarded (#14450) - #14683
Merged
Conversation
…ded (#14450) Signed-off-by: svc-glamr@nvidia.com <svc-glamr@nvidia.com> Signed-off-by: tanmayv25 <tanmay2592@gmail.com> Co-authored-by: tanmayv25 <tanmay2592@gmail.com> Co-authored-by: Tanmay Verma <tanmayv@nvidia.com> (cherry picked from commit 38bb25d) Signed-off-by: Yunzhou (David) Liu <232973175+yunzhoul-nv@users.noreply.github.com>
| let max_input_len = u32::try_from(info.max_input_len) | ||
| .ok() | ||
| .filter(|len| *len > 0); | ||
| if max_seq_len.is_some() && max_seq_len == max_input_len { |
There was a problem hiding this comment.
An equal positive max_seq_len/max_input_len pair is not unique to the fallback case. In particular, an engine explicitly started with --max_seq_len 1024 has the documented default max_input_len of 1024, so this discards the real configured context length. With no separate --context-length, registration loses the context window and requests omitting max_tokens are rejected.
🤖 AI Fix
Only discard a reported value when TensorRT-LLM exposes an unambiguous indication that max_seq_len was omitted; otherwise preserve positive max_seq_len, including equal pairs.
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.
Cherry-pick of #14450 to
release/1.5.0.This backport makes an explicit TensorRT-LLM
--context-lengthtake precedence over the engine's reported value, avoiding an under-reported context window and incorrect defaultmax_tokens. It also aligns the aggregate launch script's engine and sidecar context-length configuration.Signed-off cherry-pick with
-x --signoff.Validation:
9e90791a0072bf14bf54f19fa80c3b61e1fd508e).git diff --check release/1.5.0...HEADpassed.cargo fmt,cargo check,cargo clippy, andcargo test -p dynamo-trtllm-sidecarvalidations were not rerun becausecargois unavailable in this environment.pre-commitchecks were not run becausepre-commitis unavailable in this environment.