Repository navigation
feat(genome): a training job asks the engine for the exact walk, with half the free host memory to keep - #4841
Conversation
… half the free host memory to keep The plain walk steps per chunk and stops the gradient at every chunk boundary: on the 1.5B its step agreed with the true full-window gradient at cosine 0.81 (fork #47's test-walk-exact). The exact walk takes ONE step per window on the window's whole gradient, carried back through every chunk's cached K/V and a hybrid's recurrent state (cosine 0.998 on the 1.5B and on the hybrid 0.8B). The job now sends exact: true, and walk_host_budget_mib: TRAINING_HOST_SHARE (one half) of the host memory the pressure monitor reads free, so the serving engine's file cache keeps the rest (BigMama's page-fault loop, 2026-10-06). The engine checkpoints a hybrid's state more sparsely to fit, shrinks its gradient horizon to fit the device and reports it, and refuses by name when the K/V gradient alone does not fit. An engine before #47 ignores both keys and trains the plain walk, as this core asked before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
|
Review at c64253d (Fable). The shape is right: one named share, sent explicitly and not an env var, with a test that pins it. One blocking issue: Low free memory gives an unbounded walk.
Non-blocking: |
…ry sends the floor (Fable on #4841) An unread monitor and 'under a MiB free' both mapped to no budget, which is unbounded: the tighter memory was, the less the walk was bounded. Now under pressure the job sends the 1 MiB floor, which the engine refuses by name, and an unread monitor trains the plain (chunk-bounded) walk (exact: false). walk_request(reading) is the one decision, tested for both arms. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
|
Fixed: under pressure the job sends the 1 MiB floor (the engine refuses by name), and an unread monitor sends |
|
Approve at 7b35fc3 (Fable). The blocker is resolved exactly as it should be. A read host never gets an unbounded walk ( |
…, and the walk itself (fork #40, #43, #45, #46, #47) 2d4d63bbb -> 5e3961b10 on feat/props-weight-residency: - #40 the walk: decode context into the cache, train each reply chunk against the cached prefix (memory chunk x window, so a 63k window trains on one GPU beside serving) - #45 per-step graphs start each optimizer period from zero gradients (the accumulators were never zeroed: every step applied the sum of every gradient since the run began) - #46 CONCAT backward slices a contiguous gradient (V's gradient through the training attention's transpose was read from the wrong elements) - #47 the exact walk: one optimizer step per window on the gradient of the window's whole loss, through every chunk's cached K/V and a hybrid's recurrent state; host budget, state checkpointing, adaptive horizon (cosine 0.998 vs one graph, 1.5B and hybrid 0.8B, at f32, f16 and q8_0 caches; end to end through /train: eval 0.283 -> 0.215 on the 1.5B, 0.284 -> 0.245 on the hybrid) - #43 Metal: OUT_PROD multiplies in float staging Requested by core #4841 (exact: true with a host budget). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…, and the walk itself (fork #40, #43, #45, #46, #47) (#4845) 2d4d63bbb -> 5e3961b10 on feat/props-weight-residency: - #40 the walk: decode context into the cache, train each reply chunk against the cached prefix (memory chunk x window, so a 63k window trains on one GPU beside serving) - #45 per-step graphs start each optimizer period from zero gradients (the accumulators were never zeroed: every step applied the sum of every gradient since the run began) - #46 CONCAT backward slices a contiguous gradient (V's gradient through the training attention's transpose was read from the wrong elements) - #47 the exact walk: one optimizer step per window on the gradient of the window's whole loss, through every chunk's cached K/V and a hybrid's recurrent state; host budget, state checkpointing, adaptive horizon (cosine 0.998 vs one graph, 1.5B and hybrid 0.8B, at f32, f16 and q8_0 caches; end to end through /train: eval 0.283 -> 0.215 on the 1.5B, 0.284 -> 0.245 on the hybrid) - #43 Metal: OUT_PROD multiplies in float staging Requested by core #4841 (exact: true with a host budget). Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc Co-authored-by: Claude Opus 5.5 <[email protected]>
…sends a chunk whose measured footprint fits the governed VRAM (card d6dae498, Kimi's 04:34Z refusal) (#4894) * fix(genome): the exact walk is its own footprint shape, and the core sends the engine a chunk whose measured footprint fits the governed VRAM (card d6dae498) Kimi's first exact-walk job on the 5090 (fe334d8f, 2026-10-10 04:34Z) refused in 8 s: "the graph needs 9236.1 MiB more on CUDA0, over the 3418.0 MiB it may add". The 3418 MiB was the core's own lease: the footprint registry's Shape is keyed by (model, window, rank, targets, depth), so a plain-walk measurement from before #4841 turned the exact walk on was leased for an exact run whose chunk graph (GRAD leaves for the cached K/V over the horizon) is several times larger. And the core sent no chunk, so the engine took 512 for every job (server-train.cpp: "INTERIM: a caller that sends no chunk gets 512 until the core passes the lease's S (Fable)"); fork #49's horizon retry cannot shrink a graph the chunk's own activations dominate. Shape gains `exact` and `chunk`. The key keeps every older row readable for what it was (the plain walk at the engine's own chunk for that window; the suffix appears only for a shrunken chunk or the exact walk), so an exact run never leases a plain-walk number and calibrates instead. The core mirrors the engine's chunk rule (train_chunk_for), chooses the largest chunk whose measured footprint fits the governed VRAM now (choose_chunk: a measured-too-large chunk halves and asks that shape; an unmeasured one calibrates; the smallest stands and the governor waits), sends it as "chunk", and files the run's graph under the chunk the engine reports it ran (state["chunk"], else the mirrored rule). The planned probe names exact and chunk. Tests: the mirrored chunk rule; the key's compatibility and separation; choose_chunk on the 5090's numbers (12.6 GB at 512 against 6.2 GB free -> 256); a run filed under the window AND the chunk that ran (a 61,696 ceiling is 241 blocks, prime: chunk 256). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(genome): a refused run files the graph the engine's preflight measured, under the chunk it ran, so the next dispatch steps the chunk down (BigMama on #4894) Footprints were filed by a finished run only (finish_run needs a finite loss), so a refused calibration filed nothing and every later dispatch calibrated at the same chunk and was refused the same way. The refusal IS the measurement: the engine's preflight sizes the graph before refusing it and reports graph_mib on an error too. The in-place run now carries its shape and the footprints path, and on TrainState::Error files the reported graph under the window and chunk the engine reports it ran (probe training.job.footprint_from_refusal). choose_chunk then steps down on the next dispatch. The ungoverned (test) admission carries the free VRAM a chunk is fitted against, and the fake engine gains a "refused" mode reporting the 5090's shape. Test: refused at 512 files 12,654 MiB under the shape; the next dispatch of the same request posts chunk 256 against 6 GiB free. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(genome): for_test keeps its cfg(test) gate (the inserted sibling had taken the attribute; the lib build broke) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
What: a training job now asks the engine for the exact walk (fork CambrianTech/llama.cpp #47): one optimizer step per window, on the gradient of the window's whole loss.
Why: the plain walk steps per chunk and stops the gradient at every chunk boundary. Measured with #47's
test-walk-exact(the SGD step read off the adapter, so step = −lr·g, compared against one graph over the whole window):What's sent:
exact: truewalk_host_budget_mib:TRAINING_HOST_SHARE(one half) of the host memorymemory_pressure::current_available_bytes()reads free. The other half stays for the serving engine's file cache (BigMama's page-fault loop, 2026-10-06). When the monitor hasn't read the host yet, no budget is sent rather than an invented one (test).The engine checkpoints a hybrid's state more sparsely to fit the budget, shrinks its gradient horizon to fit the device and reports it (
walk_horizonin its status), and refuses by name when the K/V gradient alone doesn't fit. An engine before #47 ignores both keys and trains the plain walk, so this is safe to land before the engine deploys.Tests:
the_exact_walk_keeps_half_the_free_host_memory, plus the end-to-end dispatch test assertingexact: trueon the posted body.engine_lora_adapter18/18.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc