Model retained activations and allow selective recompute in TrainerRank - #915
Conversation
422796d to
e1d00a3
Compare
|
Consolidated review record (automated agent review traffic removed 2026-09-17) Change. Replaces TrainerRank's selective-recompute refusal with a retained-activation floor accounting for TP/SP, attention/GDN layer mix, MLP fusion, replicated QKV, prefix-segment states and MLP/MoE checkpoints, after the full-recompute heuristic admitted #913's long group and OOMed (follow-up to #914). H200 calibration puts 27B estimates 10–13% above measured peaks; the long TP8 pair now fits. Review. Shannon reviewed and recommended merging at Deferred / follow-ups.
|
Selective and no-recompute execution retain decoder activations across layers, so the previous full-recompute heuristic admitted #913's long group and then OOMed. This follow-up to #914 replaces the selective refusal with a retained-activation floor that accounts for TP/SP, the actual attention/GDN layer mix, native MLP fusion, replicated QKV, prefix-segment states, and effective MLP/MoE checkpoints. Profiles can only raise the floor.
Native H200 calibration now puts the 27B estimate about 10–13% above measured peaks for the paired 2k-and-larger workloads. The previous TP4 estimate was about 60% high. Values are incremental allocated GiB; observed peaks are maxima across ranks and repetitions.
The previously unmeasured long TP8 case now completes forward and backward. TP4 still refuses the original long pair. Additional runs cover 4B/9B models, unfused eager/compiled execution, short batches with eight sequences, and MoE routing concentrated on one expert rank. MoE dispatch retains an imbalance allowance; the report documents its remaining conservatism and a native TE crash when expert peers are completely empty.
Calibration report · CSV with source/driver hashes, peaks, and negative controls
Validation: 45 final GPU cells, 360 measured rank-samples and 4 refused rank-samples. Every measured forward is covered, every backward completes, and all measured losses/gradients are finite. Local TrainerRank tests: 631 passed, 2 skipped. Ruff and type checking pass. Full-recompute and no-grad behavior retain their previous estimates; the report explicitly limits the calibration's scope.
CI is green on
b86ad4bdd: quality checks (783 Megatron tests and 1,553 unit tests passed) and native GPU validation. Calibration clusters and the CI cluster were terminated successfully.Behavior with recompute disabled
The retained-activation floor also applies when
recompute_granularity=None, including thenoneoverride and EP-overlap MoE trainers. Requests that previously fit the smaller heuristic may now be split or, for indivisible groups, refused. The MoE allowance protects uneven expert routing and can be roughly 3× the measured balanced-routing peak. Full recompute (the production default, including Caladan) and no-grad estimates are unchanged.Context parallelism is not discounted in this version, so selective recompute on the default multi-GPU dense CP topology may be overestimated. CP scaling and GPU calibration are being addressed in a follow-up.