Skip to content

Conversation

@gramalingam
Copy link
Collaborator

Capture rewrite rule name as metadata to simplify debugging issues from rewrites. This is just a basic version.

TODO / Extensions:

  • Sometimes we apply a sequence of rewrite-rules one after another, to perform complex fusions. This currently records only the last rule applied.
  • This can be solved when we merge metadata from original nodes into new nodes. (See [DRAFT] Merge metadata props when fusing #2375 )
  • May be useful standardize on a single ONNX metadata key for "source" info (that can be used by torchlib/other exporters/rewriter/optimizer etc.)

Signed-off-by: Ganesan Ramalingam <[email protected]>
Signed-off-by: Ganesan Ramalingam <[email protected]>
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.47%. Comparing base (5be9d3b) to head (484f1a6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnxscript/rewriter/pattern_test.py 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2675      +/-   ##
==========================================
+ Coverage   70.43%   70.47%   +0.03%     
==========================================
  Files         224      224              
  Lines       26778    26812      +34     
  Branches     2680     2686       +6     
==========================================
+ Hits        18862    18895      +33     
- Misses       6985     6986       +1     
  Partials      931      931              

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

@justinchuby
Copy link
Collaborator

Sometimes we apply a sequence of rewrite-rules one after another, to perform complex fusions. This currently records only the last rule applied.

Releated: #2671

@gramalingam gramalingam merged commit 93783ee into main Nov 3, 2025
33 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in ONNX Script Review Board Nov 3, 2025
@gramalingam gramalingam deleted the rama/rrmeta branch November 3, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants