[TRTLLM-12229][fix] Fix MTP by scratch reuse rewind - #14403
Merged
Conversation
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #49680 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #49680 [ run ] completed with state
|
Collaborator
Author
|
/bot run |
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
jiaganc
force-pushed
the
dsv4-scratch-mtp-fix
branch
from
May 22, 2026 03:14
f91f116 to
d05ac24
Compare
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #49839 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #49839 [ run ] completed with state |
lfr-0531
approved these changes
May 22, 2026
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 10, 2026
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 11, 2026
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 12, 2026
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
jiaganc
added a commit
to jiaganc/TensorRT-LLM
that referenced
this pull request
Jun 29, 2026
Source-Commit: 7a4b113 Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
jiaganc
added a commit
to jiaganc/TensorRT-LLM
that referenced
this pull request
Jun 29, 2026
Source-Commit: 7a4b113 Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
jiaganc
added a commit
to jiaganc/TensorRT-LLM
that referenced
this pull request
Jul 1, 2026
Source-Commit: 7a4b113 Signed-off-by: Jiagan Cheng <jiaganc@nvidia.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.
@coderabbitai summary
Description
This PR merges jiaganc#1 to feature branch. Thanks @lowsfer!
This PR fixes DeepSeek V4 SWA scratch reuse rewind handling. It preserves the scratch allocation rewind state and accounts for extra KV tokens when rewinding scratch allocations, which is needed for MTP paths using SWA scratch reuse.
Scratch reuse is enabled by default for DeepSeek V4. Set
TRTLLM_DSV4_ENABLE_SWA_SCRATCH_REUSE=0only when scratch reuse needs to be disabled explicitly.Test Coverage
pytest tests/unittest/_torch/attention/sparse/deepseek_v4/test_deepseek_v4_cache_manager.pyon b200-02 GPU 4: 47 passedPR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment /bot help.