mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4596] [Bug]: TENT MnnvlTransport passes &fd to cuMemImportFromShareableHandle, POSIX-FD mode never imports #1173
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#1173
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 @SongOf on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4596
Bug Report
Version: origin/main
b198a191Environment: TENT MNNVL transport with
transports/nvlink/handle_type=posix_fd. Observed on 2× NVIDIA L20, driver 580.126.09, CUDA 12.8, Ubuntu 22.04; not hardware specific.Description
MnnvlTransport::relocateSharedMemoryAddressimports a peer buffer in POSIX-FD mode withgithub.com/kvcache-ai/Mooncake@b198a191/mooncake-transfer-engine/tent/src/transport/mnnvl/mnnvl_transport.cpp (L818)For
CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,cuMemImportFromShareableHandleexpectsosHandleto be the fd value itself cast tovoid *(the export side,cuMemExportToShareableHandle, is the one that takes a pointer to anint). Passing&local_fdmakes the driver treat a stack address as the fd and fail withCUDA_ERROR_UNKNOWN(999).CHECK_CUreturns an error status andsubmitTransferTasksthen hitsLOG(FATAL), aborting the process.Consequence: MNNVL in POSIX-FD mode cannot import any peer buffer. The export side (line 562) and
importFdFromProcess(pidfd_getfd) both work, so the fd arrives in the consumer correctly; only the final driver call is wrong. The Fabric path is unaffected.git blamepoints ate8db9e54(2025-12-22, initial TENT import), so the FD path has been broken since it landed. There is no FD-mode test in the tree, which is why it was never caught.Steps to reproduce
MC_ENABLE_MNNVL=1,handle_type=posix_fd, TCP/RDMA disabled.allocateLocalMemory+registerLocalMemory; C opens the segment and submits a READ.(void *)(uintptr_t)local_fdthe READ completes with the right data. A standalone CUDA program shows the same:&fd→ 999,(void *)(uintptr_t)fd→ success.Found while reproducing #4592 (the repro program there needs this fix to reach the mapping-cache bug).
Proposed fix
Pass
(void *)(uintptr_t)local_fd, and add a GPU test that imports a POSIX-FD handle exported by a forked child. PR to follow.Before submitting...
@SongOf commented on GitHub (Oct 12, 2026):
Closing: this is small enough to go straight to a PR. Fix and regression test are in #4597; context is in the reproduction report on #4592.
@github-actions[bot] commented on GitHub (Oct 12, 2026):
Thanks for opening this issue, @SongOf!
46475785A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide