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

Update tosa.mul op in StableHLO-to-TOSA Pass in compliance with MLIR upstream and TOSA-v1.0 #2702

Merged
merged 3 commits into from
Feb 1, 2025

Conversation

bubblepipe
Copy link
Contributor

This PR updates the StableHLO to TOSA legalization pass to align with the recent changes in the MLIR upstream. Specifically, the tosa::MulOp operation has being modified to comply with the TOSA-v1.0 specification. The shift parameter of the MUL operator, which was previously an attribute, has been moved to an SSA operand. 

The upstream changes caused a compilation failure in the StableHLO to TOSA conversion pass because the tosa.mul operation now expects 3 operand groups instead of 2, as reflected in the error message:

error: invalid number of operand groups for `tosa.mul`; expected 3, but got 2
     with op<tosa.mul>(input0, input1) {shift = attr<"0 : i8">};
          ^

This PR added a zero constant as the additional argument for the shift parameter to maintain compatibility with the updated tosa.mul operation.

Copy link

google-cla bot commented Jan 29, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@bubblepipe bubblepipe marked this pull request as ready for review January 29, 2025 17:09
@bubblepipe bubblepipe closed this Jan 29, 2025
@bubblepipe bubblepipe reopened this Jan 29, 2025
@GleasonK
Copy link
Member

Thank you for the fix! We are still integrating these TOSA / LLVM changes throughout the rest of the OpenXLA projects, we will merge this change as a part of our next LLVM bump and ensure you are attributed as author of the fix

@GleasonK GleasonK merged commit bde336e into openxla:main Feb 1, 2025
8 of 10 checks passed
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.

3 participants