What's New
Five PEFT-surface improvements that LlamaFactory and Axolotl maintain. Faster init, periodic adapter refresh, per-module rank, surgical architecture patches, and a cleaner template registry.
- PiSSA init — set
training.lora.init_strategy: pissafor SVD-initialized LoRA pairs. Faster early convergence vs random init at the cost of one extra SVD pass on the first epoch.init_strategy: olorais also accepted (equivalent to legacyuse_olora=True, which auto-aligns for back-compat). - ReLoRA callback — set
training.relora_steps: 500to magnitude-prune LoRA adapter weights every 500 steps and clear optimizer state. Useful for very long training runs where the LoRA capacity saturates. Bounds:relora_warmup_ratio[0,1],relora_prune_ratio(0,1),relora_reset_optimizer: true. - Per-pattern LoRA rank —
training.lora.rank_pattern: {q_proj: 8, v_proj: 16}andalpha_patterngive different ranks per target module pattern. Useful in MoE configs where expert FFNs need lower rank than attention. Caps: 256 keys × value 1024. - Surgical PEFT patches — Gemma 4
ClippableLinearis auto-swapped to plainnn.Linearso PEFT's matcher recognises it; fused-MoE 3-D expert weights havelora_dropoutzeroed to dodgeParamWrappercrashes. Both are gated by architecture detection (regex word boundary on the model name) and never run on unrelated models. - Template registry — the 16 built-in templates now live as
soup_cli/templates/*.yamlwith amanifest.jsonindex.soup init --template <name>reads the YAML; the inline copies inschema.pystay as a back-compat fallback (deprecated in favour of the YAML registry).
Net +164 tests (4374 → 4538). All five review-agent waves clean before tag.
Install / Upgrade
pip install --upgrade soup-cli
# or
pip install soup-cli==0.39.0Docker image (auto-published to GHCR ~10 min after this release):
docker pull ghcr.io/makazhanalpamys/soup:0.39.0Security
LoraConfig.init_strategyLiteral["random","pissa","olora"] rejects unknown strategies; PiSSA + DoRA / VeRA combinations rejected at config-load. Back-compat alignment ofuse_olora=True→init_strategy="olora"uses dict-copy inmodel_validator(mode="before")(no caller mutation).rank_pattern/alpha_patterncapped at 256 keys × value (0, 1024], rejects bool / null-byte / empty key. Cross-validator rejects withuse_vera=True.ReLoRAPolicyis@dataclass(frozen=True); boundssteps ∈ [1, 1e7],warmup_ratio ∈ [0,1],prune_ratio ∈ (0, 1)(strict — prevents zero-everything footgun).magnitude_prune_tensorrejects non-Tensor input withTypeError; empty / single-element tensor short-circuits (avoidskthvalue(_, 0)crash)._validate_relora_supported_taskscross-validator restrictsrelora_stepstotask=sfton transformers backend with distinct MLX-backend error message.is_gemma4_modeluses a word-boundary regex(?:^|[^a-z0-9])gemma-?4(?:[^a-z0-9]|$)so"ungemma4ed"/"my-gemma4ish"no longer over-match (the previous substring match would have triggered theClippableLinearswap on unrelated custom models).apply_gemma4_clippable_patchis gated byis_gemma4_model(cfg.base)in the SFT trainer before invocation; failed weight-copy logs at DEBUG instead of silent random-init.templates/load_templatecontainment: filename re-validated via_validate_name(rejects..///\/ null / empty);os.path.realpath + os.path.commonpathcontainment check on the resolved path against_templates_dir()so a tamperedmanifest.jsoncannot read files outside the package directory. Tampered-manifestValueErrorfrom_validate_namecaught and falls back to inline (no propagating exception). 256 KB file-size cap. InlineTEMPLATEScarries an explicit deprecation comment pointing at the canonical YAML registry; full inline ↔ YAML byte-equality drift-guard test for all 16 templates.
Known Limitations
- ReLoRA wired in the SFT trainer only. The 10 other transformer-backend trainers (DPO / GRPO / KTO / ORPO / SimPO / IPO / PPO / RewardModel / Pretrain / Embedding) reject
relora_stepsat config-load with an explicit error message naming the actual reason. Multi-trainer expansion is tracked for v0.39.1, mirroring v0.27.0 MII / v0.37.0 multipack / v0.38.0 quant menu stub-then-live pattern. - Surgical patches wired in the SFT trainer only. Same multi-trainer follow-up scope.
- Inline
TEMPLATESdict still ships alongside the YAML registry for back-compat. A drift-guard test asserts byte-equality of all 16 inline ↔ YAML pairs on every CI run, but a contributor editing one source without the other will need to wait for CI to catch the drift. Planned removal: v0.41.0+. - License (advisory): Soup migrated from MIT to Apache-2.0 in 2026-04-21. Downstream redistributors must retain
NOTICEper §4(d) of the Apache-2.0 license. No code change required from end users.