-
Notifications
You must be signed in to change notification settings - Fork 102
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
Move BroadcastOp from StableHLO to CHLO. #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a few minor changes. Please also adjust the PR title to: 1) drop "[mhlo]" because there's no MHLO in this repository, 2) change "move" to "copy" because we aren't removing the corresponding MHLO op.
|
||
return success(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/pasting implementations between dialects is fine for now. In the near future, we'll come up with ways to share code - both between CHLO and StableHLO (for ops introduced during #3) and between StableHLO and MHLO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spurious line 529
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is only shared code for the time being, because eventually we will remove the op from StableHLO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"for the time being". Given that we're already providing compatibility guarantees for StableHLO (we haven't documented them in docs/
yet, but we've been talking about at least 6 months of backward compatibility to various stakeholders), the StableHLO op is here to stay for a long time. We'll need a solution for code sharing, but that doesn't have to block this PR.
Let's also expand the PR description to explain why it's doing what it's doing, perhaps with a reference to the corresponding issue. |
Having thought about this further (thank you, @subhankarshah, for your prototype of the Linalg lowering!), I believe that we should have more discussion before merging this PR. The motivation behind this PR (and, more generally, #3) is the desire to trim the StableHLO opset by moving decomposable ops into CHLO. But in what cases are these decompositions worth it? Even for something as simple as E.g. if we were to decompose As recently mentioned on Discord, we currently don't have a formal process for discussing new developments. While in some cases, e.g. for evaluating the proposed design of the interpreter, it feels like we can make forward progress less formally, it sounds like in this case cutting corners could be inadvisable. I'll follow up soon on the next steps. |
Part 1-of-many - Create a copy of stablehlo.broadcast in CHLO, including changes in .td and .cc files. - Create tests for chlo.broadcast (refer tests for stablehlo.broadcast).
As @subhankarshah pointed out, unranked dynamism presents a problem here. More specifically, Given that, we'll be closing this PR (and postponing the work on some other potentially unranked ops in #3) until we reach a conclusion on whether or not StableHLO should support unranked dynamism, which is part of #8. |
Part 1 of Many