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

[StableHLO] Port lowering to LinalgExt #13331

Merged
merged 4 commits into from
May 1, 2023
Merged

Conversation

kuhar
Copy link
Member

@kuhar kuhar commented Apr 28, 2023

This is based on the equivalent pass for MHLO. There are some existing TODOs/FIXMEs that this does carry over.

Issue: #12678

Comment on lines +14 to +16
//===----------------------------------------------------------------------===//
// General StableHLO/CHLO lowering patterns.
//===----------------------------------------------------------------------===//
Copy link
Member

Choose a reason for hiding this comment

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

Just StableHLO, right? Not also CHLO?

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't fleshed out chlo support yet -- I expect that once we add support to more chlo, we will either decide to keep them together or to separate stablehlo from chlo lowering. Because of the overlap in ops, the former seems more likely at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

I'm still a bit confused by the presence of CHLO here. The appeal of StableHLO is that it is stable, and presumably something we can depend on in isolation. I'd expect a program containing just StableHLO to be forwards compatible ("stable"), while a program containing StableHLO and a mix of other dialects (arith, TOSA, ml_program, CHLO, etc.) to not necessarily be forwards compatible. Including other dialects in this input conversion dilutes that property.

Copy link
Member Author

Choose a reason for hiding this comment

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

In https://github.com/openxla/stablehlo/blob/main/docs/spec.md they explain that the co-existance of chlo and stablehlo is a temporary solution:

At the moment, StableHLO programs in the wild sometimes contain operations that are not described in this document. In the future, we are planning to either absorb these operations into the StableHLO opset or prohibit them from appearing in StableHLO programs. In the meanwhile, here is the list of these operations:

Copy link
Member

Choose a reason for hiding this comment

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

Ah... a little concerning, but okay...

I'm wondering if we'd want to isolate those into a different directory / set of passes to make them easier to prune later.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know yet, but it seems more practical to me to keep them together for now. This is because there's a significant overlap in the opsets and because the original mhlo input conversion code kept both together.

kuhar added 4 commits May 1, 2023 13:24
This is based on the equivalent pass for MHLO. There are some existing
TODOs/FIXMEs that this does carry over.

Issue: iree-org#12678
@kuhar kuhar force-pushed the shlo-to-linalg-ext branch from 372efb5 to e4001ac Compare May 1, 2023 17:24
@kuhar
Copy link
Member Author

kuhar commented May 1, 2023

Rebased

@kuhar kuhar enabled auto-merge (squash) May 1, 2023 17:38
@kuhar kuhar merged commit e312348 into iree-org:main May 1, 2023
jpienaar pushed a commit that referenced this pull request May 1, 2023
This is based on the equivalent pass for MHLO. There are some existing
TODOs/FIXMEs that this does carry over.

Issue: #12678
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this pull request Jul 6, 2023
This is based on the equivalent pass for MHLO. There are some existing
TODOs/FIXMEs that this does carry over.

Issue: iree-org#12678
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