Skip to content

Conversation

@gcunhase
Copy link
Contributor

@gcunhase gcunhase commented Jan 16, 2026

What does this PR do?

Type of change: Bug fix

Overview: This PR fixes an issue with calibration data with multiple samples. Previously, calibration data with multiple samples was generating a data loader with the same sample copied X times instead of generating data with X different samples.

Usage

$ python -m modelopt.onnx --onnx_path=$MODEL_NAME.onnx --calibration_data=calib_data_10.npz

Testing

Use calibration data from 5676209 and observe the output of calibration_data_reader in quantize.py:

calibration_data_reader = CalibrationDataProvider(
    onnx_path, calibration_data, calibration_shapes
)

Each calibration sample in the list should be different.

Before your PR is "Ready for review"

  • Make sure you read and follow Contributor guidelines and your commits are signed.
  • Is this change backward compatible?: Yes
  • Did you write any new necessary tests?: No
  • Did you add or update any necessary documentation?: No
  • Did you update Changelog?: Yes

Additional Information

Summary by CodeRabbit

  • Bug Fixes

    • Fixed calibration data generation in ONNX workflow to properly handle multiple samples during processing.
  • Documentation

    • Updated changelog with version 0.42 entry documenting bug fixes and new features.

✏️ Tip: You can customize this high-level summary in your review settings.

@gcunhase gcunhase requested a review from a team as a code owner January 16, 2026 22:54
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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.

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

📝 Walkthrough

Walkthrough

The PR adds a new changelog entry for version 0.42 documenting a calibration data generation bug fix in the ONNX workflow. A corresponding bug fix is implemented in the calibration utilities module to prevent shared dictionary state mutations across iterations by using a list comprehension instead of reusing a single dictionary instance.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.rst
Added new version 0.42 (TBD) changelog entry with Bug Fixes section documenting calibration data generation with multiple samples in ONNX workflow
Bug Fix
modelopt/onnx/quantization/calib_utils.py
Changed calibration_data_list initialization from shared single dictionary to list comprehension creating distinct dictionaries per iteration, preventing state mutation across loop iterations

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[5676209] Fix duplicated calib data' directly addresses the main change: fixing duplicate calibration data in the ONNX quantization workflow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

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

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.19%. Comparing base (391f6cb) to head (197d581).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/onnx/quantization/calib_utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   74.19%   74.19%           
=======================================
  Files         192      192           
  Lines       19238    19238           
=======================================
  Hits        14273    14273           
  Misses       4965     4965           

☔ View full report in Codecov by Sentry.
📢 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.

@gcunhase gcunhase requested a review from galagam January 17, 2026 01:09
@gcunhase gcunhase enabled auto-merge (squash) January 19, 2026 20:05
Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com>
Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com>
@gcunhase gcunhase force-pushed the dev/gcunhasergio/calib_data_fix branch from b153509 to 197d581 Compare January 19, 2026 21:55
@gcunhase gcunhase disabled auto-merge January 19, 2026 21:55
@gcunhase gcunhase enabled auto-merge (squash) January 19, 2026 21:56
@gcunhase gcunhase merged commit 1cc8e6b into NVIDIA:main Jan 19, 2026
36 checks passed
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.

3 participants