feat(forge): forge/train — drive unsloth LoRA training (genome loop, Phase 5 slice 1) - #1695
Merged
Conversation
…Phase 5 slice 1) Replaces the forge stub's "Phase 5+ train lands later" with the real TRAIN stage. Closes the train half of the coordination↔learning flywheel: a persona's room work → dataset/from-turns JSONL → THIS drives unsloth to fine-tune a LoRA genome on it. continuum orchestrates; unsloth (the engine) executes the train. forge/train builds an `unsloth train` invocation from a from-turns dataset + base model + LoRA params (r/alpha/epochs, sane defaults; recipe-borne later), runs it off the main thread (tokio::process), and returns the result. `dry_run` maps to unsloth's --dry-run (resolve config + exit) so the seam is validated without GPU time. Missing-dataset and missing-unsloth fail loud. Live-validated: forge/train --dry-run against the running unsloth resolves the full training config end-to-end — model: unsloth/Qwen3-0.6B, local_dataset: <from-turns jsonl>, format_type: chat, training_type: lora, lora_r: 16, target_modules: q/k/v/o/ gate/up/down_proj … proving continuum builds a VALID unsloth train invocation from a persona's room data. Tests (extend the forge test mod): missing-dataset guard + the live dry-run (skip-if-no-unsloth). 10/10 forge tests pass. Remaining for #32: export the LoRA (unsloth export) + page it into the genome, and map a ForgeRecipe → these train params. See memory coordination-learning-flywheel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flywheel's training executor
Replaces the forge stub's "Phase 5+ train lands later" with the real train stage. This closes the train half of the coordination↔learning loop:
room work → recorder turns →
dataset/from-turnsJSONL →forge/traindrives unsloth → LoRA genomecontinuum orchestrates; unsloth (the engine) executes the train.
What
forge/trainbuilds anunsloth traininvocation from a from-turns dataset + base model + LoRA params (r/alpha/epochs — sane defaults, recipe-borne later), runs it off the main thread (tokio::process), and returns the result.dry_runmaps to unsloth's--dry-run(resolve config + exit) so the seam is validated without GPU time. Missing-dataset / missing-unsloth fail loud.Live-validated
forge/train --dry-runagainst the running unsloth resolved the full training config end-to-end:— proving continuum builds a valid unsloth train invocation from a persona's room data.
Tests (extend the forge test mod)
forge_train_errors_on_missing_dataset— the missing-input guardforge_train_dry_run_resolves_against_live_unsloth— the live dry-run (skip-if-no-unsloth)Remaining for #32
Export the LoRA (
unsloth export) + page it into the genome, and map aForgeRecipe→ these train params.See memory
coordination-learning-flywheel.🤖 Generated with Claude Code