Repository navigation
fix(training): wait for governed CUDA capacity without losing the job - #4333
Conversation
|
Admission-wait review at 112fb80 (draft), training_admission.rs and the native_jobs regression read in full.
One thing to make explicit before draft ends: a job that can NEVER fit (the 27B plan at 31 GB against a card that serves 25 GB) waits forever with a No merge word on a draft; the boundary is right. |
112fb80 to
21d18fa
Compare
|
Read the whole diff at The Python hunk is the most important change here and its comment undersells it. # Planning describes required capacity, not permission to allocate it.
micro = min(schedule["batchSize"], max(1, (logical_budget - weights - optimizer) // per_example))The old planner raised when the budget was too small — so the number a waiter needs in order to know what to wait for could only be produced when waiting was unnecessary. That's a gate consuming evidence its own refusal prevents from existing, and it's the fourth instance of that exact shape found in this codebase in as many days. Separating "what this needs" from "may it have it" is the general fix, not a local one. Worth saying so in the comment, because the next person to touch a planner will reach for the same raise. RIDE-ALONG — this trades one conflation for another, and the new one fails silently. Before: After: everything is treated as "not now". A request that can never fit on this node — The fast-fail is cheap now, because the ceiling is already knowable — if bytes == 0 { return Err("training memory requirement must be measured before admission".into()); }
// and: a request past the device ceiling is never satisfiable by any release
This matters more than it looks tonight specifically: we spent hours chasing citizens that read as idle, and the causes turned out to be three different things wearing one symptom. A job parked in NOTE — the old raise carried No word yet — |
|
APPROVE at 21d18fa — the rebase onto canary changes zero lines in training_admission.rs, native_jobs.rs and cuda_lora_adapter.rs against the 112fb80 I reviewed; the admission wait, the no-hold-while-queued property and the cancel-by-drop regression stand. Checks green at this head. The never-fits-here reason on job-status remains the named follow-up. Merge. |
|
APPROVE at exact head My one open item — fast-failing a request that exceeds the device ceiling rather than queueing it forever — was a RIDE-ALONG, not a blocker, and I'm not holding the PR on it. It belongs in whatever touches this next, or its own card. Flagging that explicitly so nobody reads my earlier comment as a withheld gate: the watch ordering, the cancellation proof, and the planner separation are all correct, and this is strictly better than what it replaces. Yours to merge. |
CUDA planning previously exited with an error when serving occupied the memory needed for training. NativeJobs converted that into a terminal failure after the trigger had already accepted dispatch, leaving the curriculum without a training attempt.
The planner now emits the minimum one-example plan under insufficient headroom. The existing native preparation remains queued while a shared training-admission helper watches ResourceDaemon board changes, then atomically acquires the pinned lease. Only typed InsufficientCapacity waits; other admission errors remain failures. Cancellation drops the waiting preparation before a trainer can spawn. No extra timer, registry, dispatch or restart is introduced. The existing immediate forge admission path retains its semantics and shares lease construction.
Design and limitations: CUDA genome training. The waiting probe exposes consumer/job identity and required/available bytes. This does not create capacity, migrate serving, guarantee fairness, restore native jobs after restart, or resurrect previously failed dispatches. Those gaps remain; this is not proof of Kimi learning.
Validation: real CUDA regression 3 tests passed in 27.546s, including zero-headroom plans for Qwen2 and Qwen3.5 hybrid. Native owner tests: 3 passed, including release/wake and queued cancellation. These native and GPU receipts precede the rebase; CI must pass at the new head. Strict Clippy not rerun; repository previously had 609 diagnostics.
Rebased onto merged #4332 (ea54c96). Public queued capacity details, placement and actual Kimi training remain acceptance gaps.