jax-ml/jax-triton

jax-triton contains integrations between JAX and OpenAI Triton

What it solves

It provides a way to integrate Triton kernels into JAX programs, allowing developers to write high-performance custom GPU kernels using Triton's Python-based language and execute them seamlessly within JAX's functional ecosystem, including inside jax.jit-compiled functions.

How it works

The library introduces the triton_call function, which acts as a bridge. It allows JAX arrays to be passed as arguments to Triton kernels. It also supports in-place mutations of JAX Ref objects (created via jax.new_ref), enabling kernels to modify data without allocating new output arrays.

Who it’s for

Developers and researchers who need the performance of custom Triton kernels but want to maintain the use of JAX for their overall model architecture and high-level orchestration.

Highlights

  • Support for calling Triton kernels from JAX arrays.
  • Compatibility with jax.jit for efficient execution.
  • Support for in-out parameters via JAX Ref for in-place mutation.
  • Integration with the Gluon dialect.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project