Skip to content

perf(data_plane): nixl SSD offloading: io_threads + ack a spilled put - #5150

Merged
ZhiyuLi-Nvidia merged 8 commits into
mainfrom
zhiyul/feat/nixl-ssd-io-threads
Nov 20, 2026
Merged

ZhiyuLi-Nvidia merged 8 commits into
mainfrom
zhiyul/feat/nixl-ssd-io-threads

Conversation

@ZhiyuLi-Nvidia

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

nixl SSD offloading optimization, in two commits on the nixl storage unit's SSD tier. Both were measured on GB300, 4 nodes, synthetic single-controller-shaped data plane: 150 GB put + 300 GB read per node per step, 75 GiB slab per unit (about half the data spilled), observability + tensor-hash verification on, step 2 of 3.

put GB/s lp read train read put p50 / mean / max hash
before (1 IO thread, ack on disk) 19.2 38.0 40.2 65 ms / 216 ms / 5.2 s 0 / 16,384
1. io_threads 4 29.2 53.1 57.4 46 ms / 130 ms / 0.6 s 0 / 16,384
2. + ack at IO area 56.2 49.6 46.6 25 ms / 38 ms / 0.3 s 0 / 16,384
no spill at all (200 GiB slab) 51.6 40.5 38.4 28 ms / 44 ms / 0.3 s 0 / 16,384

0 bad rows, 0 spill failures, 0 Busy replies in every run.

1. data_plane.nixl.ssd.io_threads (default 4)

The number of file-I/O worker threads in each unit's SSD tier. Before, every unit had exactly one, and a workload that spills a large share of each step waited on that thread for both its puts and its cold reads. One thread moved about 2.5 GB/s per node.

Safe because each IO job owns its IO-area region until it ends, and the unit lock _mu is not held during file I/O, so jobs on different threads never share a region. The design comment in nixl_storage_unit.py is updated; the one-thread property it protected (a hung disk stalls spills and cold reads, never the put area) holds for a pool too. 8 and 32 threads measured the same as 4 (28.4 / 28.7 GB/s put): the next limiter was the ack.

2. A spilled put is acknowledged once its bytes are in the IO area

Before, commit of a spilled blob answered "pending" until its file was on disk, and the blob was invisible to readers until then. Under memory pressure every producer waited on NVMe.

  • commit: a spill whose WRITE is done is published at once; the file write is queued, or marked due when every IO job slot is taken (the 1 s ticker queues it later).
  • resolve: a published blob with an IO-area copy is readable whether its file exists yet or not. Only a stage in progress (file to RAM) answers "pending".
  • _spill: on success the IO region stays as a staged copy of the newest data (picked_up, evicted as soon as the area needs the room). On failure the copy is kept, never evicted while rec.disk is None, and the ticker retries after SPILL_RETRY_S (5 s). New stat: spill_retries.
  • save_shard: a published spill not on disk yet is copied from its IO copy (held, so it cannot be freed under the copy).

Durability is unchanged: a put-area blob is lost if the unit dies and nothing waits for it; a blob in the IO area after its WRITE has the same exposure. Design doc updated (docs/design-docs/nixl-data-plane.md).

Tests

  • Unit (nightly-gym.2026-11-05 image): nixl/test_ssd_tier.py + test_tq_nixl_ssd.py + test_tq_nixl_checkpoint.py + test_backend_config.py: 81 passed; test_backend_config.py + test_config_v2.py (reference yaml): 52 passed. The SSD-tier tests follow the new contract: commit done at once and readable while the file is written; a failed write keeps the only copy and the ticker retries; a due spill is queued by the ticker; checkpoint copies a published spill from its IO copy; staged-copy eviction with the put's own copy present; io_threads default, override and 0 refused.
  • Real single-controller recipe on GB300, 2 nodes, nixl, 64 MiB slab (forced spills): 3 steps, exit 0, 68–70 spills per unit, 0 failures, step-3 data-plane shards written.

Stack: PR 1 of 3, on top of #5145 (RDMA rail selection + UCX_MODULES=^fuse, so nixl runs without NCCL_NET_PLUGIN=none). Review the last six commits (8d34252e2, 5fd7dda36, bea01f934, a6292cdce, 352a48f41, 8f8496f08) only. 8f8496f08 is the review fix: _evict_staged leaves a copy that save_shard holds in place (a hold stopped only the release before), with a test. #5151 (SSD offload on by default) is based on this branch. Supersedes #5108 and #5152.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Nov 10, 2026
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title feat(data_plane): nixl ssd.io_threads, several file-I/O workers per unit perf(data_plane): nixl SSD offloading: io_threads and ack a spilled put at the IO area Nov 10, 2026
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 10, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 10, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title perf(data_plane): nixl SSD offloading: io_threads and ack a spilled put at the IO area perf(data_plane): nixl SSD offloading: io_threads + ack a spilled put at the IO area Nov 10, 2026
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title perf(data_plane): nixl SSD offloading: io_threads + ack a spilled put at the IO area perf(data_plane): nixl SSD offloading: io_threads + ack a spilled put Nov 10, 2026
Comment thread nemo_rl/data_plane/nixl_storage_unit.py Resolved
Comment thread nemo_rl/data_plane/interfaces.py Resolved
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from 053b3fc to fb29b22 Compare November 14, 2026 05:26
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 14, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 16, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from b22572e to 8f8496f Compare November 16, 2026 22:51
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 16, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase on main first: GitHub reports merge conflicts.

Thanks for this. Both speedups are measured on GB300 with hash checks, which makes them easy to trust. Keeping a held IO copy out of eviction during a checkpoint is fixed well in 8f8496f, with a test.

  1. (C1) Correctness bug: when the disk stays broken, acked spills fill the IO area, and the unit answers Busy until each put's deadline instead of failing at once. Please fix in this PR.
  2. (C2) No unit answers commit with "pending" any more, so the client's pending loop, its test and two comments are dead code.
  3. (C3) The ticker test calls _submit_due_spills by hand, so nothing tests that the ticker calls it.
  4. (C4) The test module docstring and its _commit helper still describe a pending commit.

Generated by Claude Code

Comment thread nemo_rl/data_plane/nixl_storage_unit.py Resolved
Comment thread nemo_rl/data_plane/nixl/blobstore.py Resolved
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from 8f8496f to 21a2388 Compare November 17, 2026 22:51
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 17, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from 21a2388 to 4ed498c Compare November 17, 2026 23:26
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 17, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 18, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 86690e4

Comment thread nemo_rl/data_plane/nixl_storage_unit.py Resolved
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 18, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 3ffcfb2

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia added the CI:L1 Run doctests, unit tests, and functional tests label Nov 18, 2026

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One follow-up on the C1 fix; C1–C5 are fixed, thanks.

  1. (C6) _spill_error outlives the failed spill that set it, so a healthy unit can fail cold reads. Please fix in this PR.

Generated by Claude Code

Comment thread nemo_rl/data_plane/nixl_storage_unit.py Resolved
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from 3ffcfb2 to d68d015 Compare November 18, 2026 08:54
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test d68d015

@terrykong
terrykong enabled stacked auto-merge (squash) November 18, 2026 09:15
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 18, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 19, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from d68d015 to 5694406 Compare November 19, 2026 06:26
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 19, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 93434f2

@copy-pr-bot

copy-pr-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

/ok to test 93434f2

@ZhiyuLi-Nvidia, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 5694406

stacked auto-merge was automatically disabled November 19, 2026 07:54

Replaced by a newer auto-merge request

@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia enabled stacked auto-merge (squash) November 19, 2026 07:54
ZhiyuLi-Nvidia and others added 8 commits November 19, 2026 20:02
A nixl storage unit ran every SSD spill write and every cold read on ONE
worker thread, with plain blocking file I/O. A spilled put is acknowledged
only once its file is on disk, so under memory pressure the whole step
waited on that thread: on GB300 (4 nodes, 150 GB put + 300 GB read per
node per step, 75 GiB slab, half of the data spilled) one thread moved
about 2.5 GB/s per node and the put tail reached 5.2 s.

Add data_plane.nixl.ssd.io_threads (default 4): the size of the unit's
IO worker pool. Each IO job owns its IO-area region until it ends and the
unit lock is not held during file I/O, so the jobs are independent.

Measured on the same workload, step 2 of 3:

  io_threads   put GB/s   lp read   train read   put p50 / mean / max
  1 (before)   19.2       38.0      40.2         65 ms / 216 ms / 5.2 s
  4            29.2       53.1      57.4         46 ms / 130 ms / 0.6 s

0 hash mismatches, 0 bad rows, 0 spill failures in both runs.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…fore uncounting an IO job

Review follow-up for the nixl ssd.io_threads knob:

- The default (4) lives in NixlSsdConfig alone. The unit takes the
  configured value; its own fallback is 1 and only test helpers use it.
- One range check, PositiveInt at the config boundary; the executor
  refuses 0 itself.
- A spill job that fails or was aborted closed its file after it had
  already decremented _io_jobs, so "no IO job running" could be observed
  with the fd still open. The job now counts as running until its file is
  closed, which is the ownership rule the design comment states. Seen as
  an fd-count mismatch (111 != 112) in test_abort_during_the_write_leaves_
  the_cleanup_to_the_job once the pool had more than one thread.
- The unit comment states the invariant; the measurement stays in the
  config docstring.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
Same ownership rule as the spill job: an IO job counts as running until
its file is closed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…n the IO area

A put the unit's RAM could not take was acknowledged only after its file
was on disk: commit answered "pending" while an IO worker wrote the file,
and the blob was invisible to readers until then. Under memory pressure
every producer therefore waited on NVMe. On GB300 (4 nodes, 150 GB put +
300 GB read per node per step, 75 GiB slab, half of the data spilled)
the put ran at 28-29 GB/s against 52 GB/s with nothing spilled, and more
IO threads did not move it.

Now commit publishes a spilled blob at once: its bytes are complete in
the unit's IO area after the RDMA WRITE, the same guarantee a put-area
blob has (both live in the unit's memory and die with it). The file write
runs behind the ack on the IO threads. Readers read the IO-area copy
meanwhile, and it stays after the write as a staged copy (picked up, so
it goes as soon as the area needs the room). A write that fails keeps
that copy, which is then the only one: it is never evicted, and the
ticker retries the write every SPILL_RETRY_S (5 s). A commit that finds
every IO job slot taken marks the spill due and the ticker queues it.

save_shard copies a published spill whose file is not written yet from
its IO copy, which its hold keeps alive; a blob released during the save
still raises, as before.

Measured on the same workload, step 2 of 3, 4 IO threads:

                 put GB/s   put p50 / mean / max    lp read   train read
  before         29.2       46 ms / 130 ms / 0.6 s  53.1      57.4
  after          56.2       25 ms /  38 ms / 0.3 s  49.6      46.6
  no spill       51.6       28 ms /  44 ms / 0.3 s  40.5      38.4

0 hash mismatches (16,384 rows checked per step), 0 bad rows, 0 spill
failures, 0 Busy replies. Real single-controller recipe with a 64 MiB
slab (forced spills): 3 steps, exit 0, data-plane checkpoint written.

Tests: the SSD-tier tests follow the new contract (commit done at once,
readable while the file is written, failed write kept and retried, due
spill queued by the ticker, checkpoint from the IO copy, staged-copy
eviction); _put waits for a spill's file, _disk_only drops a copy.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…eckpoint

save_shard holds a spilled blob's IO-area copy while it copies it, but a
hold only stopped the release path: _evict_staged checked pins alone, so a
spill whose file write ended during the copy became an evictable staged
copy and a new spill or stage could reuse the region under the checkpoint.
_evict_staged now skips a held copy. Test added. The NixlSsdConfig docstring
no longer says a spilled put is acknowledged only once its file is written.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…rop the dead pending-commit path

Review follow-ups on the ack-at-IO-area change:

- A spill whose file write failed keeps its IO copy (the only copy) and is
  never evicted. When the disk stays broken those copies fill the IO area,
  and the unit answered Busy to every put until its deadline and
  "pending" to every cold read. The unit now records the last spill-write
  error (cleared by the next successful write); while it is set, an
  IO-area allocation that finds no room raises UnitFull naming the error,
  and a cold read that finds no room is reported under "failed", so the
  client fails at once instead of waiting out its deadline. Test added.
- No unit answers commit with "pending" any more: the client's pending
  loop, its test and two stale comments are removed.
- The ticker test waits for the unit's own ticker instead of calling
  _submit_due_spills by hand.
- The SSD-tier test module docstring and the _commit helper described a
  commit that waits for the file; the docstring is updated and the helper
  replaced by a direct u.commit.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…ytes, not the last error

_spill_error outlived the failed spill that set it: if that blob was released
before its retry, a healthy unit still answered UnitFull / failed instead of
Busy / pending. Track the IO bytes held by live spills whose write failed
(_failed_spill_bytes) and gate _alloc_io and resolve on that. It drops when the
blob's retry succeeds or the blob is released.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/feat/nixl-ssd-io-threads branch from 5694406 to 63d07ea Compare November 20, 2026 04:05
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 20, 2026
`mooncake_cpu.ssd_offload.path` and `nixl.ssd.path` default to null, which
resolves on the node that creates the directory (local_disk.default_ssd_dir):
/raid/<name> when /raid is in /proc/mounts, not RAM-backed and writable by
the process (DGX nodes mount the NVMe RAID at /raid), else /tmp/<name>. The
tmpfs check still runs on the result. An explicit path must be absolute, as
before; the "enabled requires a path" rule is gone since null is a path now.

Two facts from the GB300 experiment shaped the rule. os.path.ismount("/raid")
is False inside an enroot container, because the container root itself lives
under /raid (same device as /), so the check reads /proc/mounts. A stock
/raid is root-owned (drwxr-xr-x): the first version resolved to it and the
owners died with PermissionError, so the directory must be writable, and the
default falls back to /tmp otherwise.

Verified with the real single-controller recipe (2 nodes, forced spills,
path null): /raid root-owned -> PermissionError before the writability rule;
/raid writable (a writable NVMe dir bind-mounted at /raid) -> nixl exit 0,
67 blobs spilled, directory gone at shutdown; mooncake exit 0, 6 owners under
/raid/nrl_mooncake_ssd_offload, 1027-2447 objects offloaded per owner
(17,416 files / 190 MB on the host NVMe mid-run), directories gone at exit.
Control without /raid: exit 0 under /tmp. Unit: 350 passed (two failures are
the open-file-count race fixed in #5150's last commit).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 63d07ea

@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia merged commit af74ec8 into main Nov 20, 2026
170 of 172 checks passed
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia deleted the zhiyul/feat/nixl-ssd-io-threads branch November 20, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants