Repository navigation
feat(capture): NVLink publication in the v0.5.18 capture sink - #938
Open
maocheng23 wants to merge 4 commits into
Open
maocheng23 wants to merge 4 commits into
maocheng23 wants to merge 4 commits into
Conversation
With MOONCAKE_PROTOCOL=nvlink the sink keeps capture objects in one fabric-memory arena that the Mooncake TransferEngine allocates on the writer GPU: the NVLink transport can only export such memory, and the Mooncake store cannot place objects there. Responses carry each object's device address plus the TransferEngine session and a control endpoint, where POST /free is the counterpart of the store's remove. Capture hooks are unchanged; NVLink always selects device publication. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 6, 2026
Serving frees from an HTTP thread competed with the SGLang scheduler for the GIL: each request took tens of milliseconds under load. Clients now write JSON key lists to a TCP control connection, and the writer thread, the only thread that touches the arena, drains them before it allocates. The arena needs no locks and the HTTP server is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The arena reused MOONCAKE_GLOBAL_SEGMENT_SIZE, whose 32 GiB default was chosen for the store's host-memory segment; with NVLink it is HBM on the writer GPU. SGLANG_SPEC_CAPTURE_NVLINK_ARENA_BYTES now sets it and is required, so the arena never silently takes GPU memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sport NvlinkArena becomes CaptureArena, the result field "nvlink" becomes "arena" and SGLANG_SPEC_CAPTURE_NVLINK_ARENA_BYTES becomes SGLANG_SPEC_CAPTURE_ARENA_BYTES. Where a sample waits (store or arena) is independent of how its bytes move; currently only online NVLink capture uses the arena, decided in one place (arena_enabled), so an arena over another transport can be added without renaming again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 1 of 2 (server side). Part 2: #939.
Why
On GB200/GB300 NVL72 the capture servers and trainers sit in one NVLink domain, but online capture still moves hidden states through host memory or the NICs. Mooncake's NVLink (MNNVL) transport can only export memory allocated with a fabric handle, and the Mooncake store cannot place objects in such memory, so the store path cannot use it.
Changes
MOONCAKE_PROTOCOL=nvlinkswitches the v0.5.18 sink from the store to aCaptureArena, memory the capture server owns. The arena is named by placement (where samples wait) rather than transport; currently only online NVLink capture uses it, decided in one place (arena_enabled()).SGLANG_SPEC_CAPTURE_ARENA_BYTES. It's a separate variable from the store'sMOONCAKE_GLOBAL_SEGMENT_SIZE, whose 32 GiB default was chosen for host memory, so GPU memory is never taken silently.{store_id}/{sample_id}/g{gen}/{name}), one object per tensor. Each result adds"arena": {"session", "control"}, and every feature gains an"address".remove. Clients write a JSON list of keys, one per line, to thecontrolTCP endpoint (portSGLANG_SPEC_CAPTURE_CONTROL_PORT, ephemeral by default).SGLANG_SPEC_CAPTURE_GPU_PUT=0is rejected.Not included: the Kimi K3 patch and the SGLang plugin port (
maocheng/sglang-capture-plugin) still need the same sink change.Tests
sglang-v0.5.18-cu130-arm64, Mooncake 0.3.13.post1): the sink tests pass, including the CUDA ones (publishing into the arena through a fake engine).MooncakeFeatureStorefrom part 2 read every byte back correctly (3.5 ms per ~100 MB sample on average), then freed them, and the arena returned to fully free.🤖 Generated with Claude Code