Skip to content

Conversation

@galagam
Copy link
Contributor

@galagam galagam commented Dec 7, 2025

Initial bug mentioned conditional operators, but the issue can be generalized to any subgraph in the ONNX. Support by recursively traversing subgraphs in PrecisionConverter.

What does this PR do?

Type of change: ? Bug fix

Overview:
Initial bug mentioned conditional operators, but the issue can be generalized to any subgraph in the ONNX.
Support by recursively traversing subgraphs in PrecisionConverter.

Testing

Add unit tests with conditional
tests/unit/onnx/autocast/test_precisionconverter.py::model_with_if_subgraph
tests/unit/onnx/autocast/test_precisionconverter.py::test_if_subgraph_initializer_conversion
tests/unit/onnx/autocast/test_precisionconverter.py::test_if_subgraph_mixed_precision_boundary

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?: Yes
  • Did you add or update any necessary documentation?: No
  • Did you update Changelog?: No

Additional Information

@galagam galagam requested a review from a team as a code owner December 7, 2025 13:10
@galagam galagam requested a review from gcunhase December 7, 2025 13:10
@galagam
Copy link
Contributor Author

galagam commented Dec 7, 2025

/bot run

@galagam galagam requested review from kevalmorabia97 and removed request for gcunhase December 7, 2025 20:00
@kevalmorabia97 kevalmorabia97 requested review from ajrasane and removed request for kevalmorabia97 December 8, 2025 04:34
@galagam galagam force-pushed the autocast-subgraphs branch from a238cc4 to 965b1ec Compare December 9, 2025 17:58
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 72.30769% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.73%. Comparing base (b2d8fa1) to head (a335322).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/onnx/autocast/precisionconverter.py 70.90% 16 Missing ⚠️
modelopt/onnx/autocast/utils.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #659   +/-   ##
=======================================
  Coverage   74.72%   74.73%           
=======================================
  Files         192      192           
  Lines       18833    18872   +39     
=======================================
+ Hits        14073    14104   +31     
- Misses       4760     4768    +8     

☔ 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.

Copy link
Contributor

@gcunhase gcunhase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@gcunhase
Copy link
Contributor

Should we update the Changelog for this? Up to you if you think it's major enough, thanks.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 17, 2025

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.

Initial bug mentioned conditional operators, but the issue can be generalized to any subgraph in the ONNX.
Support by recursively traversing subgraphs in PrecisionConverter.

Signed-off-by: Gal Hubara Agam <[email protected]>
@galagam galagam enabled auto-merge (squash) December 17, 2025 16:40
@galagam galagam disabled auto-merge December 17, 2025 17:07
@galagam galagam enabled auto-merge (squash) December 17, 2025 17:08
@kevalmorabia97 kevalmorabia97 merged commit fc7ebe2 into NVIDIA:main Dec 18, 2025
56 of 69 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