11. dasLLAMA environment variables
GENERATED from env_registry() in dasllama/dasllama_env.das — do not edit by hand.
Regenerate with daslang modules/dasLLAMA/harness/gen_env_doc.das; a knob read anywhere
in the tree without a registry entry fails tests/test_env_registry.das.
Types: flag is unset-means-default, 0/false/off/no/empty is false and
anything else true; number falls back to the default when unset or unparseable;
text and path are taken verbatim. Every read goes through env_flag /
env_int / env_int64 / env_str, so the rules are the same everywhere.
A knob is read ONCE, at init or behind a one-time gate — reading the environment on a
per-token path is what PERF027 exists to catch (see skills/perf_lint.md).
11.1. Engine
Read by the inference engine itself, so these affect any program that loads a model.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
on |
Use the prepared-image cache beside a .gguf for millisecond reloads; 0 forces a full parse. |
|
flag |
off |
Allow the CPU prefill path even when a GPU prefill override is registered. |
|
text |
unset |
Pin prefill to one registered override by name (e.g. metal, vulkan); anything else declines before upload. |
|
text |
unset |
Pin the matmul backend by name, bypassing the measured auto-selection. |
|
text |
unset |
Pin the batched (prefill) matmul backend independently of the decode one. |
|
flag |
off |
Arm the MoE expert-reuse counter (probes and servers; benches use set_expert_reuse instead). |
|
flag |
off |
Print engine diagnostics (tier selection, upload plan, arm/decline reasons). |
|
number |
unset |
A/B rail for the dispatch caller’s thread priority, -2..2; unset claims the top notch. |
|
flag |
off |
Regenerate the stored parity truth files instead of comparing against them. |
|
flag |
off |
One switch for the measured-best GPU rail set; any DASLLAMA_GPU_* knob still overrides individually. |
|
number |
-1 (auto) |
How many MoE expert layers to hold resident on the GPU; -1 lets the upload walk place the split. |
|
number |
-1 (auto) |
How many MoE layers to stream rather than hold resident; -1 is auto. |
|
number |
probed |
Override the detected VRAM budget in MiB that sizes the resident expert stacks. |
|
number |
built-in floor |
Lower the context floor for arming the resident decode driver, for a short-context session on a small card. |
|
flag |
follows DASLLAMA_GPU |
DeltaNet rail on the GPU. |
|
flag |
follows DASLLAMA_GPU |
DeltaNet decode rail on the GPU. |
|
flag |
follows DASLLAMA_GPU |
Attention rail on the GPU. |
|
flag |
follows DASLLAMA_GPU |
Dense-weight rail on the GPU. |
|
flag |
on |
The dense rail’s attention half (per-layer q/o pairs); opt-OUT, measured a loss on gemma-4. |
|
flag |
off |
The dense rail’s gemma-4 shared-expert w1/w3/w2 triple; opt-IN, measured a wash-to-loss. |
|
flag |
follows DASLLAMA_GPU |
Shared-expert rail on the GPU. |
|
flag |
off |
Fused QKV rail on the GPU; stays off under DASLLAMA_GPU (measured a wash). |
|
flag |
on |
Keep the classifier plane on the GPU — the best ms-per-GB region; 0 is the CPU A/B lever. |
|
flag |
on |
Device-side routed MoE combine; 0 falls back to the host combine. |
|
number |
0 |
Expert heat threshold: hold the N hottest experts resident regardless of layer placement. |
|
flag |
off |
Report lifetime GPU queue submissions (real commands plus staging round-trips). |
11.2. Metal backend
Apple GPU backend. Absent on non-Apple builds, where setting them does nothing.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
on |
Produce logits on the GPU; 0 pulls the classifier back to the CPU. Blob-only models force it on. |
|
flag |
on |
ggml-geometry QK/AV prefill attention (~10x the trio GEMMs); 0 pins the trio. |
|
flag |
on |
Fused single-pass decode attention (assumes head_size 128); 0 is the A/B rail to the chunked pair. |
|
number |
64 |
Row count below which attention uses the single-chunk kernel; clamped to 128. |
|
flag |
on |
The mul_mm prefill GEMM; 0 falls back to the legacy per-op path. |
|
number |
~4 layers/chunk |
Command-buffer split: each chunk commits as encoded so the scheduler overlaps chunk k with k-1. |
|
flag |
off |
Skip per-dispatch retain/release on the prefill command buffers. |
|
flag |
on |
Record each prefill chunk as a step graph and replay on a concurrent encoder; 0 is serial-encode rollback. |
|
number |
1 |
Graph scheduling mode for replay; 0 keeps capture order. |
|
flag |
on |
Concurrent encoder for the single-stream decode step, with barriers only at detected hazards. |
|
flag |
on |
The R1 epilogue-fusion kernel (post_attn_rms + add_rms); 0 restores separate dispatches for A/B. |
|
number |
-1 (adaptive) |
MTP speculative decode chain: 0 off, 1 forced, -1 adaptive. |
|
number |
4 |
Rows per GEMV threadgroup, clamped 1..32. |
|
flag |
on |
Single-pass B8 twin for K-quant small-batch mv at B=5..8; 0 is the A/B rail. |
|
number |
4096 |
Ceiling in MiB for the device-side KV mirror, clamped 64..4096. |
|
flag |
off |
Barrier at every dispatch instead of at tracker-detected hazards (correctness bisect). |
|
flag |
off |
Treat every detected hazard as strict, widening barriers (correctness bisect). |
|
flag |
off |
Per-step pipeline trace: GPU envelope and true inter-step handoff idle, first steps plus outliers. |
|
text |
unset |
Comma-separated dispatch names to skip in decode — a bring-up bisect that breaks correctness. |
|
text |
unset |
Prefill twin of DASLLAMA_METAL_DECODE_SKIP. |
|
text |
unset |
MTP bring-up bisect: cold logs the failing gate, reject forces the reject path. |
|
number |
5 |
Batch size at which batched decode switches from GEMV to GEMM; floor 2. |
|
flag |
on |
Split-K in the batched decode GEMM. |
|
number |
4 |
Command buffers per batched decode step, clamped 1..16. |
|
flag |
on |
Concurrent encoder for batched decode. |
|
flag |
on |
Epilogue fusion in batched decode. |
|
flag |
on |
Fixed-B GEMV forms for small batched decode. |
|
flag |
on |
The column-tiling MV8 probe for batched decode. |
|
flag |
off |
Pipelined batched decode submission. |
|
flag |
off |
The mul_mm rail for batched decode; measured negative at M-pad-32, kept as the A/B rail. |
11.3. Vulkan backend
Vulkan GPU backend. Present only where the dasVulkan package is installed.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
number |
auto |
Cooperative-matrix mode; the flash-attention twin needs it even when the GEMM runs sdot4. |
|
number |
32 |
Small-batch tier: 32 = sdot4 (default, beats both coopmat tiles below the crossover), 64 = coopmat M, 128 = always-L. |
|
flag |
on |
Vulkan flash-attention kernel; 0 falls back to the chunked path. |
|
flag |
on |
Use a ReBAR device-local host-visible heap when one larger than 1GB is present. |
|
flag |
off |
Barrier at every dispatch (correctness bisect). |
|
flag |
off |
Log every detected hazard and the barrier it produced. |
11.4. Accelerate / AMX backend
Apple Accelerate / AMX float lane. DASLLAMA_ACCEL arms the whole group.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
off |
Arm the Apple Accelerate / AMX float-batch override. |
|
flag |
off |
Use the BNNS f16 lane inside the Accelerate backend. |
|
number |
0 |
Strip count for the f16 lane; 0 lets the backend choose. |
|
number |
backend default |
Minimum MMAC count below which Accelerate declines and the daslang kernel runs. |
|
number |
32 |
Minimum token count for the Accelerate float-batch override, floor 1. |
11.5. Harness — tuner and probes
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
path |
unset |
Directory holding the .gguf models the probes, benches and tests load. |
|
path |
unset |
Model used by the tuner’s confirm gate. Must be a FULL path, not a bare filename. |
|
number |
unset |
Override the batched-dispatch chunk count in the 1-core GEMM probe. |
|
flag |
off |
Use the 2D batch grid in the parity probe. |
|
text |
unset |
Restrict the 1-core GEMM probe to one backend. |
|
text |
unset |
Restrict the 1-core GEMM probe to one shape. |
|
number |
unset |
Restrict the 1-core GEMM probe to one token count. |
|
flag |
off |
Run the 1-core GEMM probe through the fork pool rather than inline. |
|
flag |
off |
Compile the generated tune probe without running it. |
|
flag |
off |
Compile the smmla probe without running it. |
|
flag |
off |
Run the Accelerate contention probe against the Metal backend. |
|
flag |
off |
Per-job dump in the dispatch probe. |
|
number |
unset |
Synthetic per-job spin in nanoseconds for the dispatch probe. |
|
flag |
off |
Exercise batched dispatch in the dispatch probe. |
|
flag |
off |
Exercise the two-wave dispatch shape in the dispatch probe. |
|
flag |
off |
Skip restartHeaps on pooled fork-context reuse (A/B for the fork-pool heap cost). |
|
number |
unset |
Worker spin-before-park window in microseconds, applied via set_jobque_spin_us. |
|
number |
unset |
Join-side spin window for the 1-core GEMM probe. |
11.6. Benchmarks
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
text |
tinyllama |
Model name for the isolated GEMM bench. |
|
number |
unset |
Token count for the isolated GEMM bench. |
|
flag |
off |
Skip the row-major arm of the isolated GEMM bench. |
|
flag |
off |
Per-run detail from the llama.cpp comparison bench. |
|
number |
unset |
Override the minimum rows per dispatch chunk in the GEMM bench. |
|
flag |
off |
Exercise the fused decode arm in the emission bench. |
|
number |
3 |
Timing rounds per cell in the Metal kernel labs. |
|
number |
4 |
Passes per round in the Metal MoE lab. |
|
number |
16 |
Simdgroups per threadgroup in the Metal attention lab. |
|
flag |
off |
Dump generated MSL from the Metal labs instead of running it. |
11.7. Profiling and baselines
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
text |
probed |
Override the GPU name recorded in a box profile. |
|
path |
bin/daslang |
daslang binary the profiling harness shells out to. |
|
text |
probed |
Override the box identifier recorded in a profile. |
|
text |
probed |
Override the CPU name recorded in a profile. |
|
text |
probed |
Override the OS name recorded in a profile. |
|
number |
probed |
Override the RAM size in GiB recorded in a profile. |
|
number |
probed |
Override the thread count recorded in a profile. |
|
path |
unset |
Path to the llama-bench binary used to establish reference baselines. |
|
path |
unset |
Path to a clean-build llama-bench for the reference column. |
|
path |
unset |
Path to a stock-build llama-bench for the reference column. |
|
path |
unset |
whisper.cpp checkout used for ASR reference baselines. |
|
path |
unset |
Directory of whisper.cpp models for ASR reference baselines. |
|
path |
unset |
llama-mtmd-cli binary for multimodal reference baselines. |
|
path |
unset |
Python interpreter of the NeMo oracle venv, for canary/parakeet baselines. |
|
path |
unset |
Python interpreter of the ONNX oracle venv, for parakeet baselines. |
|
text |
set by Windows |
Read to detect Windows (Windows_NT); set by the OS, not by dasLLAMA. |
|
text |
set by Windows |
Read for the CPU architecture on Windows; set by the OS, not by dasLLAMA. |
|
number |
set by Windows |
Read for the core count on Windows; set by the OS, not by dasLLAMA. |
11.8. Tests
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
off |
Run the FULL parity matrix. Without it the big-model rows silently skip. |
|
text |
unset |
Comma-separated filter restricting which parity arms run. |
|
text |
unset |
Comma-separated filter restricting which model families run. |
|
path |
unset |
Directory of llama2.c reference checkpoints for the forward/decode parity tests. |
|
path |
unset |
Directory of whisper models for the audio tests. |
|
path |
unset |
Directory of audio corpus files for the transcription tests. |
|
path |
/tmp |
Scratch directory for test artifacts; set by the OS on macOS. |
11.9. Examples and tutorials
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
path |
unset |
Model path for the dasLLAMA tutorials when none is passed on the command line. |
11.10. daslang core knobs dasLLAMA honours
Owned by daslang, not by dasLLAMA — listed because dasLLAMA’s behaviour depends on them. DAS_TUNE_* is covered in skills/tune.md.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
number |
conservative default |
Total compute lanes for job queues (N-1 workers plus the caller). Overrides set_jobque_threads_cap; see skills/environment_variables.md. |
|
number |
0 |
Worker affinity: 0 off, 1 ideal-processor hint, 2 hard mask. Matters on big SMT boxes. |
|
number |
profile-driven |
Team-dispatch rank gate. When set, it suppresses the box profile’s own team_rank_gate knob. |
|
path |
Kernel-tuning sidecar to read/write. Point it somewhere writable when the app dir is read-only. |
|
|
text |
unset |
Kernel-tuning mode. The [tune] framework owns these; see skills/tune.md. |
|
text |
unset |
Kernel-tuning policy override. The [tune] framework owns these; see skills/tune.md. |
|
text |
unset |
Semicolon-separated kernel fallbacks for the generated tune probe. |