openxla/tokamax

Tokamax: A GPU and TPU kernel library.

What it solves

Tokamax provides highly optimized, custom accelerator kernels for complex machine learning operations. It helps developers achieve better performance for advanced model architectures—such as Mixture-of-Experts (MoE) and various attention mechanisms—by providing efficient implementations that run on hardware like Google TPUs and NVIDIA GPUs.

How it works

The library leverages JAX and Pallas to build high-performance kernels. It offers a collection of pre-optimized operators (like paged attention, TopK, and grouped matrix multiplication) and includes infrastructure tools such as autotuning and benchmarking to help developers maintain and deploy these kernels effectively. It also provides native PyTorch APIs for TPU users.

Who it’s for

This library is designed for machine learning engineers and researchers who need to run large-scale or cutting-edge models on specialized hardware and require low-level control over operator performance.

Highlights

  • Optimized kernels for Mixture-of-Experts (MoE) and advanced attention variants like Paged, Delta, and Multiheaded Latent Attention.
  • Built-in support for autotuning and low-overhead benchmarking.
  • Cross-framework compatibility with JAX/Pallas and native PyTorch support for TPUs.
  • Designed to evolve with the latest open-source models and hardware accelerators.

Related

  • Project
  • Project
  • Project
  • Project
  • Project