Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

Zyx is configured through a JSON file, environment variables, and API calls.

Config File

The runtime reads $XDG_CONFIG_HOME/zyx/config.json (or ~/.config/zyx/config.json by default):

{
    "c": { "enabled": true },
    "cuda": { "device_ids": [0] },
    "opencl": { "platform_ids": [0] },
    "autotune": {
        "enabled": true,
        "max_configs": 100,
        "timeout_ms": 5000
    }
}

Backend Control

ConfigEffect
"c": { "enabled": true }Enable CPU backend (off by default)
"cuda": { "device_ids": [] }Disable all CUDA devices
"opencl": { "platform_ids": [] }Disable all OpenCL
"dummy": { "enabled": true }Enable dummy backend

Environment Variables

Debug Flags

Set ZYX_DEBUG as a bitmask:

ValueOutput
1Backend selection and hardware info
2Performance info during realize
4Kernels generated by the kernelizer
8Kernel IR (before GPU execution)
16Generated backend code
32Autotune exploration
ZYX_DEBUG=8 cargo run     # print kernel IR
ZYX_DEBUG=16 cargo run    # print generated code

Colorless Output

AGENT=1 ZYX_DEBUG=8 cargo test

API Configuration

Tensor::manual_seed(42);            // deterministic RNG
Tensor::set_training(true);         // enable training mode
Tensor::set_training(false);        // disable training mode