Bound native CUDA cache recovery by measured forward work - #900
Conversation
a8691cd to
2b84bc9
Compare
…ission Preserve current-main retained-token planning and add portable regression coverage for exact dense-CP demand after allocator recovery.
|
Consolidated review record (automated agent review traffic removed 2026-09-17) Change. Native CUDA admission now uses physical free memory, tries smaller plans first, and permits one bounded cache release when the minimum plan is refused; later releases must fit a 5% budget of measured completed forward work. Public APIs, model math and art.megatron are unchanged. Review. McCarthy, Minsky, Taravangian and Faraday reviewed eight heads; earlier heads had changes requested. McCarthy, Minsky and Taravangian cleared source correctness at merged head Findings addressed during review.
Deferred / follow-ups.
|
Unused CUDA cache may not be reusable by the next allocation. This change bases native CUDA admission on physical free memory, tries smaller plans first, and permits cache release when the minimum plan is refused. It reruns planning with fresh counters afterward; release alone never permits execution. Execution failures are not retried.
The first necessary release is allowed and charged. Later releases must fit a measured recovery budget of 5% of completed forward work, including a reserve for the next recovery. Distributed release costs are summed; backward work, idle time and hypothetical savings earn no credit. This is an accounting policy, not a guarantee of total slowdown. Both forward entrypoints share the ledger within a TrainerRank instance.
This standalone change preserves current main's dense context-parallel rank-load pricing, GDN segment costs, planning-error synchronization and original refusal chains. Public APIs, model math and art.megatron are unchanged. It does not depend on #898's pending estimator changes.
Validation:
The tests-only successor repairs stale plan metadata in the distributed fixture, narrows the inert runtime and flat-plan types, and routes only the two dense-CP cases through the Megatron CI stage. The five affected cases pass, all six distributed workers exit zero, and changed-file Ruff/format/type checks pass. A separate Megatron-blocked collection keeps the other 36 cache-recovery cases in the generic stage; collection is not execution.
Hosted two-H200 validation passed parent
40cb87b7; all runtime source bytes are unchanged by this correction. These are focused checks, not a full-suite result. Successor CI and exact-head reviews remain required. The parent's failed type check and the independently reported stale-fixture failures remain recorded.The retained two-H200 diagnostic passed its four forwards per rank and numerical/state checks, exercising first and earned recovery. Its recovery ledger measured approximately 0.461% of completed forward time; this is not total overhead or net speedup. That run still exited unsuccessfully because rank retirement exceeded its original ten-second bound. Later verified absence does not qualify that failed cleanup or this newer source tree.
Brad explicitly authorized merge on September 17. Subsequent scoped two-H200 evidence passed four forwards per rank, numerical/state checks, initial and earned recovery, and exact-owned cleanup under its original 30-second criterion. Actor retirement required TERM/KILL; this does not erase the earlier diagnostic’s ten-second retirement failure. Three reviewers cleared the merged head and its required CI passed. Backward/optimizer safety, native earned-denial and total training overhead remain separate qualification items; physical re-admission cannot make an underestimated memory demand safe.