Skip to content

Conversation

justinchuby
Copy link
Member

@justinchuby justinchuby commented Oct 1, 2025

This PR implements shape merging functionality in the identity elimination pass to preserve shape information when eliminating redundant Identity nodes.

Following microsoft/onnxscript#2588.

Following microsoft/onnxscript#2588. Handle shape info as well.

Signed-off-by: Justin Chu <[email protected]>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements shape merging functionality in the identity elimination pass to preserve shape information when eliminating redundant Identity nodes. The change builds on previous work to handle shape metadata during optimization.

  • Adds a _merge_shapes helper function to intelligently combine shape information from input and output values
  • Updates the identity elimination logic to preserve the most complete shape and type information available

Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 23.80952% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.58%. Comparing base (49a361c) to head (fbc9fbf).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/onnx_ir/passes/common/identity_elimination.py 23.80% 11 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
- Coverage   76.80%   76.58%   -0.23%     
==========================================
  Files          40       40              
  Lines        4915     4936      +21     
  Branches      978      986       +8     
==========================================
+ Hits         3775     3780       +5     
- Misses        856      867      +11     
- Partials      284      289       +5     

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

justinchuby and others added 2 commits October 1, 2025 09:01
Signed-off-by: Justin Chu <[email protected]>
@justinchuby justinchuby added this to the 0.1.11 milestone Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants