-
Notifications
You must be signed in to change notification settings - Fork 9
[Pass] Support CSE constant nodes #92
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
[Pass] Support CSE constant nodes #92
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
=======================================
Coverage 74.51% 74.51%
=======================================
Files 37 38 +1
Lines 4595 4686 +91
Branches 933 957 +24
=======================================
+ Hits 3424 3492 +68
- Misses 826 841 +15
- Partials 345 353 +8 ☔ View full report in Codecov by Sentry. |
@justinchuby Not sure why I checked the sign off, but DCO still fails... |
84ad83b
to
342add5
Compare
Very nice, thanks! |
@titaiwangms maybe ensure that the email you signoff with matches the github account you use? |
Signed-off-by: Ti-Tai Wang <[email protected]>
Signed-off-by: Ti-Tai Wang <[email protected]>
Co-authored-by: Justin Chu <[email protected]> Signed-off-by: Ti-Tai Wang <[email protected]>
Signed-off-by: Ti-Tai Wang <[email protected]>
c626f55
to
7f853a8
Compare
Co-authored-by: Justin Chu <[email protected]> Signed-off-by: Ti-Tai Wang <[email protected]>
@gramalingam for another review |
Signed-off-by: Ti-Tai Wang <[email protected]>
src/onnx_ir/passes/common/common_subexpression_elimination_test.py
Outdated
Show resolved
Hide resolved
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.
LGTM, modulo couple of minor nits
Signed-off-by: Ti-Tai Wang <[email protected]>
value = v.value | ||
if v.type in ( | ||
ir.AttributeType.INTS, | ||
ir.AttributeType.FLOATS, | ||
ir.AttributeType.STRINGS, | ||
): | ||
# For INT, FLOAT and STRING attributes, we convert them to tuples | ||
# to ensure they are hashable. | ||
value = tuple(value) |
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.
I think this can be improved: value_ints is the same as 1d tensor value int64. Maybe leverage the new
ir-py/src/onnx_ir/_convenience/__init__.py
Line 400 in e211825
def get_const_tensor( |
If the constant is smaller than size limit, it's csed.
Use tobytes to hash TENSOR when it's smaller than size_limit (parameter of the pass).