-
Notifications
You must be signed in to change notification settings - Fork 183
Support MOE Export for Nemotron H #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded four imports ( Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Caller
participant Plugin as mcore_nemotron.py
participant McoreCustom as mcore_custom
participant Mappings as Import/Export Dicts
Note over Plugin,McoreCustom: expose additional symbols and extend mappings
Caller->>Plugin: request nemotron mappings & exports
Plugin->>McoreCustom: import COL_ETP, ROW_ETP, QKVMerging, QKVSlicing
Plugin->>Mappings: build base nemotron import/export dicts
Mappings->>Mappings: insert "router"
Mappings->>Mappings: insert "local_experts.linear_fc1"/"linear_fc2"
Mappings->>Mappings: insert "shared_experts.linear_fc1"/"linear_fc2"
Plugin->>Caller: return updated mappings and exported symbols
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #447 +/- ##
=======================================
Coverage 73.39% 73.39%
=======================================
Files 180 180
Lines 17976 17976
=======================================
Hits 13193 13193
Misses 4783 4783 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
modelopt/torch/export/plugins/mcore_nemotron.py
(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
modelopt/torch/export/plugins/mcore_nemotron.py (1)
modelopt/torch/export/plugins/mcore_custom.py (1)
NameRemapping
(82-91)
🪛 GitHub Actions: Code Quality
modelopt/torch/export/plugins/mcore_nemotron.py
[error] 1-1: pre-commit checks failed. Ruff check reported issues and formatting changes were applied by hooks; the pre-commit run exited with code 1.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: partial-install (torch)
- GitHub Check: partial-install (onnx)
- GitHub Check: multi-transformers (min)
- GitHub Check: multi-torch (26)
- GitHub Check: multi-py (11)
- GitHub Check: multi-torch (27)
- GitHub Check: windows
- GitHub Check: multi-py (10)
🔇 Additional comments (3)
modelopt/torch/export/plugins/mcore_nemotron.py (3)
20-22
: LGTM! New imports are necessary for MoE support.The
COL_ETP
andROW_ETP
imports are correctly added and used in the local_experts mappings below.
101-106
: LGTM! MoE export mappings are consistent.The MoE mappings for export are well-structured and consistent with the existing export dictionary patterns, using the correct
"backbone.layers"
prefix throughout.
1-1
: All pre-commit and ruff checks now pass—no action required.The trailing whitespace on line 76 and other ruff formatting issues have been resolved. Verification confirms zero remaining errors and no trailing whitespace in the file.
Signed-off-by: Jennifer Chen <[email protected]>
02be52e
to
15a8351
Compare
c2014a5
to
d48514d
Compare
Signed-off-by: Jennifer Chen <[email protected]>
a86c7af
to
614f4df
Compare
What does this PR do?
Type of change: New feature
Overview: Support Mamba-MOE export for Nemotron H
Usage
# Add a code snippet demonstrating how to use this
Testing
Will test MLM import/export using MLM scripts
Before your PR is "Ready for review"
Additional Information
Summary by CodeRabbit