Repository navigation
engine: learn in place on the serving lane; the training graph stops growing with the window - #5057
Conversation
…growing with the window Bumps core/vendor/llama.cpp 178224903 -> cde8ffea3 (CambrianTech/llama.cpp#65, fable/p2-learn-live). What her lane gains: - llama_opt_learn / POST /learn: a reply learns on the slot that served it, exact against the walk, her cache byte-identical after; one optimizer step per call; a 10% duty cycle while another slot works. The core does not call it (the trigger is being redesigned per Joel, 2026-10-15: learning from her own perception, weighted by her relevance); /train is unchanged. - The training graph no longer grows with the window (three window-sized holds removed: a Metal F16 K/V copy reserved in every attention's output, a quantized cache's dequant kept per layer, recompute refusing to rebuild cache reads); K/V gradients only for the run's rows; a per-row weighted cross-entropy; Cormac's CPU attention backward (6.9x) and CPU OUT_PROD (9-13x). ## Measured (M5 Metal, 2026-10-15, fork cde8ffea3) - qwen3.5-4b hybrid training graph peak, chunk 512, recompute, q8_0 cache: 8k 1,096 -> 550 MiB, 32k 1,888 -> 615 MiB; f16 cache 32k 2,020 -> 581 MiB; loss identical. - test-walk-exact (qwen2.5-0.5b, qwen3.5-4b): every exact row cosine 1.0000, recompute vs not 1.0000, caches byte-identical; test-backend-ops MTL0 grad 19818/19818. - 4B test server, 2 slots: the other slot's per-token p50/p95 46.8/73.3 -> 46.1/73.8 ms with learning on; a served conversation + correction learned, loss 1.573 -> 0.474. ## Measured after deploy (owner Fable, before anything calls /learn on her lane) On her 27B lane at her served window: serving per-token p50/p95 vs the previous engine; a /train-or-/learn step's graph peak against the serving reservation; the other slot's p50/p95 with learning on vs off. Posted to this PR and continuum-dev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Cormac on #5057 at 75da280 (pin 178224903 -> cde8ffea3): the engine is SOURCE-APPROVED; the PR is BLOCKED on one CI failure. P1, blocking: The claim I verified, as you asked: the recompute rule in
P2, hardening, not blocking: Checked on the CPU and NOT a regression (for the record): I've also reviewed, earlier today: the CPU attention backward (b75293d, mine; your M5 5/5), kv0 (0135932, bit-identical slice oracle on the CPU), CPU OUT_PROD (f0045c0, mine; Metal 414/414), |
…the gitlink and LLAMA_CPP_PIN The source-hygiene vendor_pin check reads core/vendor/LLAMA_CPP_PIN beside the submodule (Cormac's review: it still named 178224903). The fork commit adds the guard his review asked for: recompute never clones an in-place write into a buffer the forward did not compute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Cormac: APPROVED at ef07ba2 (pin 178224903 -> 5b8500ee2). Verified, and how:
Engine pieces I reviewed earlier today: the CPU attention backward (b75293d), kv0 (0135932, bit-identical slice oracle on CPU), CPU OUT_PROD (f0045c0), Not verified by me: the M5/27B runtime behaviour of learning on her lane. That's the post-merge acceptance (other slots' p50/p95 with learning on vs off at her window, and an adopted learned adapter with an eval delta). Pre-existing and not blocking: the CPU grad suite's EXPM1 range and REGLU abort, on card 397cefc6 (mine). |
engine: learn in place on the serving lane; the training graph stops growing with the window
Bumps core/vendor/llama.cpp 178224903 -> cde8ffea3 (CambrianTech/llama.cpp#65, fable/p2-learn-live).
What her lane gains:
walk, her cache byte-identical after; one optimizer step per call; a 10% duty cycle while
another slot works. The core does not call it (the trigger is being redesigned per Joel,
2026-10-15: learning from her own perception, weighted by her relevance); /train is unchanged.
F16 K/V copy reserved in every attention's output, a quantized cache's dequant kept per layer,
recompute refusing to rebuild cache reads); K/V gradients only for the run's rows; a per-row
weighted cross-entropy; Cormac's CPU attention backward (6.9x) and CPU OUT_PROD (9-13x).
Measured (M5 Metal, 2026-10-15, fork cde8ffea3)
32k 1,888 -> 615 MiB; f16 cache 32k 2,020 -> 581 MiB; loss identical.
1.0000, caches byte-identical; test-backend-ops MTL0 grad 19818/19818.
learning on; a served conversation + correction learned, loss 1.573 -> 0.474.
Measured after deploy (owner Fable, before anything calls /learn on her lane)
On her 27B lane at her served window: serving per-token p50/p95 vs the previous engine; a
/train-or-/learn step's graph peak against the serving reservation; the other slot's p50/p95
with learning on vs off. Posted to this PR and continuum-dev.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo