mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4980] [Bug][Store]: dummy-client CUDA IPC buffers are opened on the exporter's device *ordinal*, which is wrong whenever the real client and the dummy client see different CUDA_VISIBLE_DEVICES #1263
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#1263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0z5a on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4980
Describe the bug
The dummy client exports a registered GPU buffer with
cudaIpcGetMemHandleand recordsattr.device(its own ordinal,cuda_ipc_buffer.cpp). The real client then doescudaSetDevice(handle.device_id)+cudaIpcOpenMemHandlewith that number (cuda_ipc_buffer.cpp), and the dummy path has no staged fallback (dummy_client.cpp). Device ordinals are per-process: in the common layout where the real client (store service) sees all GPUs and each worker process sees only its own GPU (CUDA_VISIBLE_DEVICES=<i>), every worker reports device 0, so the real client maps every worker's buffer on its own GPU 0.INVALID_PARAMS(-600).TENT's NVLink transport documents exactly this pitfall and deliberately does not switch to the peer's ordinal before
cudaIpcOpenMemHandle(tent/src/transport/nvlink/nvlink_transport.cpp, comment above the IPC open: "that ordinal is the PEER's device index, relative to the peer's CUDA_VISIBLE_DEVICES").To reproduce
2× L40S (PCIe, P2P disabled:
topo -p2p r= NS), nightly wheel0.3.14.dev20261025, TCP protocol,mooncake_master+mooncake_client(real client) withCUDA_VISIBLE_DEVICES=0,1, and a dummy client (MooncakeDistributedStore().setup_dummy(...)) that registers a 1 MiB GPU buffer and doesput_from/get_into:Expected behavior
Do not reuse the exporter's ordinal: either open on the real client's intended device as TENT does, or carry the GPU UUID / PCI bus id in the exported handle and resolve it in the real client's own numbering; fail with a clear message if that GPU is not visible to the real client.
AI assistance disclosure
Found by AI-assisted code reading (Claude) and confirmed on the hardware above.
@github-actions[bot] commented on GitHub (Oct 27, 2026):
Thanks for opening this issue, @0z5a!
192209249A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide