Efficiency depends on active parameters, sequence length, vocabulary size, device kernels, loss implementation, and communication topology. Profile the realized run instead of relying on a model-size label.
- Use BF16 on supported devices with
--bf16. - Enable activation checkpointing with
--grad-ckptwhen memory-bound. - Bound tied-head loss memory with
--loss-chunk-tokens. - Keep the SFT loss in FP32 with
--sft-fp32-losswhen stability matters. - Use
--use-custom-kernels autoon tested NVIDIA CUDA environments. - Use DDP when one complete model fits on every device.
- Measure the full eval and checkpoint boundary separately from steady-state training throughput.
Two-dimensional weighting does not alter row count or forward-pass cost. Every
example is still consumed. It changes per-example loss coefficients and
normalizes by visible weighted-token mass. Extremely sparse task targets can
increase gradient variance, so production curricula enforce
max_task_loss_weight and fail before training when the cap is exceeded.
See Two-dimensional full-shard SFT weighting.
scripts/run_sft_curriculum.py --world-size 8 launches eight processes through
torch.distributed.run. Batch size is per rank. The loader shards one shuffled
full-shard stream deterministically across ranks and computes the exact
complete-pass boundary.
TP/PP/DP files under configs/run_configs/ are planning contracts validated by
cf-plan-cluster; they need an external launcher.
The portable path uses PyTorch/autograd. NVIDIA CUDA can select custom
Triton/CUDA paths when shape, dtype, and capability checks pass. ROCm remains
on the conservative fallback under auto unless explicitly opted in. Never
infer the selected backend from the requested flag; record the runtime backend
metadata and TRHashEngineMLP.engine.last_backend.
Record:
- framework and runtime commits;
- device model and count;
- selected kernel path;
- total and trainable parameter counts;
- vocabulary, sequence length, and batch per rank;
- precision and loss precision;
- gradient checkpointing;
- loss chunk size;
- telemetry and compilation state;
- warm-up exclusion and synchronization boundaries;
- whether evaluation or checkpoint I/O is included.
Do not compare training throughput that includes a complete held-out evaluation against a steady-state interval that excludes it.