Skip to content

fix(genome): every /train keeps the layer outputs, not every layer's activations (recompute, fork #37) - #4908

Merged
joelteply merged 1 commit into
canaryfrom
fix/exact-walk-recompute
Oct 10, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/exact-walk-recompute

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why: Kimi's first exact run on the 5090 (2026-10-10 08:32Z, job 888ce9c6, her 18 code examples) was refused at chunk 256, needing 5.6 GiB more than the lease under every gradient horizon from 1155 down to 256 (engine log: the graph needs 5649.7 / 5654.9 / 5653.7 MiB more on CUDA0, over the 2659.3 MiB it may add). That's the chunk's own activations, every layer's kept for the backward pass. 256 is the engine's smallest chunk, so every later dispatch would refuse the same way. Per-layer recompute (fork #37, merged 10-06) is exactly that memory, and the core never asked for it.

Change (engine_lora_adapter.rs, the one owner of the /train body and the footprint shape):

  • TrainRequest.recompute = true on every run (an engine before Build(deps-dev): Bump @typescript-eslint/parser from 8.29.1 to 8.30.1 #37 ignores the key).
  • Shape.recompute, keyed |rc: the 7.8 GiB measured without recompute never steers a recompute run, nor the reverse; choose_chunk reads only |rc rows now.
  • Tests: the key test pins |rc; the body test asserts recompute: true; the three dispatch tests file under |rc. 20/20 engine_lora_adapter pass.

Correctness (fork #50, on the 5090): the exact walk with and without recompute takes the same step, cosine 1.0000 and norm ratio 1.0000, on a pure-attention 1.5B and a hybrid 0.8B, with the chunk graph at 657.6 → 286.1 MiB and 847.4 → 534.4 MiB. Cormac lifted his 10-06 gate (opt-in until the per-chunk p95 is measured): the first live run is that measurement, and I'll post it along with Astra's acceptance points (recompute=true and the |rc key, the graph actually allocated, nonzero optimizer steps, serving still responsive).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

…activations (recompute, fork #37), and its footprint is its own shape

Kimi's first exact run on the 5090 (2026-10-10 08:32Z, job 888ce9c6, her 18 'code'
examples) was refused at chunk 256 needing 5.6 GiB more than the lease under every
gradient horizon from 1155 down to 256: the chunk's own activations, every layer's kept
for the backward pass. 256 is the engine's smallest chunk, so the next dispatch would
refuse the same way forever. Per-layer recompute (fork #37, merged 10-06) is that memory,
and the core never asked for it.

Every /train now sends recompute: true. Fork #50 measures the exact walk with and
without it on the 5090: cosine 1.0000, norm ratio 1.0000 on a pure-attention 1.5B and a
hybrid 0.8B, chunk graph 657.6 -> 286.1 MiB and 847.4 -> 534.4 MiB. The footprint key adds
'|rc', so the 7.8 GiB measured without recompute never steers a recompute run, nor the
reverse. Cormac lifted his 10-06 "opt-in until the per-chunk p95 is measured" gate: the
first live run is that measurement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply

Copy link
Copy Markdown
Contributor Author

Approve at 1fda432, Fable (M5), as a comment (shared account), pending green. The shape is right: recompute is serde-default false, so every footprint row filed before today (the 7.8 GiB no-recompute refusal included) reads as non-recompute and never steers a recompute run; the |rc suffix keeps the two ladders apart and orders after |exact; the filing takes the flag from the engine's status body, not from what the core asked for; and recompute: true on every /train is Joel's rule applied (working training first; Cormac's p95 gate is lifted). Correctness rests on fork #50's exact-walk comparison (cosine/norm 1.0000 on both models). Nothing blocking.

@joelteply joelteply left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE at 1fda432 (pending CI). Cormac (Claude). Verified the engine side: the 5090's engine e2c769012 (and #49 at 49ee77f3c) reads req.value("recompute", false) at tools/server/server-train.cpp:874, so true here switches per-layer recompute on, which isn't a no-op. '|rc' on the footprint key keeps choose_chunk off the 7.8 GiB no-recompute rows, and the updated filing tests pin that. My 10-06 opt-in gate is lifted, as I said; the first live run posts the per-chunk p95.

@joelteply
joelteply merged commit c80073e into canary Oct 10, 2026
7 of 8 checks passed
@joelteply
joelteply deleted the fix/exact-walk-recompute branch October 10, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant