kempnerforge.training.runtime¶
Process-level context for a training job: ranks, device, mesh, pipeline.
Functions
|
Run fp32 matmuls on TF32 tensor cores when |
|
The PP process group for this rank, derived on demand. |
|
Validate the config for the world size, then initialize the process group + device mesh. |
Classes
Pipeline-parallel state. |
|
Where this process sits: ranks, device, and the mesh built for them. |
- class kempnerforge.training.runtime.RuntimeContext[source]¶
Bases:
objectWhere this process sits: ranks, device, and the mesh built for them.
- device: torch.device¶
- __init__(rank, local_rank, world_size, device, device_mesh)¶
- Parameters:
rank (int)
local_rank (int)
world_size (int)
device (torch.device)
device_mesh (DeviceMesh | None)
- Return type:
None
- class kempnerforge.training.runtime.PipelineBundle[source]¶
Bases:
objectPipeline-parallel state. Built only when
distributed.pp > 1.The PP process group is not held here: it is derived from the mesh at the call sites that need it, so a job that never runs a step never slices it.
- kempnerforge.training.runtime.pp_group(runtime)[source]¶
The PP process group for this rank, derived on demand.
- Parameters:
runtime (RuntimeContext)
- Return type:
- kempnerforge.training.runtime.apply_matmul_precision(train)[source]¶
Run fp32 matmuls on TF32 tensor cores when
train.tf32is set; otherwise do nothing.- Parameters:
train (TrainConfig)
- Return type:
None