[TRTLLM-12374][fix] Tighten DSv4 cache constraint floor to match warmup shapes#13657
Merged
lfr-0531 merged 1 commit intoApr 30, 2026
Merged
Conversation
Constraint 1 used history_length=0 with capacity=max_seq_len, which is the
worst-case freshest state that never actually occurs at runtime. On DSv4-Pro
with 64 layers and max_seq_len=300K this pushed min_quota above the user
quota and caused cuMemCreate failures during V2 KV cache init even at
batch_size=8.
Reshape the constraints to match the two warmup forms:
C1 (cuda graph generation warmup): one decode request at the tail of
max_seq_len -- capacity=max_seq_len, history_length=max_seq_len-1.
SWA / SSM pools collapse to their windowed working set; full-cache
pools still reserve max_seq_len/tokens_per_block blocks.
C2 (general / chunked-prefill warmup): one fresh context request of the
per-iteration token budget -- capacity=max_num_tokens,
history_length=0.
Also pass max_num_tokens (rather than max_seq_len) as the capacity of the
single context request in typical_step, matching the same per-iteration
budget.
Signed-off-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com>
Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com>
4cb79f5 to
939926d
Compare
lfr-0531
pushed a commit
that referenced
this pull request
May 7, 2026
…up shapes (#13657) Signed-off-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com> Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com> Co-authored-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com>
lfr-0531
pushed a commit
that referenced
this pull request
May 14, 2026
…up shapes (#13657) Signed-off-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com> Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com> Co-authored-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
May 29, 2026
…up shapes (NVIDIA#13657) Signed-off-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com> Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com> Co-authored-by: Lance Liao <laliao@login-bia01.bia.clusters.nvidia.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 8e8f37d) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.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.
Summary
DSv4-Pro hits
cuMemCreate-FAILduring V2 KV cache initialization at small batch sizes (e.g.,max_batch_size=8), with accumulated allocation reaching ~124.7 GiB even though the user-derivedquota_from_max_tokensis only 117.84 GiB. This isnot a batch-size problem — the constraint floor is over-reserving.
Root cause
_storage_manager.py::_compute_slot_count_for_leveltakes: