[PR #1189] [CLOSED] [NvlinkTransport] Fix HIP Shareable POSIX File Descriptor Handles #2062

Closed
opened 2026-10-29 21:32:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1189
Author: @amd-arozanov
Created: 12/9/2025
Status: ❌ Closed

Base: main ← Head: posix_fd2


📝 Commits (5)

  • 4628e81 [NvlinkTransport] Fix HIP shareable handles implementation
  • 547b409 [NvlinkTransport] Fix hipMemGetAddressRange segmentation fault
  • 13d58f3 Fix ROCm 6.x compatibility: remove requestedHandleTypes usage
  • be2dbcb [NvlinkTransport] Set proper device context for each transfer
  • 18807f1 [NvlinkTransport] Cleanup

📊 Changes

3 files changed (+156 additions, -3 deletions)

View changed files

📝 mooncake-transfer-engine/include/gpu_vendor/hip.h (+5 -1)
📝 mooncake-transfer-engine/nvlink-allocator/nvlink_allocator.cpp (+7 -1)
📝 mooncake-transfer-engine/src/transport/nvlink_transport/nvlink_transport.cpp (+144 -1)

📄 Description

Description

(AI Assist)

This PR is focusing on fixes for proper POSIX file descriptor-based shareable handle implementation.

Changes:

Implement proper shareable handle support for HIP

  • Added open_fd() function that uses pidfd_open and pidfd_getfd syscalls to correctly open POSIX file descriptors from CUmemFabricHandle in remote processes

Fix hipMemGetAddressRange segmentation fault

  • Fixed segfault caused by passing NULL to hipMemGetAddressRange, which unlike CUDA's version doesn't support NULL arguments

Fix ROCm 6.x compatibility

  • Use requestedHandleType field instead of requestedHandleTypes to support ROCm 6.x
  • requestedHandleTypes support was added in ROCm 7.0

Add proper device context management

  • Extracted device ID from request.source to set correct device context for each transfer operation
  • Ensures memory operations execute on the appropriate GPU device

Type of Change

  • Types
    • Bug fix
    • New feature
      • Transfer Engine
      • Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

Ran transfer_engine_bench and transfer_engine_validator on nodes with AMG GPU

Checklist

  • I have performed a self-review of my own code.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1189 **Author:** [@amd-arozanov](https://github.com/amd-arozanov) **Created:** 12/9/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `posix_fd2` --- ### 📝 Commits (5) - [`4628e81`](https://github.com/kvcache-ai/Mooncake/commit/4628e81cd132bc5c5d698c9e2ec7b0bd64f1c0db) [NvlinkTransport] Fix HIP shareable handles implementation - [`547b409`](https://github.com/kvcache-ai/Mooncake/commit/547b40963dab8df16dfbf83b30b38877ed2abc48) [NvlinkTransport] Fix hipMemGetAddressRange segmentation fault - [`13d58f3`](https://github.com/kvcache-ai/Mooncake/commit/13d58f38c474c8123bd63dc92101a06a412e73a5) Fix ROCm 6.x compatibility: remove requestedHandleTypes usage - [`be2dbcb`](https://github.com/kvcache-ai/Mooncake/commit/be2dbcb7e45064033df448600c06117762ba0422) [NvlinkTransport] Set proper device context for each transfer - [`18807f1`](https://github.com/kvcache-ai/Mooncake/commit/18807f1f5855ed56eea31cfd4867d2d758971aa2) [NvlinkTransport] Cleanup ### 📊 Changes **3 files changed** (+156 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `mooncake-transfer-engine/include/gpu_vendor/hip.h` (+5 -1) 📝 `mooncake-transfer-engine/nvlink-allocator/nvlink_allocator.cpp` (+7 -1) 📝 `mooncake-transfer-engine/src/transport/nvlink_transport/nvlink_transport.cpp` (+144 -1) </details> ### 📄 Description ## Description (AI Assist) This PR is focusing on fixes for proper POSIX file descriptor-based shareable handle implementation. ### Changes: #### Implement proper shareable handle support for HIP - Added `open_fd()` function that uses `pidfd_open` and `pidfd_getfd` syscalls to correctly open POSIX file descriptors from `CUmemFabricHandle` in remote processes #### Fix `hipMemGetAddressRange` segmentation fault - Fixed segfault caused by passing NULL to `hipMemGetAddressRange`, which unlike CUDA's version doesn't support NULL arguments #### Fix ROCm 6.x compatibility - Use `requestedHandleType` field instead of `requestedHandleTypes` to support ROCm 6.x - `requestedHandleTypes` support was added in ROCm 7.0 #### Add proper device context management - Extracted device ID from `request.source` to set correct device context for each transfer operation - Ensures memory operations execute on the appropriate GPU device ## Type of Change * Types - [x] Bug fix - [ ] New feature - [x] Transfer Engine - [ ] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? Ran transfer_engine_bench and transfer_engine_validator on nodes with AMG GPU ## Checklist - [x] I have performed a self-review of my own code. - [x] I have updated the documentation. - [x] I have added tests to prove my changes are effective. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:32:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2062
No description provided.