kempnerforge.training.runtime¶
Process-level context for a training job: ranks, device, mesh, pipeline.
Functions
|
The PP process group for this rank, derived on demand. |
|
Initialize the process group + device mesh, then validate the config against it. |
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: