openxla/stablehlo

Backward compatible ML compute opset inspired by HLO/MHLO

What it solves

StableHLO is a portability layer that solves the problem of incompatibility between different machine learning frameworks (like PyTorch, TensorFlow, and JAX) and the compilers that optimize them for hardware (like XLA and IREE). It ensures that models produced by one framework can be reliably consumed by various compilers without needing to-be-rewritten for every combination.

How it works

It provides a standardized set of high-level operations (HLO) for ML models. Based on the MLIR (Multi-Level Intermediate Representation) dialect, it enhances the MHLO dialect with serialization and versioning. By using MLIR bytecode as a serialization format, it provides backward and forward compatibility guarantees, allowing frameworks and compilers to communicate using a stable, versioned interface.

Who it’s for

This project is for ML compiler engineers and framework developers who need to create interoperable models that can run on diverse hardware via compilers like XLA and IREE, or for those deploying models on-device via Google AI Edge.

Highlights

  • Interoperability: Simplifies development by bridging the gap between frameworks like JAX, PyTorch, and TensorFlow.
  • Versioned Stability: Uses MLIR bytecode to ensure that programs remain compatible as the operation set evolves.
  • Broad Compatibility: Compatible with ML compilers such as XLA and IREE.
  • Conversion Tooling: Includes tools to convert StableHLO programs (including weights and biases) into TensorFlow SavedModels.

Related

  • Project
  • Project
  • Project
  • Project
  • Project