Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

docs(bench): tighten the FP8-source loss check wording (#2066 follow-up) (#2080)

Alpamys Makazhan6a9b7a90f6e2
diff --git a/benchmarks/README.md b/benchmarks/README.md
index 715c84c0..2d43e394 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -57,7 +57,7 @@ They are the evidence behind the preprint:
| [`gate-1702-arena-packing.md`](gate-1702-arena-packing.md) | Largest-first packing of the pinned host-memory arenas on the layer-streaming RAM tier ([#1702](https://github.com/MakazhanAlpamys/Soup/issues/1702), shipped in [#1713](https://github.com/MakazhanAlpamys/Soup/pull/1713)); Qwen3-8B NF4 on the RTX 5070 Laptop 8 GB | **Memory saving confirmed, no speed claim.** The RAM tier page-locks 6,442,450,944 bytes where the in-order plan page-locks 8,589,934,592, and three deterministic optimizer steps are byte-identical between the two plans (870 of 870 digests). The 40-run speed series measured +1.96% on the RAM tier, inside the +/-15.13% band its own control set, so by the rule written beforehand no speed-up and no slow-down is claimed; the band is wide and cannot exclude a smaller change |
| [`gate-1892-nf4-scale-cache.md`](gate-1892-nf4-scale-cache.md) | End-to-end A/B of the opt-in `training.stream_nf4_scale_cache` ([#1892](https://github.com/MakazhanAlpamys/Soup/pull/1892)) on a streamed Mistral-7B NF4 run | **Confirmed on one laptop:** median paired reduction 3.387 % [2.389, 6.936] over five AB/BA pairs against a rule of >= 2 % with lower bound > 0; +0.446 GB VRAM. The companion `--train-threads 1` test showed no gain (median -0.555 %) and is dropped. Exactness is covered by the PR tests, not by this record. |
| [`gate-fp8-shard.md`](gate-fp8-shard.md) | Sharding a DeepSeek-V3 FP8 block-quantised checkpoint by dequantising it at shard time (CPU only): dequant exactness, streamed-from-FP8 vs resident parity on a tiny `DeepseekV3ForCausalLM`, and Moonlight-16B-A3B converted to the format and sharded | **G1, G2, G3 pass.** Bit-exact against an independent per-block reference (and transformers' own dequant where its block rule applies); logits, loss and LoRA gradients bit-exact in both expert layouts, caches tensor-for-tensor equal incl. NF4; the 27-layer NF4 cache of the FP8 copy came within 0.0002% (0.000115%) of the pre-flight estimate, and every checked FP8-derived tensor equals the reference. No GPU run |
-| [`probe-rtx5070-moonlight-fp8-source.md`](probe-rtx5070-moonlight-fp8-source.md) | The GPU loss check `gate-fp8-shard.md` leaves to the maintainer: does a `soup train` LoRA run on the FP8-block copy of Moonlight-16B-A3B train like the same run on its bf16 source? Two arms, the same code and config apart from `base` and `output`, fused NF4 caches; limits on the step-1, per-step, epoch-3 and evaluation loss differences, GPU peak and seconds per step, set from a matched-size reference pair measured before the run | **FAIL (T2_max_step, T6_step_time)**, 2026-10-20. Both arms complete on the 8 GB card at the same 3.1 GiB GPU peak. Step-1, final-evaluation and epoch-3-mean losses agree to 0.081, 0.072 and 0.101, within their limits, but the 5-token row diverges by 3.27 nats at step 7 (limit 1.6), and B's median step took 1.91x A's (limit 1.10). A diagnosis after the verdict finds the cache layouts identical and the reader on direct I/O in both arms, with B's files reading at A's rate or faster on a rested drive; it traces T6 to the drive's sustained-read plateau, which B started on after its own shard I/O. The rule's cool-down covered the GPU, not the drive. Speed parity and per-step parity are not shown |
+| [`probe-rtx5070-moonlight-fp8-source.md`](probe-rtx5070-moonlight-fp8-source.md) | The GPU loss check `gate-fp8-shard.md` leaves to the maintainer: does a `soup train` LoRA run on the FP8-block copy of Moonlight-16B-A3B train like the same run on its bf16 source? Two arms, the same code and config apart from `base` and `output`, fused NF4 caches; limits on the step-1, per-step, epoch-3 and evaluation loss differences, GPU peak and seconds per step, set from a matched-size reference pair measured before the run | **FAIL (T2_max_step, T6_step_time)**, 2026-10-20. Both arms complete on the 8 GB card at the same 3.1 GiB GPU peak. Step-1, final-evaluation and epoch-3-mean losses agree to 0.081, 0.072 and 0.101, within their limits, but the 5-token row diverges by 3.27 nats at step 7 (limit 1.6), and B's median step took 1.91x A's (limit 1.10). A diagnosis after the verdict finds the cache layouts identical and the reader on direct I/O in both arms, with B's files reading at A's rate or faster on a rested drive; the most likely cause of T6 is the D: drive's sustained-read plateau (section 6), with B's timed steps starting 17 s after its own shard I/O. The rule's cool-down covered the GPU, not the drive. Speed parity and per-step parity are not shown |
## Harnesses
diff --git a/benchmarks/probe-rtx5070-moonlight-fp8-source.md b/benchmarks/probe-rtx5070-moonlight-fp8-source.md
index 26875a0f..ee781914 100644
--- a/benchmarks/probe-rtx5070-moonlight-fp8-source.md
+++ b/benchmarks/probe-rtx5070-moonlight-fp8-source.md
@@ -4,10 +4,14 @@ Status: **FAIL (T2_max_step, T6_step_time)**, runs 2026-10-20 11:51Z-12:25Z. Bot
COMPLETE; T1, T3, T4 and T5 pass. Sections 1-3 and appendix A are the rule and the setup as
committed in `62bc0331b` (branch `feat/moe-fp8-loss-check`, from `25c876f65`, then the head of
#2061) before either arm ran, and are unchanged; after #2061 merged (as `32af390c`, with one
-later review commit) that commit was rebased onto main as `2efb4ca99`. Section 4 is the run log and section 5 the
-results. Sections 6 and 7 are analysis done AFTER the verdict and are not part of the rule:
-section 6 traces T6 to the drive's state, and section 7 discusses T2. Neither changes the
-verdict. No threshold was changed and no arm was re-run.
+later review commit) that commit was rebased onto main as `2efb4ca99`. `62bc0331b` was committed
+locally before either arm ran and was never pushed; the only public copy is `2efb4ca99`, whose
+committer date is 2026-10-20 14:04Z and which sits in PR #2066 (opened 14:06Z), both after the
+runs, so "written before any run" cannot be checked from public history. Section 4 is the run log and
+section 5 the results. Sections 6 and 7 are analysis done AFTER the verdict and are not part of
+the rule: section 6 gives the most likely cause of T6, the D: drive's sustained-read plateau, and
+section 7 discusses T2. Neither changes the verdict. No threshold was changed and no arm was
+re-run.
## 1. Question
@@ -417,7 +421,8 @@ steps run as fast. T6 stays FAIL.
## 7. T2: per-step divergence on short rows (analysis after the verdict)
-The breach is on row 0, the shortest row (5 supervised tokens), every time it is seen:
+Step 7 is the one breach: 3.2655 against the limit of 1.6, on row 0, the shortest row (5
+supervised tokens). Row 0 comes up at steps 7, 12 and 22; steps 12 and 22 are below the limit:
| step | A | B | ΔL |
|---:|---:|---:|---:|
@@ -425,9 +430,10 @@ The breach is on row 0, the shortest row (5 supervised tokens), every time it is
| 12 | 8.2903 | 8.7763 | +0.4860 |
| 22 | 6.5275 | 7.6556 | +1.1281 |
-The next largest per-step gaps also fall on short rows, both under the limit but above the
-matched reference's maximum of 0.818: -1.3845 at step 4 (row 4, 11 tokens) and -1.2548 at step
-10 (row 1, 14 tokens). Against that:
+The next largest per-step gaps after step 7 also fall on short rows, all under the limit but
+above the matched reference's maximum of 0.818: -1.3845 at step 4 (row 4, 11 tokens), -1.2548 at
+step 10 (row 1, 14 tokens) and +1.1281 at step 22 (row 0, above). Step 12, at +0.4860, is below
+0.818. Against that:
- step 1, a pure base forward, agrees to 0.081;
- the evaluation after epoch 3 agrees to 0.072;
- the epoch-3 mean agrees to 0.101.
diff --git a/docs/performance-and-quantization.md b/docs/performance-and-quantization.md
index aa64421f..6beff617 100644
--- a/docs/performance-and-quantization.md
+++ b/docs/performance-and-quantization.md
@@ -527,7 +527,7 @@ What the sharder does:
Measured:
- **Numerics.** On a tiny DeepSeek-V3, the model streamed from the FP8 checkpoint matches a resident model holding the same dequantised weights bit for bit, in its logits, loss and LoRA gradients, in both expert layouts. Its layer cache holds the same tensors, bit for bit, as the one sharded from those dequantised weights, NF4 included ([gate](../benchmarks/gate-fp8-shard.md)).
- **Disk and RAM.** The disk pre-flight charges each FP8 weight at the rate its dequantised tensor is stored at, and nothing for the scales. So does the RAM check that runs before sharding under `stream_source: ram`, so a base whose dequantised weights do not fit in RAM is refused before anything is written.
-- **A real checkpoint, CPU only.** Moonlight-16B-A3B, converted to this format, sharded in 93 s (27 layers, NF4, `fused`). The 30.60 GB cache came within 0.0002% of the pre-flight's figure (0.000115%: 35,336 bytes), and every FP8-derived tensor checked in three layers equals an independent dequantisation of the source. No GPU run is recorded yet.
+- **A real checkpoint, CPU only.** Moonlight-16B-A3B, converted to this format, sharded in 93 s (27 layers, NF4, `fused`). The 30.60 GB cache came within 0.0002% of the pre-flight's figure (0.000115%: 35,336 bytes), and every FP8-derived tensor checked in three layers equals an independent dequantisation of the source. A GPU `soup train` comparison against the bf16 source is recorded in [`probe-rtx5070-moonlight-fp8-source.md`](../benchmarks/probe-rtx5070-moonlight-fp8-source.md) (pre-registered verdict FAIL on per-step loss and step time; see the record).
Limits and refusals:
- **Architecture.** Only `model_type: deepseek_v3` is admitted. A Kimi K2 checkpoint declares `model_type: kimi_k2` and is still refused by name, FP8 or not.