Skip to content

feat(serving): every lane launches with --train-dir, the governed dir the engine's /train writes into; pin ca001c551 (fork #19) - #4438

Merged
joelteply merged 2 commits into
canaryfrom
feat/lane-train-dir
Sep 27, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/lane-train-dir

Conversation

@joelteply

@joelteply joelteply commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Rebased onto canary after #4437 merged. There are two commits: the lane change, and the pin moved to ca001c551, the fork trunk with #19. That second commit is Cormac's condition: at 66035e261 every /train run left <out>.init.gguf in engine-train, and #19 removes it. #19 also brings a real POST /train/cancel and parse_special.

The pinned fork serves POST /train: LoRA-only training on the weights the lane already holds, in a second context beside the slots. It yields between batches while any slot is busy. The route is refused unless the lane passes --train-dir, and it writes only bare .gguf names inside that directory. This PR turns it on for every lane, pointed at one governed directory.

  • lane_args: LaneOptions.train_dir produces one --train-dir <dir> pair. With None the flag is absent.
  • llama_server: engine_train_dir() is ~/.continuum/cache/engine-train. Without a home directory it is None and never falls back to a temp dir. The directory is created at launch. If creation fails, /train is off for that launch with a warning, and the lane serves exactly as it would have. The engine-install receipt requires the path to be absolute, the same as the page dir.
  • disk: it is tracked as engine-train, with an eviction decision. A finished adapter moves into its job dir, so any file whose job is not live is dead and gets deleted.

Nothing calls /train yet. The engine trainer behind FineTuningAdapter is the next PR. It renders examples through the lane's own chat template, posts /train, polls, and moves the adapter into the job dir.

Checks: cargo check -p continuum-core is clean. The new train_dir_flag_is_present_only_when_given_and_carries_that_path test passes, and so does every_cache_class_has_a_decided_eviction_story with the new class.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at cb3b31a57, with one ordering condition. --train-dir is added only when a dir is given (pinned by the test), and it's always the governed ~/.continuum/cache/engine-train (require_absolute, a TrackedDir, an eviction entry). A dir that can't be made turns /train off and leaves serving untouched. CPU and partly-offloaded lanes (the IntelMac) stay safe because the fork refuses /train whenever base weights may be repacked.

The condition: pin a llama.cpp trunk that includes fork #19. At the 66035e261 pin, each /train run leaves its <out>.init.gguf fresh-adapter scratch (5–40 MB) in this dir, and the eviction rule here names only <uuid>.gguf whose job isn't live, so neither side would ever remove it. #19 deletes it right after the load. Alternatively, widen the eviction rule to <uuid>.gguf*.

Co-Authored-By: Claude Opus 5.5 [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at a896c196f: the only delta from my conditional word at cb3b31a57 is the pin 66035e261 → ca001c551 (the trunk with #19), which meets the condition: /train removes its .init.gguf scratch right after loading, so the engine-train eviction rule (<uuid>.gguf of non-live jobs) covers everything that stays. Merges after #4437 as ordered; CI green at the head is the other half of the word.

joelteply and others added 2 commits September 26, 2026 22:26
… the engine's /train writes adapters into

The pinned fork (66035e261) serves POST /train: LoRA-only training on the weights the lane
already holds, in a second context beside the slots, yielding between batches while any slot
is busy. The route is refused unless the lane passes --train-dir, and it writes only bare
.gguf names inside that directory. This turns it on, pointed at one governed directory.

- lane_args: LaneOptions.train_dir -> one `--train-dir <dir>` pair; None = no flag.
- llama_server: engine_train_dir() = ~/.continuum/cache/engine-train (None without a home,
  never a temp dir); created at launch; a failure to create it turns /train off on that
  launch with a warning, and the lane serves as it would have. The engine-install receipt
  requires it absolute, like the page dir.
- disk: tracked as `engine-train`, with its eviction decision (a finished adapter moves
  into its job dir; a file whose job is not live is dead and is deleted).

Nothing calls /train yet; the engine trainer behind FineTuningAdapter is the next change.
Tests: train_dir_flag_is_present_only_when_given_and_carries_that_path;
every_cache_class_has_a_decided_eviction_story passes with the new class.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…rain cancel, parse_special, and the init file removed once loaded)

Cormac's condition on this PR: at 66035e261 every /train run left <out>.init.gguf in
engine-train, which the eviction rule (only <uuid>.gguf) does not name. #19 removes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply joelteply changed the title feat(serving): every lane launches with --train-dir, the governed dir the engine's /train writes into (after #4437) feat(serving): every lane launches with --train-dir, the governed dir the engine's /train writes into; pin ca001c551 (fork #19) Sep 27, 2026
@joelteply
joelteply enabled auto-merge (squash) September 27, 2026 03:46
@joelteply
joelteply merged commit 3f170a5 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/lane-train-dir branch September 27, 2026 03:47
joelteply added a commit that referenced this pull request Sep 27, 2026
… inserted engine_train_dir between them (card a086ca0f) (#4441)

The insertion split kv_pages_root's /// from its fn, so rustdoc gave engine_train_dir both
comments and kv_pages_root none. Doc move only.


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

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Sep 27, 2026
… consumer aligns submodules (P0: a lagging engine would not start) (#4446)

* fix(serving): --train-dir only to an engine whose own --help lists it — an older engine refuses the flag and the lane does not start

#4438 passes --train-dir to every lane. An engine older than the flag rejects it, and the lane
does not start. On the 5090 the core deployed while the engine stayed at b10765-965d38a90 (the
consumer converges the core, not the engine), so only a wedged dirty check kept #4438 off her.

The once-per-process --help probe (the one that reads the engine's KV cache types) now also
records whether the engine LISTS --train-dir (a line starting with it: the real help prints
"--train-dir DIR ..."; 965d38a90 prints nothing for it). The lane gets the flag only then;
unknown (no probe, no answer) is no — in-engine training is never worth a lane. The probe row
carries train_dir.

Test: train_dir_is_accepted_only_when_the_engines_help_lists_it.

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

* fix(deploy): the consumer aligns submodules to the tip it checks out, and a stale submodule pointer is not "uncommitted work"

`git checkout --detach <tip>` moves gitlinks, not submodule trees: #4437's deploy left
core/vendor/llama.cpp at 965d38a90 under a tip pinning 66035e261, and the mismatch then read as
dirty, so the consumer refused every later tip (NothingOwed/RefuseDirty with dirty=true).

After its checkout the consumer runs `git submodule update --recursive` (initialized submodules
only: a deploy never starts a fresh clone; local changes inside a submodule fail it loudly
instead of losing them), and its dirty check ignores submodule pointers (aligning them is its
own job now). Engine convergence itself still needs the elevated registration (#4382:
`continuum install`); the lane-side gate in the previous commit keeps a lagging engine safe.

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

---------

Co-authored-by: Claude Opus 5.5 <[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