Repository navigation
feat(mooncake): read server captures over multi-node NVLink - #939
Merged
jiapingW merged 5 commits intoOct 18, 2026
Merged
Conversation
This was referenced Oct 6, 2026
maocheng23
force-pushed
the
maocheng/nvlink-capture-client
branch
2 times, most recently
from
October 6, 2026 20:09
551f5e4 to
ea7a48c
Compare
MOONCAKE_PROTOCOL=nvlink (managed_local.mooncake.protocol or deployment.disaggregated.mooncake_protocol) reads capture objects straight from the server GPU into receive_buffers=cuda. NvlinkObjectClient implements the Mooncake store calls MooncakeFeatureStore makes, so generations, leases and removal retries are unchanged; objects are located from the addresses the sink returns on each SampleRef and freed through its control endpoint. The launch plan sets MC_FORCE_MNNVL so Mooncake picks NVLink over the RDMA NICs, and external NVLink deployments need no Mooncake store endpoints. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first version freed each object with an HTTP request that a Python thread inside the busy SGLang scheduler process served. GIL handoffs made each request take tens of milliseconds, so on GB300 the durable ack took 0.16-0.29 s per step and blocked the training thread. remove() now writes the key to a persistent TCP connection and returns; the sink applies frees before it allocates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
managed_local.mooncake.nvlink_arena_bytes sets the HBM each capture server reserves for NVLink capture objects (SGLANG_SPEC_CAPTURE_NVLINK_ARENA_BYTES) and is required with protocol nvlink. Because those objects stay on the servers until the optimizer-boundary ack, runtime.resident_high_watermark_bytes must be set and, for managed-local stacks, fit in the servers' summed arenas; the producer then stops capturing before an arena fills. The trainer side keeps its existing receive_pool_bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
NvlinkObjectClient becomes ArenaObjectClient (runtime/data_plane/ mooncake_arena.py), the ref metadata key becomes "mooncake_arena", the sink's result field becomes "arena" and nvlink_arena_bytes becomes arena_bytes (SGLANG_SPEC_CAPTURE_ARENA_BYTES). Where a sample waits is independent of how its bytes move; currently only online NVLink capture uses the arena, which is noted at each place that decides it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
maocheng23
force-pushed
the
maocheng/nvlink-capture-client
branch
from
October 6, 2026 22:01
ea7a48c to
8ef14f3
Compare
jiapingW
self-requested a review
October 18, 2026 08:30
jiapingW
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-node NVLink capture transport, part 2 of 2 (trainer side). Stacked on #938.
Changes
ArenaObjectClient(new,runtime/data_plane/mooncake_arena.py) implements the Mooncake store calls thatMooncakeFeatureStoremakes, reading from capture-server arenas. Currently only online NVLink capture uses the arena:get_intoreads straight from the server GPU withTransferEngine.transfer_sync_read.removewrites the key to a persistent TCP connection to the sink and returns; the sink applies it before its next allocation, so the durable ack never waits on the capture server. A failed write returns an error, so the feature store retries it as a pending removal. A key that no ref has located (a lost capture response) is freed on every server the client has seen.MooncakeFeatureStorepasses each ref's object addresses to the backend inadoptandget(locate_ref_objects). Everything else is unchanged: generations, leases, release-pending retries and lifecycle drains work as they do with the store.SampleRef.metadata["mooncake_arena"].managed_local.mooncake.protocolacceptsnvlink.managed_local.mooncake.arena_bytes(required withnvlink, rejected otherwise): the HBM each capture server reserves for its arena. The launch plan renders it asSGLANG_SPEC_CAPTURE_ARENA_BYTESon every capture server.runtime.resident_high_watermark_bytesmust be set withnvlink. For managed-local stacks it must also fit in servers ×arena_bytes, so the producer stops capturing before an arena fills.nvlinkrequiresreceive_buffers: cuda, andcapture_servers[].gpu_put: falseis rejected. On the trainer only the existingreceive_pool_bytesapplies.validate_receive_buffersnow serves the schema, the launch plan and the store factory.MC_FORCE_MNNVL=1for capture servers and roles, because Mooncake otherwise prefers the RDMA NICs. External NVLink deployments no longer require Mooncake store endpoints.Notes
arena_bytesbelow--mem-fraction-static. If it doesn't fit, the first capture fails and the error says so.cudaStreamPerThreadbefore every copy. Loader prefetch hides this; work on a side stream does not cause the wait.Tests
MooncakeFeatureStore→ArenaObjectClientstack against a stub server and a fake engine: reads, consume-once frees, frees of lost responses, failed sends staying pending until retried.Losses match TCP. Step 1 is identical in every run (25.3694), and steps 2–4 agree within 0.007. Later steps vary with sample order in any two runs, including between the two TCP runs.
Compute per step is the same for both transports. The difference is overhead, summed over steps 3–16:
At this scale training compute dominates, so the end-to-end gain is modest. The 6× faster fetch matters more as capture throughput grows.
🤖 Generated with Claude Code