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.36

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.36
File Size Uploaded
enceladus-0.1.36.tar.gz 347.6 kB Details

Built distributions (wheels)

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

Download URL enceladus-0.1.36.tar.gz
Size 347.6 kB
Tags Source
SHA-256 checksum
How to use checksums
42336deb9e4089df817d9236e52397b82cd442a2f3e93d4990e0aa1e724f30f9
BLAKE2b-256 checksum
How to use checksums
93853f22188ea381f3ae1024cc5fe7a29f4ecc652c537e792a29f918ee271e06
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.36-cp314-cp314-macosx_15_0_arm64.whl

Download URL enceladus-0.1.36-cp314-cp314-macosx_15_0_arm64.whl
Size 254.2 kB
Tags CPython 3.14 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
739956ed3c82f1a99f0a1d9d34abbb65c28b64e4185d05748161b02f0b803809
BLAKE2b-256 checksum
How to use checksums
795fe99c7e8817c6b74caf113a4c8209d42d4bc6bec00cef3e3f3ff101ac0a60
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.36-cp313-cp313-macosx_15_0_arm64.whl

Download URL enceladus-0.1.36-cp313-cp313-macosx_15_0_arm64.whl
Size 254.1 kB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
78c44ab3ed34aa88a0cfa47c53a705ecfafd5722656fdb7ac50def8ac6f3f3fb
BLAKE2b-256 checksum
How to use checksums
033f69a8b709acf0252a12a876bee00bd2ca1c530e6ad025af46e03086ddd6b9
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.36-cp312-cp312-macosx_15_0_arm64.whl

Download URL enceladus-0.1.36-cp312-cp312-macosx_15_0_arm64.whl
Size 254.1 kB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
99d2963fdf0df3ad5050d64f7da1d4264b9d00c833d27da1a4804308992c345d
BLAKE2b-256 checksum
How to use checksums
ba0747b73d4ee17d9a6024b1b6815d1ee53c1e898cb5b8cd192ab44e0e5d1674
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.36-cp311-cp311-macosx_15_0_arm64.whl

Download URL enceladus-0.1.36-cp311-cp311-macosx_15_0_arm64.whl
Size 254.6 kB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
2f24d2b1f1f15a4954fb1fb6e1149f5c72ac4cd7caf4f094f49e86b5dd6fd9af
BLAKE2b-256 checksum
How to use checksums
129d158debe9874152da3d64cf278ae4ea5efa064652c8581196e7aa0b98c53d
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.36 This release

5 release files

0.1.34

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