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
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 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 87.32394% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.51%. Comparing base (53a2dde) to head (965b1ec).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/onnx/autocast/precisionconverter.py 88.52% 7 Missing ⚠️
modelopt/onnx/autocast/utils.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
+ Coverage   74.50%   74.51%   +0.01%     
==========================================
  Files         183      183              
  Lines       18400    18439      +39     
==========================================
+ Hits        13709    13740      +31     
- Misses       4691     4699       +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.

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