[None][fix] Fix Qwen3.5 NVFP4 weight loading by preserving weight_scales#13716
Conversation
…le keys _preprocess_modelopt_ckpt was blindly renaming all weight_scale keys to weight_scale_inv, which is correct for FP8 but breaks NVFP4 since NVFP4LinearMethod.load_weight_scales expects weight_scale. Detect NVFP4 layers by the presence of weight_scale_2 and skip the renaming for those. Signed-off-by: Aurelien Chartier <2567591+achartier@users.noreply.github.com>
|
/bot run |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified ChangesModelOpt Checkpoint Preprocessing Enhancement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
|
PR_Github #46603 [ run ] triggered by Bot. Commit: |
|
PR_Github #46603 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #46616 [ run ] triggered by Bot. Commit: |
|
PR_Github #46616 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #46635 [ run ] triggered by Bot. Commit: |
|
PR_Github #46635 [ run ] completed with state |
Summary by CodeRabbit
Description
_preprocess_modelopt_ckpt was blindly renaming all weight_scale keys to weight_scale_inv, which is correct for FP8 but breaks NVFP4 since NVFP4LinearMethod.load_weight_scales expects weight_scale. Detect NVFP4 layers by the presence of weight_scale_2 and skip the renaming for those.
Test Coverage
TestQwen3_5_379B_A17B
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)
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.