mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #683] [MERGED] bugfix(nvlink): Add explicit P2P access enablement and error handling for NvlinkTransport #1740
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#1740
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/683
Author: @staryxchen
Created: 7/28/2025
Status: ✅ Merged
Merged: 8/1/2025
Merged by: @alogfans
Base:
main← Head:bugfix/nvlink📝 Commits (4)
2680738refactor(nvlink_transport): cache device count to avoid repeated queries8919309bugfix(nvlink): add explicit P2P access enablement and error handling2b065b3Added checkCudaErrorReturn function and updated enableP2PAccess to properly handle CUDA errors by returning false on failure.2cf9dfdupdate something according to comment📊 Changes
1 file changed (+97 additions, -9 deletions)
View changed files
📝
mooncake-transfer-engine/src/transport/nvlink_transport/nvlink_transport.cpp(+97 -9)📄 Description
Summary
This PR adds explicit peer-to-peer (P2P) access enablement and improved error handling to the NvlinkTransport class. The changes ensure that bidirectional P2P access is properly established between all GPU device pairs during transport initialization.
Changes
Added
checkCudaError()helper function for consistent CUDA error handlingenableP2PAccess()function to explicitly enable bidirectional P2P access between device pairsModified
getNumDevices()now uses the newcheckCudaError()helper for consistent error handlingNvlinkTransportconstructor now iterates through all device pairs and enables P2P accessTechnical Details
The implementation follows NVIDIA's recommended practices for P2P access:
cudaDeviceCanAccessPeer()to check if devices support P2P accessReferences
Impact
This fix resolves potential issues where P2P access might not be properly established, leading to runtime errors during GPU-to-GPU transfers. The explicit enablement ensures reliable P2P communication in multi-GPU environments.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.