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

Add Reduction, Squeeze, Reshape, and Expand to FusionTranslation #2856

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

rdspring1
Copy link
Collaborator

@rdspring1 rdspring1 commented Aug 27, 2024

This PR adds support for Reduction, Squeeze, Reshape, and Expand operations.

Details:

@rdspring1 rdspring1 added the Python API Issues related to the Python API label Aug 27, 2024
@rdspring1 rdspring1 force-pushed the cpp_to_python_p3 branch 2 times, most recently from 7cd4305 to b63cde3 Compare August 27, 2024 19:59
@rdspring1 rdspring1 changed the title Add more operations to FusionTranslation Add Reduction, Squeeze, Reshape, and Expand to FusionTranslation Aug 28, 2024
Base automatically changed from cpp_to_python_p2 to main October 9, 2024 00:48
* Currently, the python frontend represents broadcast_in_dims as a
broadcast and expand composite operation. For cpp to python
translation, when we encounter an Expand expression, we must create
a BroadcastInDimsOp, which creates a redundant broadcast in the
definition. By adding the expand operation to the python frontend,
we can create a one-to-one mapping in the translation.
Add squeeze op

Add reshape support

Add squeeze_expanded to python_frontend squeeze

add squeeze_expanded flag

support expand op
@rdspring1 rdspring1 changed the base branch from main to expand_frontend October 9, 2024 05:15
@rdspring1 rdspring1 marked this pull request as ready for review October 9, 2024 05:15
Base automatically changed from expand_frontend to main October 9, 2024 15:28
@rdspring1
Copy link
Collaborator Author

!build

Copy link
Collaborator

@jjsjann123 jjsjann123 left a comment

Choose a reason for hiding this comment

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

Let's bump the version number here since we are changing existing API.

I don't know what's the reason behind the behavior on disable squeeze expanded by default. If we change that behavior I think we would be able to get away without the plumbing on squeeze

csrc/python_frontend/fusion_record.h Show resolved Hide resolved
csrc/python_frontend/translation_utils.cpp Outdated Show resolved Hide resolved
csrc/python_frontend/translation.cpp Show resolved Hide resolved
Copy link
Collaborator

@jjsjann123 jjsjann123 left a comment

Choose a reason for hiding this comment

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

LGTM

@rdspring1
Copy link
Collaborator Author

!build

@rdspring1 rdspring1 merged commit 52b39e1 into main Oct 10, 2024
33 of 34 checks passed
@rdspring1 rdspring1 deleted the cpp_to_python_p3 branch October 10, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python API Issues related to the Python API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants