openxla/xla

Machine Learning

Compile models from PyTorch, TensorFlow and JAX into optimized code for GPUs, CPUs and ML accelerators.

4,626
992
C++
Apache-2.0
4 years old

XLA is an open-source machine learning compiler. It takes models built in PyTorch, TensorFlow or JAX and optimizes them for high-performance execution on GPUs, CPUs and ML accelerators. It suits people who want faster or more portable execution of ML workloads through an established framework, not people looking for a standalone model or application.

How you actually use it

Most users never touch this repository. The README directs users to the framework-specific integration for their setup: PyTorch/XLA, TensorFlow XLA, or the JAX documentation. Compilation is therefore reached through the frontend you already use, and the practical workflow is to build or run a model in that framework with XLA enabled, then let the compiler generate optimized code for the target hardware.

Building the repository itself is a separate path. The README states it is intended for XLA contributors developing the compiler and for integrators who want to debug or add support for ML frontends and hardware backends. If you are not contributing code to the compiler, the project explicitly says you do not need to clone and build the repo.

What distinguishes it

XLA's useful mechanism is framework-to-hardware compilation: it accepts models from several popular ML frameworks and targets multiple hardware classes rather than one frontend or one device. That lets an existing PyTorch, TensorFlow or JAX project reuse the same compiler stack across GPU, CPU and accelerator targets, subject to each integration's own support.

For contributors, the project provides a contribution guide and a developer guide covering compiler development work; these document the path for backend and frontend integration rather than a general user setup.

Who it fits

It is a fit if you are already working inside one of the supported frameworks and want XLA's optimization without interacting with compiler internals. It is also a fit for compiler developers or hardware/frontend integrators extending support. It is not a drop-in tool for someone without an ML framework, and the repository does not present itself as an end-user application.

Conditions to know

  • Your entry point and compatibility depend on the framework integration you choose; follow that integration's documentation rather than assuming the repository README is a setup guide.
  • The supplied material does not list supported hardware models, framework versions, or installation prerequisites, so confirm those with the relevant integration.
  • The project is licensed under Apache-2.0; use and redistribution are governed by that license.
  • Community spaces follow the TensorFlow Code of Conduct, and the README notes the project is under TensorFlow governance.

Project source and documentation

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.