Skip to content

feat(genome): training depth rides the request and the footprint key; the gene records the depth adapted (fork #27) - #4472

Merged
joelteply merged 3 commits into
canaryfrom
feat/training-depth-rides-the-request-and-the-footprint
Sep 27, 2026
Merged

joelteply merged 3 commits into
canaryfrom
feat/training-depth-rides-the-request-and-the-footprint

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

A full-depth 27B /train needed a 41.5 GB graph at window 1536 beside 6.2 GB free; fork #27
adapts only the last K blocks and reports the depth it used. The core side:

  • LoRAHyperparams.top_layers (optional; None = every block), sent as /train's top_layers.
  • The footprint key carries depth: a reduced depth appends |dK, full depth keeps the key
    every existing row was written under (all full-depth), so a K=8 number is never leased for
    a full-depth run nor the reverse, across a reload (Codex's cases, tested).
  • The measured graph is recorded under the depth the ENGINE adapted (layers_adapted against
    n_layer from /train status): an engine that ignored top_layers measured full depth.
    training.job.depth_differs when asked and adapted disagree.
  • JobMetrics.layers_adapted: the gene says how deep it was trained, for the promotion gate.
  • The window rounds down to a multiple of 256: any other window reached opt_init's assert
    and took the serving process down on engines before Resolve Lerna 8 update conflicts #27.

ts-rs bindings for LoRAHyperparams and JobMetrics updated by hand (no local cargo on the M5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… and the gene records the depth the engine adapted (fork #27)

A full-depth 27B /train needed a 41.5 GB graph at window 1536 beside 6.2 GB free; fork #27
adapts only the last K blocks and reports the depth it used. The core side:

- LoRAHyperparams.top_layers (optional; None = every block), sent as /train's top_layers.
- The footprint key carries depth: a reduced depth appends |dK, full depth keeps the key
  every existing row was written under (all full-depth), so a K=8 number is never leased for
  a full-depth run nor the reverse, across a reload (Codex's cases, tested).
- The measured graph is recorded under the depth the ENGINE adapted (layers_adapted against
  n_layer from /train status): an engine that ignored top_layers measured full depth.
  training.job.depth_differs when asked and adapted disagree.
- JobMetrics.layers_adapted: the gene says how deep it was trained, for the promotion gate.
- The window rounds down to a multiple of 256: any other window reached opt_init's assert
  and took the serving process down on engines before #27.

ts-rs bindings for LoRAHyperparams and JobMetrics updated by hand (no local cargo on the M5).

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

Copy link
Copy Markdown
Contributor Author

@fable #4472 read at 0d95f58 (Cormac): the design is right, and my word follows at a green lib (4 of 7 checks still running). Not built.

  • Depth rides the request (top_layers, omitted when None) and the footprint key (|dK). Full depth keeps the legacy key, which is correct because every legacy row was full depth. The test pins Codex's cases across a reload: a reduced-depth lookup never falls back to the legacy row, and the reduced row never answers for full depth.
  • The measurement is filed under the depth the engine reports (effective_depth(layers_adapted, n_layer)), so an engine that ignored top_layers files its full-depth graph as full depth, with training.job.depth_differs saying so. JobMetrics.layers_adapted carries the reported value to the promotion gate, and is None where the provider can't say.
  • train_window rounds DOWN to 256, so the lease never grows past what was asked.

Non-blocking edges:

  1. K = 0 and K ≥ n_layer. Some(0) is sent as top_layers: 0 and the engine answers 400. Refuse it in the adapter (InvalidRequest), where the depth was chosen. Some(k ≥ n_layer) is full depth: the lookup uses |dK, but the result is recorded under the depthless key, so that shape never gets a measurement and every run leases all governed VRAM. Normalize the asked depth once the engine reports n_layer, or record the asked key too when the engine confirms full depth.
  2. Silent window rounding. 1152 becomes 1024 with no probe, and examples rendered to fit 1152 may be cut. A probe on sequence_length != window (asked and trained) keeps it visible, and it connects to Codex's point that a projection made at 1152 doesn't cover the rounded shape.
  3. The candle, openai and mlx adapters accept top_layers and train full depth. Their layers_adapted: None says so, which is right, and worth one line in the field doc.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

@fable #4472 at 1b85c12: APPROVED (Cormac). 8/8 green, lib-test included. I read the code and did not build it.

  • Depth rides the request and the footprint key. Full depth keeps the legacy key, and a reduced depth never falls back to a depthless row; both directions are pinned across a reload.
  • The graph and the gene are filed under the depth the engine REPORTS. Codex's finish-path test runs a real create → wait → finish against a fake lane for an old engine and a depth-reporting one, and checks the exact key set and layers_adapted.
  • My three edges are in: K=0 is every block, K = n_layer is also filed under its asked key (the comment now says equal, since fork Resolve Lerna 8 update conflicts #27 refuses anything past it), and the rounding is probed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply merged commit 404e01f into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/training-depth-rides-the-request-and-the-footprint branch September 27, 2026 19:39
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