Enceladus
Enceladus is a Triton-like Python language for writing GPU kernels for Apple silicon
Macs. You write a kernel as a Python function that operates on tiles, and Enceladus
compiles it to Metal Shading Language and runs it on the GPU. You don't need Xcode or
the Metal toolchain. Kernels accept NumPy arrays, PyTorch mps tensors, and MLX arrays.
Install
Enceladus needs an Apple silicon Mac with macOS 15 or later and Python 3.11 or later. To install it, run the following command:
uv add enceladus
For PyTorch or MLX support, add the torch or mlx extra: uv add "enceladus[torch]".
Example
The following program adds two vectors on the GPU:
import numpy as np
import enceladus
import enceladus.language as tl
@enceladus.jit
def add_kernel(x_ptr, y_ptr, out_ptr, n, BLOCK: tl.constexpr):
offs = tl.program_id(0) * BLOCK + tl.arange(0, BLOCK)
mask = offs < n
x = tl.load(x_ptr + offs, mask=mask)
y = tl.load(y_ptr + offs, mask=mask)
tl.store(out_ptr + offs, x + y, mask=mask)
x = np.random.default_rng(0).standard_normal(100_000, dtype=np.float32)
y = np.ones_like(x)
out = np.empty_like(x)
add_kernel[(enceladus.cdiv(x.size, 1024),)](x, y, out, x.size, BLOCK=1024)
np.testing.assert_allclose(out, x + y)
To run a kernel on the CPU for debugging, set ENCELADUS_INTERPRET=1.
Learn more
- User guide
- Examples, including a fused matmul, flash attention, and a histogram
- Porting from Triton
To build from source, run uv sync, and then run the tests with uv run pytest -q.
Release files for enceladus 0.1.33
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| enceladus-0.1.33.tar.gz | 345.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| enceladus-0.1.33-cp314-cp314-macosx_15_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 15.0+ ARM64 | Details |
| enceladus-0.1.33-cp313-cp313-macosx_15_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 15.0+ ARM64 | Details |
| enceladus-0.1.33-cp312-cp312-macosx_15_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 15.0+ ARM64 | Details |
| enceladus-0.1.33-cp311-cp311-macosx_15_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 15.0+ ARM64 | Details |
Total release size: 1.4 MB
Release files / enceladus-0.1.33.tar.gz
| Download URL | enceladus-0.1.33.tar.gz |
|---|---|
| Size | 345.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dc01370e5ec5d72da0fdd875e0a400b960d35f540b4ea3289539fb495e3daed
|
|
BLAKE2b-256 checksum How to use checksums |
53eb3701cab0945c197999fc74ec293089ab1b6bf2e14f31f93272a8724b2dd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / enceladus-0.1.33-cp314-cp314-macosx_15_0_arm64.whl
| Download URL | enceladus-0.1.33-cp314-cp314-macosx_15_0_arm64.whl |
|---|---|
| Size | 251.4 kB |
| Tags | CPython 3.14 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
104f6f0a6d4abb5e5d40607f1576ce355b304be01be9b878596d3deaecc255ec
|
|
BLAKE2b-256 checksum How to use checksums |
583c49d5e5e5d04a4b27d32a97d8ac2dec2fb97d7c5ff83685f43b1985914b81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / enceladus-0.1.33-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | enceladus-0.1.33-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 251.2 kB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f6ca4852bde9edcac413f29a7a0ad8e893d7b9909f675fd412c1c61240242f89
|
|
BLAKE2b-256 checksum How to use checksums |
a7e1852499aaa6755c57e1fca8c5e712416ec69e0bb7957d65ec6d1694bcbcac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / enceladus-0.1.33-cp312-cp312-macosx_15_0_arm64.whl
| Download URL | enceladus-0.1.33-cp312-cp312-macosx_15_0_arm64.whl |
|---|---|
| Size | 251.2 kB |
| Tags | CPython 3.12 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
55ab162871e8248eed362fd38c36c7921e26d1775bc5358181a559a4f99d7b0a
|
|
BLAKE2b-256 checksum How to use checksums |
a2ddc02731268a20c829637794ce278d74ed2aafc44b4dd1ed66cc4afdefdf7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / enceladus-0.1.33-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | enceladus-0.1.33-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 251.9 kB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
017a9b023c9fc2827febdb6cb52c8baa7c8b137b1ccde94b2570408f2c3bdb06
|
|
BLAKE2b-256 checksum How to use checksums |
6c0e05883b22f5e61787a6bc2217095b10598220cb0abb4fff059f9ec282284b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|