Observability & Dev UX (v0.34.0)
Tools that explain why a run misbehaved instead of dumping a stack trace.
soup why
Heuristic explainer — reads the most recent (or named) run and surfaces plain-English diagnoses with concrete next steps.
soup why # most recent run
soup why run_2026_abc # specific run id (or prefix)Detects: NaN/Inf loss, plateau (≥30 steps with <0.5% change), divergence (loss > 3× initial), persistent high gradient norm, learning rate outside the typical [1e-6, 5e-3] band. Pure rule-based — no model calls. Since v0.77.2 the summary line keeps a recorded zero: a run with 0 steps or a loss of 0.0 prints that value, and - means the value was not recorded (before, a recorded zero also printed as -).
soup tui
Full-screen Textual dashboard. Two-pane: run list (left) + selected-run detail (right). r refreshes, q quits.
pip install "soup-cli[tui]"
soup tui --refresh 1.0 --limit 50soup train --profile
Records a torch.profiler Chrome-trace over an early-steps window (default wait=1, warmup=1, active=5, repeat=1).
soup train --config soup.yaml --profile
# → ./output/profiles/<run_id>.trace.jsonOpen in chrome://tracing or Perfetto.
Since v0.76.0 the trace is written: a callback steps the profiler on every training step. Through v0.75.2 the command announced the trace path and wrote nothing, because nothing in the code stepped the profiler (#1448). A trainer that exposes no step hook prints --profile: this trainer has no step hook, so no trace will be written and writes none. The default window is 1 wait, 1 warmup and 5 active steps, so the profiler needs at least that many training steps to have anything to write; that last point is arithmetic from the schedule, not something this page ran.
Stopping and checkpointing a run that is already going
Since v0.78.0 a Hugging Face Trainer run saves on request, at an optimizer-step boundary (#2414, reported as #2357).
- Ctrl+C, three presses. The first press writes a checkpoint after the next completed optimizer step and the run keeps training. The second press saves and stops. The third press restores the previous signal handler and raises
KeyboardInterruptat once, without waiting for a save: that is how Ctrl+C behaved on v0.77.2, the version checked, where the CLI's top level printsInterrupted.and exits with code 130 (read at the call site; not run, because the three presses need a real console, which upstream also lists as not exercised by hand). .checkpoint_now. Create an empty file named.checkpoint_nowin the run's output directory (the path has to resolve under the working directory; a symlink is neither followed nor consumed). It is read at each optimizer-step boundary, and the run saves a checkpoint and keeps training. The file is removed only after the checkpoint was written, so a failed save leaves it for the next step.
The scope is a Hugging Face Trainer run. In upstream's words, native MLX training and custom loops that do not use the Hugging Face Trainer, task: unlearn included, do not implement these controls: there, neither Ctrl+C nor a .checkpoint_now file writes a checkpoint on request. A script that sent one Ctrl+C (SIGINT) to stop a run needs a second press now, or a third to interrupt at once. A signal that arrives in the middle of gradient accumulation stays pending until the next step boundary, so nothing is written before then; one that arrives before training starts, while the model loads, is an ordinary KeyboardInterrupt (exit 130), because the handler is installed when training begins (read from the code, not run). Checkpoints on the training.save_steps schedule (default 100) are written as before, and soup train --resume auto continues from the newest one.
(Since closed in v0.78.0: through v0.77.2 soup train called neither the Ctrl+C graceful-save handler nor the .checkpoint_now watcher that v0.44 shipped; one Ctrl+C ended the run with exit 130 and nothing saved, and touching .checkpoint_now did nothing, even though upstream's operations document described both as live.)
Crash bundles — .crash files
When training fails, Soup auto-writes a self-contained .crash JSON to ./.soup-crashes/crash_<utc>_<hex>.crash containing:
- Redacted error trace
- Classified failure kind (
oom/nan/cuda/dataloader/nccl/other) - GPU state at crash time
- Env summary
- Last-50 metric rows
- Config, error message, traceback and metrics are redacted before the bundle is written (since v0.78.0, #2883): URL userinfo and sensitive query parameters, common API-token shapes,
Authorization/Bearerheaders, JWTs, private-key blocks and values stored under credential-named config keys become<redacted>. The bundle records counts only (redaction.values_redactedand per-kind counts), and a text that cannot be redacted is stored as<redaction failed: text withheld>, never raw. Redaction is pattern-based and best-effort: read a bundle before you share it. Through v0.77.2 a narrower set of token shapes (hf_*,sk-*,Bearer ...and similar) was replaced with<redacted>in the same fields, and nothing was counted.
The output_dir is reduced to os.path.basename so $HOME doesn't leak. Bundle truncated to 1 MB.
What a run records about the code (v0.78.0)
For a local soup train, Soup records the full Git HEAD commit of the directory the command starts in, plus clean, dirty or unknown, observed before dataset and model setup write anything (#2675, #2692, by @AubakirovArman). soup runs show prints them as Commit: and State:, and soup runs compare as Code commit and Code state. It is a startup observation, not an archive, not proof that the code was identical and not an attestation. It follows Git discovery from that directory, is not the commit of Soup's installation, the config's folder or the model's Hub repository, and dirty counts staged, unstaged and untracked files, so an untracked soup.yaml or output folder makes it dirty. Git is optional: no Git, no repository, an unborn HEAD, a failed probe, a changing HEAD or a status scan longer than the two-second deadline record unknown without stopping training, and no network call is made. soup sweep arms leave both fields unknown; older rows keep unknown and nothing fills them in. (From upstream's documentation and the code at the tag; not run on a training job.)
A reward curve in the tracker (v0.78.0)
Reinforcement-style runs record their per-step training reward in two nullable metrics columns added in place to ~/.soup/experiments.db (#2891): reward, the mean over the logging window that ends at the step, and reward_std where the trainer logs one. soup train fills them from TRL's reward and reward_std (GRPO) and objective/scores (PPO, and online DPO scored by a reward model or function), by exact key name. NULL means not measured: every other run, a row that logged no reward and a value that is not a finite number. A PPO log carries no loss, so a PPO run records its reward with NULL loss, lr and grad_norm, and soup why and soup runs show say that the run recorded a reward and no loss. soup runs show prints Reward: first -> last (N steps) under Loss: only for a run that has one. A reader that plots a curve should skip metrics rows whose kind is summary or eval. A database written by v0.78.0 stays readable by v0.77.2. Upstream's riders: the key mapping is the one TRL 0.29.1 writes, read from its source; PPO and online DPO have not been run end to end against it; and MLX GRPO does not write the per-step reward (its rows carry val_reward only).
The live training panel (v0.78.0)
Two lines were added. Remaining: 1h 12m 3s | Estimated finish (local): 2026-11-19 14:05:00 appears when the total steps and a usable training speed are known: it is a projection at the latest measured iterations per second, hidden when an input is unknown. On a GRPO run in the Transformers live panel, Zero-spread groups: 37.5% shows the share of groups whose completions all got the same reward (TRL's frac_reward_zero_std), and one warning per run is logged when more than 50% of groups had zero spread for five distinct logged steps (GRPO reward diversity is low ...). That rule is a diagnostic heuristic, not a quality gate, and it changes nothing about training. MLX GRPO writes the fraction into its own metrics line only.
Per-run cost
Every completed run stores an estimated cost ($ per run) computed from the captured GPU device name and duration.
soup runs show <run_id>
# Cost: $4.21 Duration: 1h 38m GPU: RTX 4090CPU / MPS / unknown GPUs render — (no fabricated zeros).
soup cost --config soup.yaml # estimate before training
soup cost --config soup.yaml --gpu H100 # specific GPU
soup cost --config soup.yaml --json # machine-readable--json prints a JSON array with one object per provider and GPU (provider, gpu, cost_per_hr, duration_hrs, total_cost) instead of the table. If the training data cannot be read, or a Hub dataset has no split metadata (since v0.78.0, #2960), the estimate assumes 10,000 examples; the table prints a warning saying so and --json does not. Since v0.77.2 (#2345) soup cost --json sends its configuration and GPU-filter diagnostics to stderr, so stdout carries only a successful JSON estimate: with an unknown --gpu, stdout is empty, stderr says No matching GPUs found for: <name> and the exit code is 1. Exit codes and the table output are unchanged.
soup rewind
Finds which dataset rows were in the batch when a loss spiked. It is documented on its own page: Rewind.
soup runs replay
soup runs replay <run_id>Replay summary + downsampled loss curve from history (no live training restart).
Global --log-level
soup --log-level verbose train --config soup.yaml
soup --log-level debug runs show <id>Tiers: quiet | normal | verbose | debug. Wires a Rich-formatted logger on the soup namespace; debug enables timestamps + module paths.
Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.