11. dasLLAMA environment variables
GENERATED from the [EnvConfig] declarations 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 declaration fails tests/test_env_registry.das.
Types: flag is unset-means-default, 0/false/off/no (any case) is false and
anything else true; number falls back to the default when unset or unparseable, with
a logged warning on garbage; text and path are taken verbatim. A SET-BUT-EMPTY
variable counts as unset everywhere. Every knob loads ONCE, at context init, into the
g_env_* globals - hot code reads struct fields, and set_env_variable after startup
is invisible (arm a child process’s environment instead).
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 file beside a source model for millisecond reloads. 0 skips the file: LLM ggufs take the full parse; audio carriers mint the image in memory and serve that (they are always image-backed). |
|
flag |
on |
Persist the prepared image beside the source; 0 builds it in memory and serves that, leaving no .dlim behind. |
|
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 |
2 (the top notch) |
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 |
Bucket gguf -> image conversion time by kind over the weight walk; one clock pair per tensor. |
|
flag |
off |
Permit a big gguf load without -jit; the transforms run interpreted, so expect minutes per GB. |
|
flag |
on |
Advisory source-mapping readahead at gguf load (cold-conversion fix); =0 restores on-demand faulting. |
|
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. Vision
The image preprocessing rail: dynamic-resolution token bounds and the debug dump.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
number |
40 (the gemma-4 model default) |
Minimum soft tokens per image; dynamic-resolution geometry upscales to reach it. |
|
number |
280 (the gemma-4 model default) |
Maximum soft tokens per image; dynamic-resolution geometry downscales to fit. |
|
text |
unset |
Path prefix: dump every letterboxed image fed to a vision embedder as |
11.3. 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 |
Serve the non-causal media span on the prefill driver (AttnArgs.uend); 0 declines it to the CPU arm, which then needs declared CPU intent. |
|
flag |
on |
Serve tower/embedder encodes (gemma4uv; the whisper-class towers as they land) on the Metal tower driver; 0 pins the CPU tower. |
|
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.4. Vulkan backend
Vulkan GPU backend. Present only where the dasVulkan package is installed.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
text |
auto |
Cooperative-matrix mode; the flash-attention twin needs it even when the GEMM runs sdot4. |
|
text |
32 |
Small-batch tier: 32 = sdot4 (default, beats both coopmat tiles below the crossover), 64 = coopmat M, 128 = always-L. |
|
number |
64 |
Small-d cutoff routing narrow roles (k/v) to the small tier; widening measured worse, so this is an instrument. |
|
flag |
on |
Fused decode tail (add+rms+requant, qk-norm+rope); 0 pins the split dispatches for a same-build A/B. |
|
flag |
on |
Stream expert uploads on the dedicated transfer queue, overlapped via a timeline semaphore; 0 keeps the single-queue rail. |
|
flag |
on |
Stream mirrors import the mapped .dlim (VK_EXT_external_memory_host) instead of pinned copies; =0 restores the copy path. |
|
flag |
off |
Serve from P3-trimmed vulkan images (big CPU weight families dropped; folded into the flavor identity). |
|
flag |
on |
Tag allocations high-priority (VK_EXT_memory_priority) so the driver demotes desktop memory, not ours. |
|
flag |
on |
Vulkan flash attention: the decode fa kernel pick AND the cm2 prefill fa tile; 0 falls back to the chunked/scalar paths. |
|
flag |
on |
Use a ReBAR device-local host-visible heap when one larger than 1GB is present. |
|
number |
0 |
Arm the resident driver with f32 KV mirrors instead of the f16 default (A/B instrument; only sessions of the armed codec are served). |
|
number |
0 |
cm2 prefill tile pick: 0 = occupancy heuristic, 128 = force the m tile, 256 = force the l tile (A/B instrument). |
|
number |
0 |
cm2 split-k: 0 = occupancy heuristic, 1 = off, N = force N k-chunks (A/B instrument; shrinks if N strands an empty tail). |
|
path |
unset |
Directory of |
|
flag |
off |
Barrier at every dispatch (correctness bisect). |
|
flag |
off |
Log every detected hazard and the barrier it produced. |
11.5. MoltenVK (macOS)
MoltenVK’s own configuration - listed because the vulkan tier arms it on Apple.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
unset (tier forces 0) |
MoltenVK’s own knob. Its argument-buffers default miscompiles the batch tile kernels (stores never land, silently); the tier forces discrete bindings when this is unset. |
11.6. 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 |
d/256, max 8 |
Strip count for the f32 sgemm lane; 0 keeps the shape-derived default. |
|
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.7. Harness - tuner and probes
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
path |
unset |
Directory holding the .gguf models the probes, benches and tests load. |
|
path |
auto-resolved from the models dir |
Model used by the tuner’s confirm gate (FULL path, not a bare filename). Unset: the gate auto-resolves from the models dir — the preferred confirm carrier, else the largest present q8 gguf; the fallback pins only when the box has no q8 model at all. |
|
text |
unset |
Override the batched-dispatch chunk count in the 1-core GEMM probe. |
|
number |
unset |
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.8. Benchmarks
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
flag |
off |
Let a bench cell measure on fallback/absent tune winners, and skip the auto-tune mint entirely (untuned kernels keep fallback stamps instead of paying the minutes-long tune). The gate exists because a stale sidecar silently downgrades every kernel and the whole board sandbags; only set for dev runs whose numbers are never published. |
|
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 |
unset |
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. |
|
text |
unset |
Dump generated MSL from the Metal labs instead of running it. |
|
text |
unset |
Substring filter restricting which arms the Metal MoE lab runs. |
|
text |
unset |
Substring filter restricting which shapes the Metal GEMV/GEMM labs run. |
|
text |
unset |
Substring filter restricting which kernel variants the Metal GEMV/GEMM labs run. |
|
path |
_wcliff.bin |
Scratch file the write-cliff probe writes, cwd-relative by default; point it at the drive under test. |
|
number |
50 |
Gigabytes the write-cliff probe writes before reporting. |
11.9. Profiling and baselines
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
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. |
|
text |
probed |
Override the GPU name recorded in a box 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 |
../whisper.cpp |
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 |
Base CPython 3.10-3.12 for creating the ASR oracle venvs, when neither PATH names nor uv resolve one in range. |
|
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.10. 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. |
|
path |
unset |
Windows scratch-directory fallback when TMPDIR is unset (the test runner’s log dir). |
11.11. Examples and tutorials
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
path |
unset |
Model path for the dasLLAMA tutorials when none is passed on the command line. |
11.12. Sidecar exchange
Overrides for the dasllama.io exchange client.
Variable |
Type |
Default |
Effect |
|---|---|---|---|
|
text |
unset |
Sidecar exchange base URL override (tests, mirrors); unset = the baked-in dasllama.io. |
|
text |
unset |
One-shot exchange accept-policy override: verified |
11.13. 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 |
|---|---|---|---|
|
path |
~/.cache/huggingface |
Hugging Face hub root; fetch_models –convert resolves checkpoint blobs under <HF_HOME>/hub. Falls back to HOME’s default cache location when unset. |
|
path |
unset |
Ambient platform variable; read only to derive the default Hugging Face cache when HF_HOME is unset. |
|
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 |
2 on darwin (engine [init]), else 0 |
Worker affinity: 0 off, 1 ideal-processor hint, 2 hard mask — on darwin mode 2 is QoS classification (no pin API) and dasLLAMA defaults it on. 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. |
|
flag |
off |
Compile the jobque marker rail in (read at COMPILE time by daslib/build_const). Without it trace_tag/trace_marker erase from the program; decode_prof –trace refuses on a build without it. |