Repository navigation
Add VHLO support for IREE - #16999
Conversation
MaheshRavishankar
left a comment
There was a problem hiding this comment.
I am wondering if we need to even have this in IREE? Can this be run somewhere before the IREE compilation kicks in? I think we decided that StableHLO is the surface are that IREE supports.
@jpienaar WDYT?
My understanding of https://github.com/openxla/stablehlo/blob/main/docs/compatibility.md is that StableHLO itself is unstable (and it has broken compatibility multiple times recently). VHLO ("V" stands for "Versioned") has stronger compatibility properties - we'd accept VHLO and convert it to StableHLO (by "deserializing"). |
|
I think the issue with VHLO last we talked about it was that it didn't allow for custom ops in the way that was practically required so we didn't expect anyone to actually use it. @stellaraccident / @rsuderman may know more. |
|
I haven't been following it. But if people who are would like to have ingestion support for it, that makes sense to me. I think TF emits non VHLO ops so may not help there without more work, but that doesn't need to block this. |
71e42f2 to
61708b4
Compare
Yeah if nothing else, this may be the only input type if one wants a decoupled input today. That being said, this conversion need not be cheap and enabling skipping it good. |
Added support to take in VHLO input. VHLO is converted to Stablehlo and then the StableHLO passes are run.
0efa82e to
b36c955
Compare
1a800e4 to
c357f30
Compare
kuhar
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the nice error message.
ScottTodd
left a comment
There was a problem hiding this comment.
Looks good with a few commends addressed! Thanks for responding to the feedback!
| // and VHLO in the same module causes undefined behavior. The pass below | ||
| // catches such scenarios and errors out. | ||
| passManager.addPass(stablehlo::createCheckVHLOStableHloMixUsage()); | ||
| ::mlir::stablehlo::createStablehloDeserializePipeline(passManager); |
There was a problem hiding this comment.
Out of curiosity, do you know if we can use tools from StableHLO to serialize (not deserialize) our existing StableHLO MLIR test and model files from StableHLO to VHLO? We could keep testing both, but it would be nice to actually benefit from the "stable" part of the project name ;)
There was a problem hiding this comment.
I was able to convert a few stablehlo ops to vhlo (to understand what VHLO is and how it looks like) using the serialize function.
|
Seeing postsubmit failures on macOS: https://github.com/iree-org/iree/actions/runs/8821674527/job/24218079731#step:6:5701 and locally on Windows. Coordinating on Discord here: https://discord.com/channels/689900678990135345/689957613152239638/1232768442491207701 . I think we'll want a revert and some investigation. |
This reverts commit 38c0646.
Reverts #16999, since it breaks macOS and Windows compiler builds.
Added support to take in VHLO input. VHLO is converted to Stablehlo and then the StableHLO passes are run. Signed-off-by: Lubo Litchev <[email protected]>
Reverts iree-org#16999, since it breaks macOS and Windows compiler builds. Signed-off-by: Lubo Litchev <[email protected]>
Added support to take in VHLO input. VHLO is converted to Stablehlo and then the StableHLO passes are run.