Skip to main content

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

To build from source, run uv sync, and then run the tests with uv run pytest -q.

Release files for enceladus 0.1.34

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enceladus 0.1.34
File Size Uploaded
enceladus-0.1.34.tar.gz 345.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for enceladus 0.1.34
File
enceladus-0.1.34-cp314-cp314-macosx_15_0_arm64.whl CPython 3.14 CPython 3.14 macOS 15.0+ ARM64 Details
enceladus-0.1.34-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details
enceladus-0.1.34-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details
enceladus-0.1.34-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.34.tar.gz

Download URL enceladus-0.1.34.tar.gz
Size 345.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df06123250ac76e2788bcba2e3f80809b88b5dbb9c75f85801cb7122f49eddf0
BLAKE2b-256 checksum
How to use checksums
f91ecc05a9166c665770574ac4b9b92857e402d5e54c6b3501509596907cfa7b
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.34-cp314-cp314-macosx_15_0_arm64.whl

Download URL enceladus-0.1.34-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
835d8c6f9d7920dfa2f75487e058f6eabc3606e0b7fabadb5e9a508fc783eadd
BLAKE2b-256 checksum
How to use checksums
614fbe80a4a8fd1ec439a0d6c8ece0183dbcbe7895cf23940ecbbe783e4f6c09
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.34-cp313-cp313-macosx_15_0_arm64.whl

Download URL enceladus-0.1.34-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
d111c0a5ba560fdfed85e2ce4b547de2f2ce7b71ef301a987475725018acd426
BLAKE2b-256 checksum
How to use checksums
fac02130f51ce310ef270eb42f9af404d25ba819f1c11494ae235ebf36c5adeb
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.34-cp312-cp312-macosx_15_0_arm64.whl

Download URL enceladus-0.1.34-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
7e7a319bb230729ed5f26288c024ac992b259303070879840e95f0443a293954
BLAKE2b-256 checksum
How to use checksums
59549102422c103edfba81c9a62f9b601ae496a8a97745231d0dc44e1a752bce
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.34-cp311-cp311-macosx_15_0_arm64.whl

Download URL enceladus-0.1.34-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
27dede4fa645a0ae72f380cecb65490657aa2caeb3643d23e7f3de2441fc6717
BLAKE2b-256 checksum
How to use checksums
075f0b284707dbeb30fc32c7a4ada4de7a8fd03d9a79e68c8856133407f18fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.34 This release

5 release files

0.1.33

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page