Sunsetting the MLIR-HLO repository

159 views
Skip to first unread message

Eugene Burmako

unread,
May 10, 2023, 4:03:04 PM5/10/23
to openxla...@openxla.org

Hi everyone,


We wanted to post an update about the future of the MLIR-HLO repository. We understand that MLIR-HLO is not an officially supported MLIR project but it has been around long enough that we'd like to increase visibility as to its status.


The MLIR-HLO repository was created in July 2020 to "provide an end-to-end compiler for CPU and GPU, as well as building reusable blocks for other accelerators [...] heavily inspired by the success of XLA". It had a rich history, and these days it serves as a community hub, upstream from IREE, ONNX-MLIR, Torch-MLIR and other repositories.


In our experience, the primary usefulness of MLIR-HLO lies in providing direct access to: 1) the MHLO dialect that can serve as a portability layer between ML frameworks and ML compilers, 2) MHLO passes, e.g. hlo-legalize-to-linalg, which connect MHLO to the larger ecosystem. We have seen both used successfully in multiple projects.


The MLIR-HLO repository was useful as a scrappy way of bootstrapping shared infrastructure, but making it robust required quite a bit of work. To address this, we have created StableHLO to provide a solid portability layer, and started the OpenXLA project to provide a home for a community-driven, open source ML compiler ecosystem, with the goal of having a great story for development workflow, continuous integration, etc.


With StableHLO hitting v0.9 in March, and IREE recently moving to OpenXLA, we are now at a stage where Google would like to wind down the development effort and support of the separate MLIR-HLO repository. Recent migrations of JAX and Torch-MLIR show that StableHLO can easily fill the role of MHLO as a portability layer.


With that in mind, we wanted to reach out to you all. MLIR-HLO has been around for so long that we aren't clear on who is using it. Please let us know what you think and how we can make this transition easier for you.


Cheers,

Eugene & Jacques


(We have also published this post on MLIR Discourse: https://discourse.llvm.org/t/sunsetting-the-mlir-hlo-repository/70536).


Frederik Gossen

unread,
May 15, 2023, 3:24:27 PM5/15/23
to Eugene Burmako, openxla...@openxla.org
Hi Eugene and Jacques
One difference between the two that I just stumbled across are canonicalizations. I just realized that these are missing (possibly intentionally) in stable HLO. 
The one that I concretely relied on was the transpose simplification but I see many others defined in MHLO. Not sure who relies on these. 





--
You received this message because you are subscribed to the Google Groups "OpenXLA Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openxla-discu...@openxla.org.
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/CAF5Zj%3DDUNDBTZKJ5VpSALrBWRqhOBVmW5T8ousbBiz6WVJYa4g%40mail.gmail.com.
For more options, visit https://groups.google.com/a/openxla.org/d/optout.


--

Frederik Gossen

Software Engineer

frgo...@google.com



This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Eugene Burmako

unread,
May 28, 2023, 4:32:47 PM5/28/23
to Frederik Gossen, openxla...@openxla.org, Jakub Kuderski
Hi Frederik, 

Indeed, the lack of folders and canonicalizers is a gap in the StableHLO dialect. When we created StableHLO, we planned to use it exclusively as an input format, leaving the transformation story to MHLO. However, I think that the time has come to revisit this, based on successful experiments by Jakub and the plans to sunset the MLIR-HLO repository. I've just put together an RFC about this: https://groups.google.com/a/openxla.org/g/openxla-discuss/c/KsRp9euuuB0.

Cheers,
Eugene

Jacques Pienaar

unread,
May 28, 2023, 5:41:09 PM5/28/23
to Eugene Burmako, Frederik Gossen, openxla...@openxla.org, Jakub Kuderski
Hey Frederik,

Sorry I missed the question initially*. Canonicalization porting was flagged in the initial discussion doc but due to process snafu it didn't make it externally early. The canonicalization has been/is planned to be moved to a dedicated pass & set of populate methods and Jakub has already done a lot of that. The rational is that some of the canonicalizations turned out to be not actually canonicalizations but opinionated lowering patterns, and StableHLO team got an explicit request from users to be able to control these due to the current mixing. Many (most?) of them I think are very valuable, question as to reaching the bar for canonicalization was pending.

-- Jacques

* Was traveling and inbox got away from me.

Reply all
Reply to author
Forward
0 new messages