Skip to content
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

[Operator] Composite Elementwise Operation #337

Merged
merged 5 commits into from
Aug 1, 2023
Merged

Conversation

hjjq
Copy link
Member

@hjjq hjjq commented Aug 1, 2023

Assuming U1 and U2 are unary elementwise operators, and B is a binary elementwise operator.
Introduce a new fused operator called Composite Elementwise Operation, where comp_elemwise(x, U1, U2, B) = B(U1(x), U2(x)).
Also add subgraph rewrite rule. This allows for more fusion opportunity.

Copy link
Member

@yaoyaoding yaoyaoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hjjq, it looks good to me!

Comment on lines 48 to 51
self.lhs = lhs
self.rhs = rhs
self.out = out
self.name = name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to add some type hints to increase the readability.

@hjjq hjjq merged commit 1eb41ad into hidet-org:main Aug 1, 2023
@hjjq hjjq deleted the conv branch August 1, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants