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

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

Built distributions (wheels)

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

Download URL enceladus-0.1.37.tar.gz
Size 347.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ddfe9674958472d93e96888c7ca725e6dc795e73d549acc09d127b1791859c4
BLAKE2b-256 checksum
How to use checksums
059b3a1b128a489acf1bf2b80a867a0afb75f33096358f2c7adf1862c4054681
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.37-cp314-cp314-macosx_15_0_arm64.whl

Download URL enceladus-0.1.37-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
27124387b06023ebbc7d42516901ad1bdcfb6e58f198a002befeb2335906ff79
BLAKE2b-256 checksum
How to use checksums
db6a2857e7be6438f665cd1bc7ab7ddf4baad0060116d12194f7f5ee85461456
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.37-cp313-cp313-macosx_15_0_arm64.whl

Download URL enceladus-0.1.37-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
e015a8052d4ce5e89e51032c30a46eed6ea3c34081d6280cf51193c1ed4886d9
BLAKE2b-256 checksum
How to use checksums
354165ed042295bc198032bb9fab7a48091c86e23ffee649cbf325fdab9e53a6
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.37-cp312-cp312-macosx_15_0_arm64.whl

Download URL enceladus-0.1.37-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
0a7cb0b9ad812d94c9aa2ef866a72f9ed3144b4ec2d32df2299a868de15aac8c
BLAKE2b-256 checksum
How to use checksums
727cd0b793d2858b98ce80850b4fdc6e61e339ee74f6d2f7c46fb82e3925dcab
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.37-cp311-cp311-macosx_15_0_arm64.whl

Download URL enceladus-0.1.37-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
dfae0404914176f9d5a95807a972955e4b74d61ec8b71b145f470b0b1279f500
BLAKE2b-256 checksum
How to use checksums
bf186b58ddf0ec3d3af631dfe684d124a3074915d75c891d4fbcf697a4a9c368
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.37 This release

5 release files

0.1.36

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