IntroductionDocs pages
Get started
Introduction
Enceladus is a Triton-style language for writing GPU kernels in Python. It compiles tile programs to Metal Shading Language while your program runs, and runs them on any Apple silicon GPU.
Write the tile, not the thread
You write an Enceladus kernel as a Python function that operates on tiles: blocks of values that one program computes on at once, like small NumPy arrays. The compiler decides which thread holds which element, lowers tl.dot to the GPU's SIMD-group matrix instructions, and hands the resulting MSL to Metal's newLibraryWithSource.
If you know Triton, you already know most of Enceladus. The decorator, the launch syntax, tl.constexpr, masks, and the autotuner work the same way.
Compiles at run time
Metal compiles the generated MSL in your process. Results are cached on disk, so later runs load in under 10 ms.
Bring your arrays
Pass NumPy arrays, PyTorch mps tensors, MLX arrays, or enceladus.Tensor objects directly to a kernel.
Debug on the CPU
The NumPy interpreter runs the same kernel with print(), pdb, and bounds-checked loads.
No silent miscompiles
Every unsupported construct is refused with the file, line, column, and a suggested fix.
Two matmul backends
Use simdgroup_matrix on every Apple GPU, or Metal 4 matmul2d for eligible loops.
Tuned per GPU
The autotuner compiles candidates in parallel, times them with GPU timestamps, and saves the winner.
What's in the docs
For every tl function and host API, see the Reference. For complete programs, see the Examples.
Project status
Enceladus is alpha software. Keep the following in mind:
- All published performance numbers come from one M4 Pro. Wheels target macOS 15 but have been tested only on later releases.
- The interpreter runs some kernels that the compiler refuses, such as a
tl.dotwhose K isn't a multiple of 8. It warns about them unlessENCELADUS_VERIFY=0, and raises the compiler's error whenENCELADUS_VERIFY=1. - MLX launches synchronize, at about 125 µs each, unless you turn on lazy launches with
enceladus.lazy_mlx(True). A lazy launch applies only when every array the kernel writes is a fresh output. atomic_adddoesn't supportfloat16orbfloat16.
To report a problem, open an issue on GitHub.