Quant-Lobotomy Checker
Quantization — 16-bit → 4-bit, say — often destroys niche capability you care about while the aggregate score looks fine. soup eval quant-check runs one JSONL task file through a before model and an after model and renders a single OK / MINOR / MAJOR verdict for the pair, so you can catch a stealth regression before you ship it. Since v0.76.0 the verdict is also the exit code (MAJOR exits 2), so it can gate a CI step. It scores one average over the whole file, not one verdict per task or category; see "What can make an OK meaningless" below.
Run it
soup eval quant-check \
--before ./output/merged \
--after ./output/merged-quantized \
--tasks critical_eval.jsonlEach side is loaded with AutoModelForCausalLM.from_pretrained, so each must be a Hugging Face-format model directory that transformers can load, such as a merged model or a quantized checkpoint directory, and it must sit under the current working directory. A standalone .gguf file cannot be loaded this way: it is refused up front with exit 3. Either side can instead be registry://<id> pointing at a registry entry; that resolves to the first artifact recorded on the entry, whatever its kind.
Output
One row, named default, whatever the category values in the tasks file:
Quant check
┏━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃ Task ┃ Before ┃ After ┃ Delta ┃ Verdict ┃
┡━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ default │ 0.540 │ 0.310 │ -0.230 │ MAJOR │
└─────────┴────────┴───────┴────────┴─────────┘What can make an OK meaningless
The score is one average over the whole tasks file: category is not split out, so run the command once per task file if you want a verdict per area.
A tasks file that cannot be read is refused first (v0.77.2). The file is parsed before any model is touched, so a typo in it costs a second, not two model loads: Cannot load --tasks: Invalid JSON on line 1: ..., Cannot load --tasks: Line 1: missing required field 'prompt', Cannot load --tasks: Expected .jsonl file, got: .json or Cannot load --tasks: No eval tasks found in empty.jsonl, exit 3 (run on the v0.77.2 binary). A path that does not exist is still --tasks not found: <path>, exit 3.
If either side fails to load, the command stops (v0.76.0). It prints Failed to load --before model (<path>): <reason> (pass --allow-stub to score with deterministic stubs instead), naming the side that failed (--before or --after), and exits 1. A JSON file, an empty directory or a missing dependency all land here.
Before v0.76.0 that failure was silent. The command printed Live model load failed (...); using deterministic stub., replaced both models with a stub that returned the same canned text for every prompt, showed default | 0.000 | 0.000 | +0.000 | OK and exited 0: a pass that measured nothing. Any CI step that ran soup eval quant-check and looked only at the exit code passed on a broken load. Re-run those.
--allow-stub is the opt-in to the old behaviour, for a smoke run of the plumbing in CI without weights. The table is then titled Quant check (deterministic stub - not a live measurement), --format json carries "stub": true, and in the other formats a line (Failed to load --before model (<reason>); using deterministic stub.) names each side that fell back. A run where both sides fell back still measures nothing and exits 0. The verdict is computed from the scores as usual, so a run where only one side fell back compares a stub against a real model and can exit 2.
Compare latency, tokens per second and memory in the same run: --performance (v0.78.0)
soup eval quant-check \
--before ./output/merged \
--after ./output/merged-quantized \
--tasks critical_eval.jsonl \
--performance--performance adds generation latency, generated tokens per second and the CUDA allocated peak beside the quality verdict, with the before-to-after percentage changes (#2677, proposed by @duysengali-kuanysh and built by @AubakirovArman in #2689). It loads, warms up, measures and releases the first model before it loads the second.
- One device, one dtype policy.
--devicetakesauto(CUDA when available, otherwise CPU),cpu,cuda,cuda:<index>ormps. Both sides use the dtype policy ofsoup infer(float32 on CPU, float16 on CUDA and MPS) and the report records the actual dtype and device. - What is measured. Both sides decode greedily, at most 256 new tokens per call, on the same prompts.
--performance-warmup N(default 1, minimum 0) is the number of unscored warm-up generations on the first task's prompt, and--performance-repeats N(default 3, minimum 1) is the number of measured generations of every prompt; only the first measured answer per task counts toward quality. - What the numbers mean. Latency covers tokenizing, the input transfer, generation and decoding with the accelerator synchronized at both ends, and not loading. Tokens per second divide the actual new token ids (the end-of-sequence token included) by the total measured time, so different answer lengths move both numbers. The CUDA figure is this process's allocated peak across the measured generations after warm-up (weights plus generation buffers, not the load or warm-up transients and not reserved bytes); on CPU and MPS it is
nullin JSON andN/Ain the tables, never a zero. - Raw samples. The JSON
performanceobject holds the per-task samples, and the report says whether the two sides' repeat ranges overlap (latency_ranges_overlapisnullwith one repeat). That is a descriptive within-model repeat check, not a confidence interval and not a comparison of independent loads.
Quality alone decides exit 2. Speed and memory never change the verdict or the exit code, and the table, JSON and markdown show them only when --performance is on. Refused with exit 3 before any model loads (all run on the v0.78.0 binary): --allow-stub together with --performance (--performance cannot measure deterministic --allow-stub generators.), --device or the repeat and warm-up flags without --performance (--device and performance budgets require --performance.), a --device that is not one of the values above, and a repeat or warm-up count below its minimum. A runtime failure exits 1.
Upstream's two functional smokes (a 0.5B model at FP16 against an NF4 copy on one H200, and two identical tiny random CPU models) establish that the path works. In the record's own words they are "not a speedup benchmark or a model-quality evaluation", and no latency, tokens-per-second or memory figure from them is printed here. The release's own pre-release smoke did not exercise --performance by hand; its Known Limitations list says so (the contributor's record).
Exit codes
| Code | Means |
|---|---|
| 0 | OK or MINOR on every task, which includes a run where both sides fell back to stubs under --allow-stub. |
| 2 | At least one task is MAJOR. |
| 1 | A model failed to load (without --allow-stub), naming the side, or an unexpected error. (Through v0.77.1 a --tasks file that is not valid JSONL was also exit 1, after both models had been loaded: Invalid JSON on line 1, or Expected .jsonl file, got: .csv for a .csv or .txt file, although upstream's changelog said 3. Since closed in v0.77.2: the binary says 3, see the next row.) |
| 3 | A usage or input error: an unknown --format, a --before, --after or --tasks path that is missing, outside the working directory or an unresolvable registry:// reference, a standalone .gguf, or a mistyped flag. Since v0.78.0 also a --performance combination that is refused (see above). Since v0.77.2 also a --tasks file that cannot be loaded (invalid JSON, a row without prompt, a name that does not end in .jsonl, no tasks at all, or a path that cannot be opened): Cannot load --tasks: <reason>, printed before either model is loaded (#2185, by @Faisal-Fayaz). Since v0.77.0 also an ambiguous registry:// reference, with a message that names the candidate ids: a name:tag that matches several entries (through v0.76.1 it resolved to the newest), or an id prefix that does (a traceback before) (#1763, #1934). |
Before v0.76.0 the command exited 0 for every verdict and 1 for a bad path. A script that tested for exit 1 as "a bad regression" never fired; test for 2. See Exit codes.
Verdict thresholds
The classifier uses absolute drops in score:
OK— drop< 0.02(or the score actually improved)MINOR—0.02 ≤ drop < 0.05MAJOR—drop ≥ 0.05
Output formats
--format accepts table (default, Rich-rendered), json, or markdown. Pipe the output to a file if you want to persist the report:
soup eval quant-check --before X --after Y --tasks t.jsonl --format json > report.jsonTasks file
Reuse any custom eval JSONL:
{"prompt": "Solve: ...", "expected": "42", "category": "math.competition_hard", "scoring": "exact"}
{"prompt": "Capital of France?", "expected": "Paris", "scoring": "contains"}The file name must end in .jsonl and hold at most 10,000 rows. prompt is required; expected defaults to empty, category to default and scoring to exact. scoring is one of exact, contains, answer, regex, semantic, tool_call_match, tool_call_name_match or tool_call_args_subset; any other value is refused with the line number. Two changes in v0.76.0 move scores: contains now requires the expected string to appear as a whole token (an ASCII alphanumeric run, so 14 no longer contains 4, though 3.4 still does), and answer is new: it compares the final answer the model states, and refuses at load a row whose expected states no single answer. A --before or --after score you recorded with the old substring contains can be higher than the same outputs score now. soup eval custom and soup ship --task-eval read the same format. Since v0.78.0 soup eval custom and a soup ship metric leg count a tool_call_args_subset row as correct only at full credit (#2939); the per-row score, which this command averages, keeps its partial credit, so a quant-check verdict does not move.
See also
- Export — GGUF and the other formats (AWQ and GPTQ export were removed in v0.77.0)
- Evaluation
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.