nemo_rl.data_plane.mooncake_storage_unit#
CPU storage-unit placement, and the actors that own Mooncake memory.
Storage units hold all data-plane memory so no compute process does. Both
backends place them the same way: storage_unit_placement names the
clusters whose nodes host them, and :func:plan_storage_unit_nodes turns
that into one Ray node ID per unit, round-robin over those nodes.
mooncake_cpuwithstorage_unit_segment_size > 0: every other process (trainers, generation, controller) is a client that owns nothing, so a checkpoint save calls only these :class:MooncakeStorageUnitactors.simplewithstorage_unit_placementset: TQ’s own SimpleStorageUnits are pinned to the planned nodes instead of TQ’s SPREAD placement group.
Module Contents#
Classes#
Own a Mooncake segment; serve checkpoint and teardown commands. |
Functions#
The clusters |
|
Ray node ID per storage unit, round-robin over the clusters’ nodes. |
|
One Ray node ID per storage unit, or None when storage units are off. |
|
Start one MooncakeStorageUnit per entry of |
|
Counterpart of :func: |
Data#
API#
- nemo_rl.data_plane.mooncake_storage_unit.logger#
‘getLogger(…)’
- nemo_rl.data_plane.mooncake_storage_unit._UNIT_STARTUP_TIMEOUT_S#
600
- nemo_rl.data_plane.mooncake_storage_unit._UNIT_CLOSE_TIMEOUT_S#
60.0
- class nemo_rl.data_plane.mooncake_storage_unit.MooncakeStorageUnit(dp_config: nemo_rl.data_plane.DataPlaneConfig)#
Own a Mooncake segment; serve checkpoint and teardown commands.
Initialization
- close() None#
End-of-run teardown; see :func:
stop_storage_units.
- mooncake_checkpoint(
- body: dict[str, Any],
Run an owner-local checkpoint command; return metadata, never payloads.
- nemo_rl.data_plane.mooncake_storage_unit.select_clusters(
- placement: collections.abc.Sequence[str] | Literal[all],
- clusters_by_name: collections.abc.Mapping[str, nemo_rl.distributed.virtual_cluster.RayVirtualCluster],
The clusters
storage_unit_placementnames ("all": every one).Names are the keys of
clusters_by_name(train,inference,teacher:<name>). A colocated run registers one cluster under two names, so excluding one of them excludes nothing; that is logged.
- nemo_rl.data_plane.mooncake_storage_unit.storage_node_ids(
- clusters: collections.abc.Sequence[nemo_rl.distributed.virtual_cluster.RayVirtualCluster],
- count: int | None,
Ray node ID per storage unit, round-robin over the clusters’ nodes.
countNone means 2 per selected node.
- nemo_rl.data_plane.mooncake_storage_unit.plan_storage_unit_nodes(
- dp_config: nemo_rl.data_plane.DataPlaneConfig,
- clusters_by_name: collections.abc.Mapping[str, nemo_rl.distributed.virtual_cluster.RayVirtualCluster],
One Ray node ID per storage unit, or None when storage units are off.
- nemo_rl.data_plane.mooncake_storage_unit.start_storage_units(
- dp_config: nemo_rl.data_plane.DataPlaneConfig,
- node_ids: list[str] | None,
Start one MooncakeStorageUnit per entry of
node_ids.Returns
()for any other backend or whennode_idsis None.
- async nemo_rl.data_plane.mooncake_storage_unit.stop_storage_units(
- units: collections.abc.Sequence[Any],
Counterpart of :func:
start_storage_units: run every unit’s teardown.Ray stops the units with SIGTERM, and Mooncake’s SIGTERM handler exits without running Python exit hooks, so a unit cleans up only when asked. Bounded and never raises: teardown must not hang or mask the run’s own outcome (a unit still busy with a checkpoint command is skipped).