Skip to content

Conversation

AyoubMDL
Copy link
Contributor

@AyoubMDL AyoubMDL commented Sep 9, 2025

This PR adds fuse_batchnorm rules to default rules.

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 adds batch normalization fusion rules to the default rewriter rules, enabling automatic optimization of BatchNorm patterns during model rewriting.

  • Refactors _fuse_batchnorm.py to use class variables instead of constructor parameters
  • Adds the fuse_batchnorm rules to the default optimization rules in __init__.py

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
onnxscript/rewriter/rules/common/_fuse_batchnorm.py Refactors classes to use ClassVar for op_type and removes constructors
onnxscript/rewriter/init.py Imports and includes _fuse_batchnorm rules in default optimization rules

Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.34%. Comparing base (647b22a) to head (d3c6f74).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2553      +/-   ##
==========================================
- Coverage   70.34%   70.34%   -0.01%     
==========================================
  Files         218      218              
  Lines       26430    26424       -6     
  Branches     2647     2647              
==========================================
- Hits        18593    18587       -6     
  Misses       6934     6934              
  Partials      903      903              

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

@justinchuby justinchuby enabled auto-merge (squash) September 9, 2025 17:59
@justinchuby justinchuby merged commit 0e79b62 into microsoft:main Sep 9, 2025
29 of 32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in ONNX Script Review Board Sep 9, 2025
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.

2 participants