Quant Menu — 9 Quantization Formats (v0.38.0)
Pick the right quantization format for your base model and hardware. Soup loads the appropriate quantization_config and trains LoRA on top.
# Train LoRA on top of a pre-quantized GPTQ checkpoint:
base: TheBloke/Llama-2-7B-Chat-GPTQ
training:
quantization: gptq # or: awq, hqq:4bit, aqlm, eetq, mxfp4, fp8For FSDP with QLoRA there is nothing to set: when you launch with --fsdp and quantization: 4bit, Soup sets training.bnb_4bit_quant_storage itself to the compute dtype, and overrides a different value you wrote, printing FSDP QLoRA: selected or overrode. The key is otherwise an ordinary BNB setting, accepted only with quantization: 4bit (since v0.76.0 mxfp4 with bnb_4bit_quant_storage is refused, because the MXFP4 load is dequantized and not a bitsandbytes load).
What v0.74.0 changed for a 4-bit load
The fp32 finding is usually described in terms of a frozen base, which is a full-precision story. It reaches a quantized load too. A quantization: 4bit or 8bit model still holds real modules outside the quantized linears, the embeddings, the norms and the LM head, and those were being materialised in fp32 for the same reason: no dtype was passed. They now follow the load dtype (auto, or an explicit fp16 on a pre-Ampere card), matching bnb_4bit_compute_dtype instead of sitting a precision above it. (That was not what the resident SFT path did through v0.77.2: PEFT's prepare_model_for_kbit_training upcast the embeddings, norms and an untied head to float32 after the load. Since v0.78.0 a CUDA card with bf16 hardware casts back to bf16 the ones that loaded as bf16 (#2609, #2683); a card without bf16 hardware, the CPU, grpo_fp16 and an fp16 auto_mixed_precision pick keep PEFT's float32. The scope and the one measurement.) Do not attach the release's 2.59x figure to this: that number was measured on an unquantized frozen base with LoRA, and a 4-bit run was never paying the same bill.
Format matrix
| Format | Bits | Use case | Optional dep |
|---|---|---|---|
4bit | 4 | Default. Best general LoRA training. | bitsandbytes |
8bit | 8 | Larger memory budget, more accurate gradients. | bitsandbytes |
none | 16/32 | Full fine-tuning or DPO/PPO without quant. | — |
gptq | 2/3/4/8 | Train LoRA on top of an existing GPTQ checkpoint. | gptqmodel |
awq | 4 | Train LoRA on top of an existing AWQ checkpoint. | autoawq |
hqq:Nbit | 1, 2, 3, 4, 5, 6, 8 | Wide bit range; compose with LoRA. | hqq |
aqlm | 2 | Extreme compression. | aqlm |
eetq | 8 | Fast 8-bit kernel for SM75+. | eetq |
mxfp4 | 4 (stored) | Train LoRA on top of an MXFP4 pre-quantized checkpoint (for example GPT-OSS). Loaded with Mxfp4Config(dequantize=True), so it trains in bf16: budget memory for the bf16 model, an estimated 2 bytes per parameter (roughly 42 GB for a 20B base). A local base must declare quant_method: mxfp4 in its config.json, or the config is refused at setup | — |
fp8 | — | Train LoRA on top of an FP8-released checkpoint. Loaded with FineGrainedFP8Config(dequantize=True), so it also trains in bf16: budget for the bf16 model, 2 bytes per parameter, not for the FP8 file | transformers ≥ 5.17.0 |
8bit is refused on backend: unsloth (v0.77.0). Soup's Unsloth loader passes load_in_4bit only, so quantization: 8bit used to load the model in 16-bit with no word; it now stops the load, naming quantization: 4bit or none with Unsloth, or backend: transformers for 8-bit (#1946).
VRAM pre-flight. On a CUDA card (not under stream_layers, which has its own check, and not on backend: mlx), soup train prices the whole run before the model loads (weights, adapters, gradients, optimizer state, activations, logits, overhead) and refuses one that does not fit, but only inside the range the estimate was fitted on; outside it, it prints the figure as a warning and starts (see the hardware-fit calculator). --allow-oom-attempt launches a refused run anyway. It does nothing on CPU or when the card's memory is unknown. The weights are priced in bytes per parameter: none 2.0, gptq and awq 0.55, aqlm 0.5, eetq 1.0, and 2.0 for mxfp4 and fp8, which are dequantized on load. Under 4bit and 8bit only the linear layers are quantized (0.53 and 1.02 bytes per parameter, scales included) and the embeddings, output head and norms are fp32 for training on a card without bf16 hardware and bf16 (2 bytes per parameter) on a CUDA card with bf16 hardware since v0.78.0 (#2683); without the model's config.json the flat 0.5 and 1.0 are used. Since v0.78.0 an 8-bit run with gradient checkpointing is also priced for the inputs bitsandbytes' int8 matmul keeps outside checkpointing (#2860), so a run that launched close to the card's limit on v0.77.x can be refused now; gradient_checkpointing: medium on a bf16 card is outside the calibrated range and only warns. The figures are estimates. hqq:* has no figure, so the run starts and the pre-flight prints Pre-flight skipped: no memory model for quantization: hqq:4bit (with the format you set). No refusal there does not mean the run fits.
Compatibility matrix
soup train runs check_quant_distributed_compat() at startup. HQQ / EETQ / AQLM hard-fail with FSDP and ZeRO-3; BNB 4-bit + FSDP is resolved rather than warned about since #350: bnb_4bit_quant_storage is set to the effective compute dtype before the model loads, and the adapter parameters are aligned to it before FSDP wraps them, which closes both halves of the old failure. Nothing is left for you to set by hand. The remaining combinations emit a yellow warning.
Pre-quantized + QAT
gptq / awq / hqq:* / aqlm / eetq / mxfp4 / fp8 all carry their own scale; combining with quantization_aware: fp8 or quest is rejected at config-load. quantization_aware: true (int8 QAT) is refused on its own, whatever the format (v0.76.0, #1222): see Backends.
Training on AWQ and GPTQ checkpoints is separate from exporting to them. The Quant Menu path above, a LoRA on top of an existing awq or gptq checkpoint, is unchanged in v0.77.0. The export commands are gone: soup export --format awq|gptq and soup quantize --to awq|gptq were removed in v0.77.0, together with the [awq] and [gptq] extras. AWQ and GPTQ export need v0.76.x and its [awq] or [gptq] extra, for example pip install "soup-cli[awq]<0.77"; upstream notes that both projects are archived and incompatible with [train]. No Soup extra installs the autoawq or gptqmodel package the training path needs, so you install it yourself; given that note, check that installing autoawq leaves your torch and transformers versions in place. See Export.
Scope
Wired into the SFT trainer + transformers backend in v0.38.0. Multi-trainer expansion landed in v0.40.5. MLX backend gets a distinct error message naming the actual reason.
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.