S-exp GPU
All pages
Docs · The command lineMarkdown

Environment

Configuration that belongs to the machine, not the experiment, is read from the environment once, at run start.

Variables

variablevaluesmeaning
SEXPGPU_DEVICEcpu, reference, cuda, rocm, metalcpu, the optimized host backend, is the default; reference selects the unoptimized interpreter; cuda needs the Linux CUDA binary; rocm needs the Linux x86-64 ROCm build, sexpgpu-rocm beside sexpgpu; metal needs macOS and a Metal-enabled binary. See devices
SEXPGPU_CPU_CORESa positive integermaximum host worker cores for SEXPGPU_DEVICE=cpu; unset uses the available cores
SEXPGPU_DEVICES0, 0,1, ...; unset is all visibleGPU ordinals in rank order; evaluate and serve run on the first, 0 when unset; Metal accepts only 0 or unset. See several GPUs
SEXPGPU_NODES, SEXPGPU_NODE_RANK, SEXPGPU_RENDEZVOUS, SEXPGPU_NODE_GRADIENTSsee several nodesone run across machines
SEXPGPU_METRICSjsonl:<path>, stdout, o41, o41:<folder-id>where numbers go; unset is nowhere. See metrics
SEXPGPU_TIME_LIMITpositive finite secondsthe session time budget; unset is unlimited
SEXPGPU_FINAL_EVAL_RESERVEfinite seconds in [0, limit)time reserved before final evaluation; requires SEXPGPU_TIME_LIMIT, default 0
SEXPGPU_STATUSa paththe status file; unset is none
SEXPGPU_DIAGNOSTICSglobs, attention/*,logits/*replaces defrun :diagnostics for every compile; --diagnostics wins over it
SEXPGPU_RUN_SLUGa namethe base of the run slug, which check prints too; default the file's stem
SEXPGPU_CHECKPOINT_DIRa directory, s3://, gs:// or az:// prefix, or o41://<artifact>where checkpoints go; without it :checkpoint-every does nothing. See locations
SEXPGPU_KERNEL_STOREs3://bucket/prefix; unset or empty disables itoptional compiled CUDA kernels in your own bucket; a missing or unusable entry compiles normally
SEXPGPU_KERNEL_STORE_HINTa stable logical name; default the run-file pathoptional identity for finding a previous run’s compiled kernels after edits or moves; it changes no computation
SEXPGPU_RESUMElatest, or <location>/step-<n>continue the location's latest, or fork one checkpoint; see resume
SEXPGPU_CHOICESa checkpoint, a JSON file, fresh, or missingthe recorded choices a run takes; unset, a resume takes its checkpoint's. See determinism
SEXPGPU_DETERMINISTIC1, 01 measures nothing and sends f32 between nodes; no guarantee of identical bits; see determinism
SEXPGPU_EVAL_LIMITa positive integer; default 250000000the compile-time work budget; E-EVAL-041 when exceeded. See limits
SEXPGPU_MEMORYGiB, 12 or 7.5the free device memory the memory plan assumes instead of the device's own, to try a shape against a smaller card
SEXPGPU_EXPLAINkernelsadds every launch of each graph, with its shape, dtype and model path, to the lowering report of run and explain
O41_METRICS_API_KEYa keyrequired by the o41 target
O41_METRICS_FOLDER_IDa folder idthe o41 target's folder; o41:<id> wins over it
O41_ARTIFACTS_API_KEY, O41_ARTIFACTS_ORGa key, an organization idan o41:// checkpoint location; see 041 Artifacts
SEXPGPU_ANALYTICSoff, 0, false, case-insensitiveturns off the usage event
SEXPGPU_PERFORMANCE_REPORTSoff, 0, false, case-insensitiveturns off the compile record
SEXPGPU_AUTO_UPDATE, O41_AUTO_UPDATE0turns off the automatic update a published binary, a bundled one included, starts after a command; sexpgpu update still works
DO_NOT_TRACKanything but empty, 0, falseturns off both, as it does for other tools

In an rrun job, rrun sets RRUN_JOB_ID, RRUN_ATTEMPT and RRUN_BUNDLE_SHA256. The run names the job and archive checksum in its open metadata, and each attempt in an rrun job <id> attempt <n> annotation. An RRUN_ATTEMPT that is not a positive integer is ignored with a warning, and the run records no job.

S3 credentials

The loader, checkpoints and the optional kernel store read S3. Each has its own role. Each value resolves on its own, first match wins:

SEXPGPU_DATA_AWS_<name> / SEXPGPU_CHECKPOINT_AWS_<name> / SEXPGPU_KERNEL_STORE_AWS_<name>
  >  SEXPGPU_AWS_<name>                                        shared by the roles
  >  AWS_<name>                                                what every other tool reads

for <name> in ACCESS_KEY_ID, SECRET_ACCESS_KEY, ENDPOINT_URL and REGION. Plain AWS_* is enough on most machines; the SEXPGPU_* names are for when AWS_* is set for another tool, or when data and checkpoints live in different buckets. An s3:// checkpoint location with any of the four missing is refused before the first step, and the message names it.

The kernel store is enabled only by SEXPGPU_KERNEL_STORE; a checkpoint location never enables it. Its credentials also accept SESSION_TOKEN for temporary credentials. Grant its credentials read and write access to the prefix you name. Only trusted jobs should have write access: stored kernels are executable code, and integrity checks do not authenticate their writers. The store shares compiled kernels across programs and machines with the same compiler and target. Errors, timeouts and damaged entries are misses; training compiles those kernels normally. It keeps no local disk cache. Background fills also retain generated kernel source, compiler options and build metadata in your bucket.

CUDA startup reports the store's hits, misses, bytes read and written, and request seconds. Parallel request times overlap. It also reports how many requested kernels its inventory held and the compile-CPU weights of held and used entries. The compile record includes these totals in compile.kernel_store when a store is enabled. The CLI hashes the run-file path, or SEXPGPU_KERNEL_STORE_HINT, to help find a previous run after an edit; the original path is retained by rrun. This hint never substitutes for the exact source, compiler and target checks.

041 Artifacts

An o41://<artifact> checkpoint location needs O41_ARTIFACTS_API_KEY, an API key from the app; without it the run is refused before the first step. O41_ARTIFACTS_ORG names the organization a user token acts in. Each checkpoint goes to a bucket of yours near the machine, found from O41_ARTIFACTS_CLOUD and O41_ARTIFACTS_REGION, then rrun's RRUN_CLOUD and RRUN_REGION, then SkyPilot's SKYPILOT_CLUSTER_INFO, then the cloud's metadata service. Each cloud and region pair needs both variables. The machine needs no bucket credentials: the bytes go over signed URLs.

Precedence

For the seven settings that exist as a flag and a variable, the flag wins, and there is no defrun key for any of them:

--device / --metrics / --status / --checkpoint-dir / --resume / --choices / --deterministic
  >  SEXPGPU_DEVICE / SEXPGPU_METRICS / SEXPGPU_STATUS / SEXPGPU_CHECKPOINT_DIR / SEXPGPU_RESUME
     / SEXPGPU_CHOICES / SEXPGPU_DETERMINISTIC

For the two the file states, the flag wins, and there is no variable:

--steps / --eval-every  >  defrun :steps / defeval :every

Diagnostics exist in all three places:

--diagnostics  >  SEXPGPU_DIAGNOSTICS  >  defrun :diagnostics

An override of the file is recorded as a knob of source override, so the metrics metadata, the checkpoints and the status file all show it. Knob values follow their own rule, --set over the variant over the default; see knobs.

Usage analytics

The published binary sends one anonymous event after each command finishes, never during a run; watch, which runs until interrupted, sends it as it starts, with duration_ms 0. A command sexpgpu hands to sexpgpu-rocm is reported once, by the ROCm build. Delivery happens in the background with a 1.5-second timeout and never waits for the network before returning the command's result. A delivery failure is ignored.

propertyvalue
commandthe tool and the verb, sexpgpu run, sexpgpu check, sexpgpu --version, ...; sexpgpu alone for anything else
outcome, duration_mssuccess for exit 0, else error; the command's wall time
cli, cli_version, channelsexpgpu; the version; nightly or stable
os, arch, builddarwin or linux; arm64 or x64; the binary's cuda, rocm, metal or cpu
deviceonly for run, evaluate and sweep: cpu, reference, cuda, rocm or metal
ciwhether CI is set to anything but empty, 0 or false
agentthe coding agent running the command: AI_AGENT, else claude-code, codex, cursor, gemini-cli or copilot by the variables each sets, else AGENT, else null
ttywhether standard output is a terminal

Nothing else of the command line is sent: no file, path, knob or flag value. The event carries a random id kept in $XDG_STATE_HOME/sexpgpu/analytics-id, or ~/.local/state/sexpgpu/analytics-id. It names the installation, not a person: SexpGPU has no accounts and builds no profile. The server sees the address the request came from. The command that creates the file says so once, on standard error. A file that is malformed or cannot be read or written gives that command a fresh id; its contents are never sent.

SEXPGPU_ANALYTICS=off (or 0, false) or DO_NOT_TRACK turns it off: nothing is sent and the id file is not touched. It is separate from the compile record.

Compile records

The published binary sends one compile record after run and evaluate: the program the device compiled, what the compiler chose for it and how fast that ran. The records train the cost model the compiler makes those choices with. It is on by default; one variable turns it off, and your data never leaves the machine.

It is sent once the command has printed its summary, never during the run. A run that failed or that a signal stopped sends none, nor do the points of a sweep; of several nodes, node 0 alone sends. It waits at most 5 seconds, 30 when the program is uploaded, and a failure is ignored: the command's output and exit code are unchanged.

fieldvalue
version, commandthe binary's version; run or evaluate
os, archlinux or macos; x86_64 or aarch64
devicethe GPU's name, cpu for the host backend, or reference for the interpreter; the backend; on CUDA and ROCm the memory and the driver version; GPUs per node and nodes; and the bandwidth, launch time and flop rates the run measured, when it did
irthe program's digest, as sexpgpu ir --digest prints it
compile_sseconds spent compiling the file, the graphs, the device's plans and its kernels
compilecompile_s by phase: graph_s the file and the graphs, plans_s the device's plans, native_s the GPU libraries' graphs, kernels_s the generated kernels
step_sthe median of the steady steps the run's timing summary reports; evaluate has none
choicesthe choices the run records, how the stacking was chosen (only, largest, model, measured, remembered or pinned), and each stacking that fit with its predicted and, where the first step timed it, measured time
kernelseach kernel kind and shape, with its bytes, flops, launches and predicted and measured seconds; only from a run that times its kernels one by one, which an ordinary run does not

The program itself, the document sexpgpu ir prints, is sent once per digest. It holds the parameters by path, the graphs, the shapes, and the metric, counter and pass names; it holds no file, path, source line, model path, data, loaded weight, seed or step count. The names you gave parameters and metrics are in it, so a run whose names must not leave the machine turns records off. A record has no installation id, host name or user name; the server sees the address it came from.

SEXPGPU_PERFORMANCE_REPORTS=off (or 0, false) or DO_NOT_TRACK turns it off; SEXPGPU_ANALYTICS turns off only the usage event. The first run or evaluate that would send a record says so once, on standard error, and creates $XDG_STATE_HOME/sexpgpu/compile-records, or ~/.local/state/sexpgpu/compile-records, to remember that it did.

Related: run, doctor.