Skip to content

fix: guard MoE branch when quantization_format is None - #2185

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/unified-export-hf-guard-moe-branch-when-quantization
Open

fix: guard MoE branch when quantization_format is None#2185
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/unified-export-hf-guard-moe-branch-when-quantization

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Aug 13, 2026

Copy link
Copy Markdown

This PR addresses the following issue in modelopt/torch/export/unified_export_hf.py: guard MoE branch when quantization_format is None.

Changes

  • modelopt/torch/export/unified_export_hf.py: guard MoE branch when quantization_format is None.

Details

See the Files changed tab for the exact diff.

Tests

  • tests/torch/export/test_unified_export_hf.py

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Summary by CodeRabbit

  • Bug Fixes
    • Improved MoE pre-quantization handling when no quantization format is specified.
    • Preserved existing AWQ and SVDQuant processing behavior.

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw requested a review from a team as a code owner August 13, 2026 00:11
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 13, 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: 8d115bd5-207c-4daa-84b3-1ecaeae9406c

📥 Commits

Reviewing files that changed from the base of the PR and between b96841d and 2c976ec.

📒 Files selected for processing (1)
  • modelopt/torch/export/unified_export_hf.py

📝 Walkthrough

Walkthrough

The MoE pre-quantization resmoothing condition now requires a non-null quantization format before excluding QUANTIZATION_NONE. AWQ and SVDQuant handling remains unchanged.

Changes

MoE resmoothing

Layer / File(s) Summary
Quantization format guard
modelopt/torch/export/unified_export_hf.py
The resmoothing branch now checks that quantization_format is not None before comparing it with QUANTIZATION_NONE.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Mergeability Score: ⚪ Minimal · up to 2c976

This localized change prevents a TypeError when MoE export runs with no quantization format and adds regression coverage; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: meenchen


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Security Anti-Patterns ❓ Inconclusive The working tree has no diff, so PR-introduced security changes cannot yet be verified. Provide the PR base revision or an applicable git diff for changed modelopt/examples files.
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: guarding the MoE branch when quantization_format is None.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

1 participant