nemo_rl.data_plane.local_disk#

The node-local directory an SSD tier writes to: on NVMe, and a disk.

The three SSD tiers (mooncake_cpu.ssd_offload, nixl.ssd and simple.ssd_offload) default to :func:default_ssd_dir: /raid, where DGX nodes mount their NVMe RAID, when the node has it, else /tmp. On some hosts /tmp is a RAM-backed tmpfs; a tier “spilling” there would consume the memory it is meant to relieve and lose the data with the node. The owner of the directory calls

func:

require_disk_backed once, before it writes, on the node where the directory lives: a default on RAM stops the run, a configured path only warns.

Module Contents#

Functions#

default_ssd_dir

/raid/<name>-<uid> when /raid is a mounted disk this process can write to, else /tmp/<name>-<uid>.

nvme_fallback_reason

Why :func:default_ssd_dir cannot use /raid here; None when it can.

note_ssd_dir_fallback_once

Log once why the SSD tiers default to /tmp and what /tmp is, if so.

filesystem_of

The filesystem type that holds path: its longest mount-point prefix.

_mount_of

(mountpoint, fstype) of the mount that holds path; ("", "") if none.

require_disk_backed

Refuse a RAM-backed path, or only warn when the config named it.

Data#

API#

nemo_rl.data_plane.local_disk.LOGGER#

‘getLogger(…)’

nemo_rl.data_plane.local_disk._RAM_FILESYSTEMS#

‘frozenset(…)’

nemo_rl.data_plane.local_disk.NVME_MOUNT#

‘/raid’

nemo_rl.data_plane.local_disk.FALLBACK_BASE#

‘/tmp’

nemo_rl.data_plane.local_disk.default_ssd_dir(name: str, mounts_text: str | None = None) → str#

/raid/<name>-<uid> when /raid is a mounted disk this process can write to, else /tmp/<name>-<uid>.

Resolve it on the node that creates the directory; the result still goes through :func:require_disk_backed there. mounts_text as in

Func:

filesystem_of.

nemo_rl.data_plane.local_disk.nvme_fallback_reason(mounts_text: str | None = None) → str | None#

Why :func:default_ssd_dir cannot use /raid here; None when it can.

nemo_rl.data_plane.local_disk._noted_fallback#

False

nemo_rl.data_plane.local_disk.note_ssd_dir_fallback_once(log: Any) → None#

Log once why the SSD tiers default to /tmp and what /tmp is, if so.

nemo_rl.data_plane.local_disk.filesystem_of(path: str, mounts_text: str | None = None) → str#

The filesystem type that holds path: its longest mount-point prefix.

path need not exist yet; its nearest existing ancestor is resolved. mounts_text is /proc/mounts (one src mountpoint fstype ... line each); read from the host when omitted. "" when nothing matches.

nemo_rl.data_plane.local_disk._mount_of(
path: str,
mounts_text: str | None = None,
) → tuple[str, str]#

(mountpoint, fstype) of the mount that holds path; ("", "") if none.

nemo_rl.data_plane.local_disk.require_disk_backed(
path: str,
*,
setting: str,
explicit: bool = False,
) → None#

Refuse a RAM-backed path, or only warn when the config named it.

A default that landed on RAM (/tmp as tmpfs) would silently turn the SSD tier into a second copy in memory, so it stops the run. A path the config sets (explicit) is a choice, for example a small test filesystem: it runs, with a warning that says what it costs. setting names the config key in the message.