Sunsetting the MLIR-HLO repository

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.

Eugene & Jacques


As far as I can see, stablehlo is missing a cmake configuration for external projects, which mlir-hlo has had (mlir-hlo/cmake/modules at master · tensorflow/mlir-hlo · GitHub). Otherwise, it looks like projects could just easily switch to stablehlo.

1 Like

“As far as I can see, stablehlo is missing a cmake configuration for external projects”. That’s a good point! Direct dependencies on the StableHLO repository already work through Bazel, but CMake support is indeed missing at the moment. I’ve just opened a ticket to get this done: Add a CMake configuration for external projects · Issue #1549 · openxla/stablehlo · GitHub.

Another question that has come up lately during discussions of the future of the MLIR-HLO repository is what is going to happen to MHLO => Linalg passes. These passes are available through the XLA repository, but some folks have been looking for something more lightweight.

In a recent OpenXLA RFC, we’re discussing migrating these passes to use StableHLO and upstreaming them to the StableHLO repository. The actual migration has been prototyped in the IREE repository and is almost done, so we know that it is feasible, and this functionality will soon be readily available. Please chime in if you have an opinion on this!

1 Like

As a heavy user of mlir-hlo, as far as I can see, your post has covered everything. Thanks very much! It’s definitely important to ensure the paths from mhlo into MLIR official repo dialects are now subsumed by functionally equivalent conversions from stablehlo to MLIR dialects.

Hi, I am working on a project which is a user of mlir-hlo repository. We would just like to know when mlir-hlo will stop being updated?

Thank you for reaching out! In July, I was planning to finish the work described above: 1) updating the CMake build, 2) upstreaming the StableHLO => Linalg passes from openxla/iree into openxla/stablehlo.

After both of these items are done, we’ll be ready to sunset the MLIR-HLO repository, since all the community feedback that we received in this thread and via other means will have been addressed. At that point, I will send a message to this thread to provide an advance notice (I was thinking about 30 days), after which tensorflow/mlir-hlo will be archived. Please let us know if there are any blockers created by this plan!

1 Like

Hello, I would like to know if there is any update on the StableHLO => Linalg passes? Will MLIR-HLO be retired soon? Thanks a lot!

1 Like

FYI - I just removed the mlir-hlo dep yesterday from torch-mlir. We decided to run degraded on integration testing until someone has time to do something else (possibly just using the stablehlo reference interpreter). The final motivation was needing to make a couple line change to unblock progress on a platform and not being able to track changes from the OSS stablehlo repo through the integration process that produces the read-only mlir-hlo repo.

Filed one issue along the way because stablehlo doesn’t compile on Windows: Reference interpreter has numerous compile errors on Windows · Issue #1772 · openxla/stablehlo · GitHub

Apologies for keeping everyone waiting on this! I was unexpectedly out of office most of August, and I didn’t do a good job at communicating the next steps. I’m still aiming to execute on 1) and 2) from the previous message, but this will take a bit more time that originally estimated. I’ll follow up soon with a more concrete timeline.

Also, thank you Stella for dealing with the integration issue and filing a ticket along the way! We appreciate your contribution and will work on addressing the problem that you identified.

Quick update: @GleasonK has recently stepped up as the StableHLO/HLO TL (announcement), so I’ll be passing the baton of completing the sunsetting of the MLIR-HLO repository to him.