Skip to content

Add non-mutating quantized weight export API - #2193

Draft
mxinO wants to merge 2 commits into
mainfrom
mxin/modelopt-real-quant-canonical
Draft

Add non-mutating quantized weight export API#2193
mxinO wants to merge 2 commits into
mainfrom
mxin/modelopt-real-quant-canonical

Conversation

@mxinO

@mxinO mxinO commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a public, non-mutating API for exporting one quantized weight from opaque ModelOpt state
  • keep packing and Hugging Face quantization config generation owned by ModelOpt
  • support state synchronization, replication, and compatibility checks needed by distributed streaming exporters
  • preserve grouped-expert quantizer state during restore

Initial scope

Dynamic-block NVFP4 W4A4 and W4A16. Unsupported state topologies fail explicitly.

Validation

  • 12 focused export/unit tests passed
  • ruff check and format passed
  • aggregate implementation review completed with no material findings

Signed-off-by: Meng Xin <mxin@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fe420f24-b0dd-424f-85a5-b9b1bc8a3091

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://NVIDIA.github.io/Model-Optimizer/pr-preview/pr-2193/

Built to branch gh-pages at 2026-08-14 12:52 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.82%. Comparing base (a57fb44) to head (e58473a).

Files with missing lines Patch % Lines
modelopt/torch/export/quantized_weight.py 94.92% 7 Missing ⚠️
modelopt/torch/quantization/plugins/custom.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2193      +/-   ##
==========================================
+ Coverage   78.78%   78.82%   +0.04%     
==========================================
  Files         522      523       +1     
  Lines       60476    60622     +146     
==========================================
+ Hits        47644    47786     +142     
- Misses      12832    12836       +4     
Flag Coverage Δ
unit 55.46% <94.59%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Meng Xin <mxin@nvidia.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.

1 participant