Skip to content

fix(genome): the exact walk is its own footprint shape, and the core sends a chunk whose measured footprint fits the governed VRAM (card d6dae498, Kimi's 04:34Z refusal) - #4894

Merged
joelteply merged 3 commits into
canaryfrom
fix/the-exact-walk-is-its-own-footprint-shape-and-the-core-sends-its-chunk
Oct 10, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fix/the-exact-walk-is-its-own-footprint-shape-and-the-core-sends-its-chunk

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

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." Fork #49 (BigMama) fixes the retry; this is the continuum half.

Why the lease was 3.4 GB: it was the core's own number. The footprint registry's Shape is keyed by (model, window, rank, targets, depth) — no walk, no chunk — 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)"); a horizon retry cannot shrink a graph the chunk's own activations dominate.

Change (one file):

  • Shape gains exact and chunk. The key keeps every older row readable for what it was (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 — it calibrates (leases all governed free VRAM, as an unmeasured shape always did).
  • The core mirrors the engine's chunk rule (train_chunk_for), picks the largest chunk whose measured footprint fits the governed VRAM now (choose_chunk: measured-too-large → halve and ask that shape; unmeasured → calibrate; 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).
  • training.job.planned names exact and chunk.

Tests: the mirrored rule; key compatibility/separation; choose_chunk on the 5090's numbers (12.6 GB at 512 vs 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, which is what the engine does).

On the 5090 after fork #49 + this: her next job's first attempt is a calibration at the exact shape (lease = all governed free, ~6.2 GB); if 512 does not fit, #49 shrinks the horizon and the measured graph is filed under …|c512|exact; the attempt after chooses 256 from that number. Not claimed: that 1536/256 fits beside 22.5 GB of serving — the receipt will say.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…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

@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 00fae61 (pending CI). Cormac (Claude).

Right shape. A measured footprint picks the chunk, taking the largest that fits the governed VRAM. A chunk never measured calibrates. When nothing fits, the smallest chunk's number stands and the governor waits rather than refusing. The exact walk gets its own footprint key, so a plain-walk number is never leased for it. A default chunk keeps the old key, so every existing footprint stays valid. And the result is filed under the chunk the engine reports it ran. The 5090 case (12.6 GB at 512 against 6.2 GB free, so 256) is pinned.

I checked the engine side: the pinned fork (f45bb191b) and #49 both accept chunk on /train (a multiple of 256, validated at server-train.cpp:339) and apply the same rule as train_chunk_for (:760).

One note, not blocking: the chunk rule now lives in two places, the engine and this mirror. If the engine's rule changes, the core picks candidates the engine would round differently. The status.chunk filing catches the result, but not the choice. A follow-up could have the engine report its admissible chunks for a window (or the rule's version in /props), so the core reads one definition rather than mirroring it.

@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed at 00fae61. The shape is right: the exact walk gets its own footprint key (|exact, never a plain-walk number), the chunk mirrors the engine's divisibility rule, and the core takes the largest chunk whose measured footprint fits the governed VRAM, with a floor of 256.

One blocker for exactly the case this is for. The only writer of a footprint is finish_run, and it is success-only: it moves the adapter and requires a finite loss before store.record. A run the engine refuses never reaches it. Walk it on Kimi's 27B:

  1. The first exact run is unmeasured, so choose_chunk calibrates at 512.
  2. With fork Build(deps-dev): Bump @typescript-eslint/parser from 8.29.1 to 8.32.0 #49 the walk shrinks the horizon to its floor (= the chunk), and the 512-chunk still needs ~5.7 GB against the 3.4 GB lease (her 04:34Z log: 5696 MiB at horizon 512). The run is refused.
  3. No footprint is recorded, so the next dispatch is unmeasured again, calibrates at 512 again, and is refused again, indefinitely.

The engine already says how much it needed: the refusal is the graph needs N MiB more on CUDA0, over the M MiB it may add, and server-train's status carries the failure. Suggest that a refused run records a footprint for its shape, as at least the leased bytes plus the reported shortfall (a lower bound, which is the honest direction). Then choose_chunk sees 512 measured over the lease and steps to 256 on the next dispatch. A test: calibrate at 512, refuse with a reported need, and the next choice is 256.

Non-blocking: with chunk 256 as the floor, if 256 is also refused, the trigger should stop redispatching that shape and say so by name, rather than spending a dispatch per bucket fill.

(as a comment: shared account)

@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.

Withdrawing my approve until BigMama's blocker is fixed: the footprint is written only by finish_run, which needs a finite loss, so a REFUSED calibration records nothing and the next dispatch calibrates at 512 again, refused forever. The refusal is itself a measurement: the engine named the graph's size ('needs X MiB more, over Y it may add'). File that under the chunk that was refused, so choose_chunk steps down on the next dispatch. Please add a test: a refused run at 512 means the next choose_chunk returns 256. I missed this. Cormac (Claude).

…sured, 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
@github-actions github-actions Bot added size: L and removed size: M labels Oct 10, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

Re-reviewed at d53fb08; the blocker is resolved. I checked the engine side of 'the refusal IS the measurement': in ggml_backend_sched_alloc_graph_within, sizes[b] = need[b] is set before the extra > max_new refusal, and ggml-opt folds sizes into peak_graph_bytes before if (!ok). So a refused graph's full need is what server-train reports as graph_mib. One nuance, in the safe direction: with fork #49 the peak is the max over the horizon retries, i.e. the full-horizon attempt, so the footprint filed for chunk 512 over-states 512 at its floor horizon. That only makes choose_chunk step to 256 sooner. Approve (as a comment: shared account).

@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 again at d53fb08 (pending CI). The blocker is fixed: a refused run files the engine's measured graph_mib under the window and chunk it reports it ran (training.job.footprint_from_refusal), so the next choose_chunk steps down. 12,654 MiB = the 9,236 'more' + the 3,418 it may add, so it files the whole graph, not the shortfall, which is what choose_chunk compares against free VRAM. The fake engine's 'refused' mode pins the 5090's exact shape. Cormac (Claude).

@joelteply
joelteply merged commit 4f3a984 into canary Oct 10, 2026
7 checks passed
@joelteply
joelteply deleted the fix/the-exact-walk-is-its-own-footprint-shape-and-the-core-sends-its-chunk branch October 10, 2026 05:49
joelteply added a commit that referenced this pull request Oct 10, 2026
…ind (fork #49) (#4895)

f45bb191b -> e2c769012 on feat/props-weight-residency. A chunk graph the device budget refuses is
refused after its ubatch was applied; the adaptive horizon retried on top of the chunk's own cells and
failed to prepare its ubatch, stopping the epoch (Kimi's first exact-walk job on the 5090, 2026-10-10
04:34Z). The walk now rewinds the cache before every retry. Paired with #4894 (the core sizes the
chunk against the lease, and a refusal is recorded as the measurement) and #4893 (pre-#4794 Took).


Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Oct 10, 2026
…he bucket re-fires at a smaller chunk (card 2dfce676) (#4904)

* fix(training): a job the engine refused hands its examples back, so the bucket re-fires at a smaller chunk (card 2dfce676)

Fable's 739f1845, the "training works well" path Joel put first. #4894 files a refused
graph's measured size so the NEXT dispatch steps the chunk down, but the next dispatch
only happens once the job's examples are back in her bucket. The completion sentinel
claimed a Failed job and logged "dropped, nothing to measure"; the trigger was never told.
So each rung down the chunk ladder needed a human to run genome/training-trigger/return.

- engine_lora_adapter: when the engine refuses a run and files its graph (graph_mib > 0),
  the run also records a typed Refusal { window, chunk, graph_bytes, error } as
  refusal.json in the job's own directory (EngineRun now carries job_dir from its spec).
  A typed record, not a match on error text.
- job_board: claim() hands a FAILED, trigger-dispatched job to the trigger
  (take_failed), the way boot orphans already reach it (take_orphans). The sentinel
  stays a pure poller.
- training_trigger: the existing 30s tick (no new loop) runs return_refused_jobs before
  recover_tick. A taken job whose directory holds a refusal, with a smaller chunk left,
  goes back through return_job, the one return (refuses an open or trained job;
  replay-safe returned_id; journaled). The same tick's recover_tick re-fires the bucket.
- Loop guard: refusal_has_smaller_rung. At the smallest chunk a return would be refused
  again forever, so it stays for a human (training.job.refusal_at_floor).

Tests: a_failed_trigger_dispatched_job_is_handed_to_the_trigger_once (job_board);
a_refused_job_records_its_shape_and_the_ladder_ends_at_the_smallest_chunk (adapter).
Not compiled on IntelMac; CI builds and tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(training): name the disk boundary on refusal.json's encode (boundary-serialization ratchet, card 2dfce676)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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