Skip to content

[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

Merged
merged 7 commits into from
Jun 19, 2025

Conversation

titaiwangms
Copy link
Collaborator

@titaiwangms titaiwangms commented Jun 17, 2025

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).

@titaiwangms titaiwangms requested a review from a team as a code owner June 17, 2025 23:41
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.51%. Comparing base (26ca89a) to head (66112cb).
Report is 7 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@titaiwangms
Copy link
Collaborator Author

@justinchuby Not sure why I checked the sign off, but DCO still fails...

@titaiwangms titaiwangms force-pushed the titaiwang/support_constant_cse branch from 84ad83b to 342add5 Compare June 17, 2025 23:44
@justinchuby
Copy link
Member

Very nice, thanks!

@justinchuby justinchuby added this to the 0.1.3 milestone Jun 18, 2025
@justinchuby
Copy link
Member

@titaiwangms maybe ensure that the email you signoff with matches the github account you use?

titaiwangms and others added 4 commits June 18, 2025 17:52
Signed-off-by: Ti-Tai Wang <[email protected]>
Signed-off-by: Ti-Tai Wang <[email protected]>
Signed-off-by: Ti-Tai Wang <[email protected]>
@titaiwangms titaiwangms force-pushed the titaiwang/support_constant_cse branch from c626f55 to 7f853a8 Compare June 18, 2025 17:52
@justinchuby
Copy link
Member

@gramalingam for another review

Copy link
Contributor

@gramalingam gramalingam left a 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]>
@titaiwangms titaiwangms enabled auto-merge (squash) June 19, 2025 21:01
@titaiwangms titaiwangms merged commit 62e750c into onnx:main Jun 19, 2025
21 checks passed
Comment on lines +73 to +81
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)
Copy link
Member

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

def get_const_tensor(
for this?

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.

3 participants