Skip to content

[https://nvbugs/6248827][fix] Wrap both accesses in getattr(self.config, 'num_nextn_predict_layers', 0) - #14932

Closed
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6248827
Closed

[https://nvbugs/6248827][fix] Wrap both accesses in getattr(self.config, 'num_nextn_predict_layers', 0)#14932
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6248827

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: DeepseekV3WeightLoader.load_weights unconditionally reads self.config.num_nextn_predict_layers, but _MistralPretrainedConfig (non-MTP, routed here since commit 651853b made MistralLarge3 delegate to super().load_weights) has no such attribute, raising AttributeError before weight loading.
  • Fix: Wrap both accesses in getattr(self.config, 'num_nextn_predict_layers', 0) (mirroring the existing precedent in modeling_exaone_moe.py:649-650), keeping the normal weight-load path running; also removed the now-fixed waiver (waives.txt:126).
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Bug Fixes

    • Improved robustness of model weight loading for DeepseekV3, with better handling of missing configuration attributes.
  • Tests

    • Updated test configuration for accuracy validation.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9197c505-a541-4a0e-bc24-4e897e4f812c

📥 Commits

Reviewing files that changed from the base of the PR and between 846d0f4 and d121154.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/models/modeling_deepseekv3.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

📝 Walkthrough

Walkthrough

This PR refactors MTP weight detection in DeepseekV3 to handle missing config attributes gracefully, replacing a helper function with direct safe-default computation. It also updates test waivers for Mistral test parameterization.

Changes

DeepseekV3 weight loading and test waiver updates

Layer / File(s) Summary
DeepseekV3 shared MTP checkpoint detection refactor
tensorrt_llm/_torch/models/modeling_deepseekv3.py
Simplifies DeepseekV3WeightLoader.load_weights by removing the detect_shared_mtp_weights() helper and directly computing has_shared_mtp_weights using getattr defaults for num_nextn_predict_layers and _ckpt_num_nextn_predict_layers, making the logic more robust to missing config attributes.
Test waiver parameter update
tests/integration/test_lists/waives.txt
Updates the waiver entry for TestMistralLarge3_675B::test_nvfp4_4gpus, replacing parameterization latency_moe_trtllm with latency_moe_trtllm_eagle and its associated NV bug link.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#14789: Both PRs modify the waiver for accuracy/test_llm_api_pytorch.py::TestMistralLarge3_675B::test_nvfp4_4gpus[latency_moe_trtllm*] parameterizations.
  • NVIDIA/TensorRT-LLM#14457: Both PRs refactor shared-MTP weight detection in DeepseekV3 weight loading, using derived model and checkpoint layer counts.
  • NVIDIA/TensorRT-LLM#14792: Both PRs adjust test waivers for accuracy/test_llm_api_pytorch.py::TestMistralLarge3_675B::test_nvfp4_4gpus parameterizations.

Suggested reviewers

  • hlu1
  • danielafrimi
  • jieli-matrix
  • joyang-nv
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: wrapping accesses to getattr(self.config, 'num_nextn_predict_layers', 0) to fix an AttributeError in DeepseekV3WeightLoader.
Description check ✅ Passed The description includes root cause, solution, test plan verification, and bug link. All required template sections are adequately addressed.
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.

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6248827 branch from d121154 to a975809 Compare June 27, 2026 10:27
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6248827 branch from a975809 to c753b08 Compare July 6, 2026 02:30
@2ez4bz
2ez4bz enabled auto-merge (squash) July 6, 2026 17:09
@2ez4bz

2ez4bz commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #57788 [ run ] triggered by Bot. Commit: c753b08 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #57788 [ run ] completed with state SUCCESS. Commit: c753b08
/LLM/main/L0_MergeRequest_PR pipeline #46487 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

@MartinMarciniszyn

Copy link
Copy Markdown
Collaborator

Replaced by !15123

auto-merge was automatically disabled July 7, 2026 10:17

Pull request was closed

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