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
| Config | Effect |
|---|---|
"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:
| Value | Output |
|---|---|
| 1 | Backend selection and hardware info |
| 2 | Performance info during realize |
| 4 | Kernels generated by the kernelizer |
| 8 | Kernel IR (before GPU execution) |
| 16 | Generated backend code |
| 32 | Autotune 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