Skip to content

[None][chore] Remove unnecessary buffer to save memory during refit#14331

Merged
shuyixiong merged 1 commit into
NVIDIA:mainfrom
shuyixiong:user/shuyix/remove_unnecessary_buffer
May 21, 2026
Merged

[None][chore] Remove unnecessary buffer to save memory during refit#14331
shuyixiong merged 1 commit into
NVIDIA:mainfrom
shuyixiong:user/shuyix/remove_unnecessary_buffer

Conversation

@shuyixiong

@shuyixiong shuyixiong commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Optimized weight tensor handling in FP8 quantization module to enhance loading performance and reliability of quantized models.

Review Change Stack

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's 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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • 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.

Signed-off-by: shuyixiong <219646547+shuyixiong@users.noreply.github.com>
@shuyixiong
shuyixiong requested a review from a team as a code owner May 20, 2026 04:35
@shuyixiong
shuyixiong requested a review from xxi-nv May 20, 2026 04:35
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The change modifies weight parameter application in DeepSeek FP8 quantization's resmoothing path. Resmoothed weight tensors are now updated in-place via .data.copy_() rather than full parameter replacement, while scaling factors remain on the full replacement path.

Changes

FP8 Weight Resmoothing Strategy

Layer / File(s) Summary
Weight resmoothing parameter update strategy
tensorrt_llm/_torch/modules/fused_moe/quantization.py
Resmoothed w3_w1_weight and w2_weight tensors are now updated in-place via .data.copy_() into existing parameter buffers, while corresponding scaling factors (w3_w1_weight_scaling_factor, w2_weight_scaling_factor) continue to use replace_parameter_and_save_metadata(...).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • xinhe-nv
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is incomplete. All content sections (Description, Test Coverage) are empty, containing only template comments without actual details about the changes, rationale, or test coverage. Fill in the Description section explaining why the buffer is unnecessary and how removing it saves memory. Add Test Coverage section listing relevant tests that validate the changes.
Title check ⚠️ Warning The title mentions 'Remove unnecessary buffer to save memory' but the actual change modifies weight tensor parameter replacement methodology in the resmoothing path, not buffer removal. Update the title to accurately reflect the main change, such as 'Use in-place copy for weight updates in DeepSeekFP8 resmoothing path' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@shuyixiong

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "DGX_B200-4_GPUs-PyTorch-Ray-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49336 [ run ] triggered by Bot. Commit: 8dddab6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49336 [ run ] completed with state SUCCESS. Commit: 8dddab6
/LLM/main/L0_MergeRequest_PR pipeline #38993 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@shuyixiong shuyixiong changed the title [None][chore] Remove unnecessary buffer to save memory [None][chore] Remove unnecessary buffer to save memory during refit May 20, 2026
@shuyixiong

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49387 [ run ] triggered by Bot. Commit: 8dddab6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49387 [ run ] completed with state SUCCESS. Commit: 8dddab6
/LLM/main/L0_MergeRequest_PR pipeline #39037 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@shuyixiong

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

1 similar comment
@shuyixiong

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49570 [ run ] triggered by Bot. Commit: 8dddab6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49570 [ run ] completed with state SUCCESS. Commit: 8dddab6
/LLM/main/L0_MergeRequest_PR pipeline #39197 completed with status: 'SUCCESS'

CI Report

Link to invocation

@shuyixiong
shuyixiong merged commit 47255f4 into NVIDIA:main May 21, 2026
15 of 17 checks passed
xxi-nv pushed a commit to xxi-nv/TensorRT-LLM that referenced this pull request May 22, 2026
…VIDIA#14331)

Signed-off-by: shuyixiong <219646547+shuyixiong@users.noreply.github.com>
KleinBlueC pushed a commit to KleinBlueC/TensorRT-LLM that referenced this pull request May 26, 2026
…VIDIA#14331)

Signed-off-by: shuyixiong <219646547+shuyixiong@users.noreply.github.com>
bmarimuthu-nv pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request May 28, 2026
…VIDIA#14331)

Signed-off-by: shuyixiong <219646547+shuyixiong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants