Language referenceAll pages
Reference
Language reference
Every builtin in enceladus.language, imported as tl, and the host API in enceladus. Tile shapes must be compile-time powers of two. Most math and shape functions are also tile methods, for example x.exp(), x.sum(axis=0), x.to(tl.float16), and x.T.
Builtins
Data types
The following table lists the element types. Pass them as tl.float16 in a kernel, or as the string "float16" to the host allocators.
| Kind | Types | Short names |
|---|---|---|
| Boolean | tl.int1 | i1, bool |
| Signed integer | tl.int8, tl.int16, tl.int32, tl.int64 | i8, i16, i32, i64 |
| Unsigned integer | tl.uint8, tl.uint16, tl.uint32, tl.uint64 | u8, u16, u32, u64 |
| Floating point | tl.float16, tl.bfloat16, tl.float32 | fp16, bf16, fp32 |
Environment variables
| Variable | Effect |
|---|---|
ENCELADUS_INTERPRET=1 | Runs kernels in the NumPy interpreter on the CPU. |
ENCELADUS_DEBUG=1 | Compiles tl.device_assert checks. It's part of the specialization, so changing it recompiles. |
ENCELADUS_DUMP=1 | Writes each compiled kernel's IR, MSL, and meta.json to its cache entry and prints the path. |
ENCELADUS_CACHE_DIR | Moves the disk cache from ~/.cache/enceladus. |
ENCELADUS_ALWAYS_COMPILE=1 | Ignores the disk cache and saved autotuning results. |
ENCELADUS_OVERRIDE_DIR | Loads DIR/KERNEL_NAME.metal instead of the generated MSL. |
ENCELADUS_VERIFY=1 | Verifies the IR after every compiler pass, including for interpreted launches. |
ENCELADUS_PRINT_AUTOTUNING=1 | Prints each autotuning winner as a pasteable enceladus.Config(...). |
ENCELADUS_FLUSH_EVERY | Sets the number of launches per command buffer. The default is 64. |
MTL_CAPTURE_ENABLED=1 | A Metal variable that enceladus.capture needs at process start. |