Repository navigation
app: sweep epochs and learning rates in one go - #60
Conversation
There was a problem hiding this comment.
Adds a Sweep mode to the Fine-tune tab: sweep.ts holds pure planning/queue functions (parseEpochs/parseRates, planSweep, advance/refuse, headline, lowestLoss) with 12 tests, useJob drives the queue from a ref (recording done/failed/cancelled/refused runs and launching the next), and RunForm/JobPanel/FinetuneView render the grid preview, the per-run header with Skip/Stop controls, and the final results table. The reload-mid-sweep limitation is documented in the hook. Main things to look at: sweep runs are configured by form fields that are hidden in Sweep mode, and isFinished flips as soon as stopped is set, while the current run is still cancelling.
Automated review by siGit Code Review · commit b6e7d9f · see the review dashboard
b6e7d9f to
e927124
Compare
A sweep is the same training run over several epoch counts and learning rates, one after another. Pick Sweep on the Fine-tune tab, list the epochs and rates, and the form shows the runs it will make, named the usual way (e2-lr1e-4). Runs the project already has are left alone and listed, a grid with nothing new to run is refused, and more than 24 runs is refused, since each can take an hour. While it runs, the header says which run it is on, and Skip run cancels the current one and carries on, while Stop sweep cancels it and starts no more. A run that fails or that the backend refuses to start is recorded with the reason and the sweep carries on. A table of every run, with its result and final loss, stays on screen when it ends, and points at the lowest loss with a note that a low training loss is not proof of a better model. A stopped sweep says how far it got, not "run 4 of 4". The queue lives in the webview, so a reload during a sweep keeps the run in progress (it reattaches) but not the runs after it. The planning and queue logic is plain functions with 12 tests. Checked in the running app on a 12-row project with Qwen3-1.7B: the full 4-run grid ran in order to a summary of final losses. Skip cancelled run 1 mid-training and run 2 started, run 2 finished, and Stop cancelled run 3 so run 4 never started. A first attempt hit a full disk during run 1's merge, and the sweep recorded that failure with its reason and went on to run 2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
A stopped sweep now reads "Stopping after run N of M" until the run in flight ends, then empties the queue. Before, the header and the Stop and Cancel buttons said the sweep was over while a run was still going. Stopping between runs ends the sweep at once. The unused skipCurrent field is gone. The run form now says why Start is disabled: a bad LoRA rank, alpha or max sequence, learning rate or epoch count. The LoRA disclosure opens when one of those is wrong, and the sweep preview shows the LoRA values every run will use. If a project's existing runs are unknown or failed to load, a sweep can't start and the form says so. A census is still allowed. The button reads "Start sweep" until the plan is known. Checked in a browser against a stubbed Tauri bridge. pnpm build and pnpm test (38 tests) pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
7fd5bed to
21cde34
Compare
There was a problem hiding this comment.
This change adds a Sweep mode to the Fine-tune tab: sweep.ts holds pure functions to parse the epoch/learning-rate lists, plan the grid of runs (skipping names the project already has), and advance a SweepState queue run by run, with stop/skip/refusal semantics. useJob keeps the queue in a ref, starts each next run when the previous one's outcome lands, and exposes startSweep/skipRun/stopSweep. RunForm gains the third radio option with a live preview of the planned runs and named reasons for every way Start can be disabled (the earlier review's points about invisible LoRA fields, the stopping headline, the dead skipCurrent flag and the fail-open existing-runs check are all addressed in this version, with the new settings.ts validators and their tests). JobPanel shows the sweep headline, Skip/Stop buttons, and a results table with a pointer to the lowest loss; FinetuneView keeps the form hidden for the whole sweep. The logic is well covered by the new tests; the remaining findings are minor.
Automated review by siGit Code Review · commit 21cde34 · see the review dashboard
…status The sweep summary said "Lowest training loss" and then printed a run name. It now prints the name with its final loss. The "skipped" result status was never produced, since a skipped run is recorded as cancelled, so it is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
There was a problem hiding this comment.
Re-review of the two follow-up fixes at 21cde34. The JobPanel summary now prints the run name followed by its final loss in parentheses, so "Lowest final training loss: e2-lr1e-4 (0.123)" no longer reads as if the loss were the run name — the earlier nit is addressed. The dead "skipped" status variant is removed from SweepResult, matching the earlier fix that records skips as cancelled. Both changes are consistent with the settled threads and introduce no new issues; the double lowestLoss call is harmless since the name is derived from the same results array. No findings.
Automated review by siGit Code Review · commit cfd5abb · changes since 21cde34 · see the review dashboard
Sweeps: the same training run over several epoch counts and learning rates, one after another. Last of the three changes for the Fine-tune tab, stacked on #58.
What changed
e2-lr1e-4). Runs the project already has are left alone and listed. A grid with nothing new to run is refused, and so is more than 24 runs, since each can take an hour.pnpm test, 30 in all). No Rust changed.Testing
In the running app, on a 12-row project with Qwen3-1.7B on MLX:
pnpm buildandpnpm testpass. Not tested:Limits
The queue lives in the webview. If it reloads during a sweep, the run in progress reattaches but the runs after it do not start. The backend does not know about sweeps. I judged that acceptable because a reload is rare in a built app, but a long sweep over a night would deserve a backend queue.
The Mac is kept awake while a run trains, and between two runs there is a moment where it is not.