-
Notifications
You must be signed in to change notification settings - Fork 97
[Rewriter] Extend list of supported commutative operations #2741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Christoph Berganski <christoph.berganski@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2741 +/- ##
=======================================
Coverage 70.09% 70.09%
=======================================
Files 226 226
Lines 27388 27389 +1
Branches 2781 2781
=======================================
+ Hits 19198 19199 +1
Misses 7234 7234
Partials 956 956 ☔ View full report in Codecov by Sentry. |
|
@gramalingam do you see potential performance impact with this change? |
| return len(self._outputs) | ||
|
|
||
| def commute(self) -> Sequence[GraphPattern]: | ||
| # List all commutative elementwise (binary) operators for which we |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine ... but, please note that the existing implementation can lead to an exponential increase in the number of patterns that are checked, with efficiency implications. (The underlying implementation needs to be improved: for example, now that there is support for disjunctive (OR) patterns, it may be useful to use that instead of creating many patterns.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make commute rewrite the pattern into disjunctive patterns instead?
Note: This tracks the not-yet-merged extended commutativity pattern PR, see microsoft/onnxscript#2741
No description provided.