[PR #1154] [MERGED] Improve AMD HIP support with hipify-perl #2042

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1154
Author: @amd-arozanov
Created: 12/2/2025
Status: ✅ Merged
Merged: 12/5/2025
Merged by: @stmatengss

Base: main ← Head: perl_hipify


📝 Commits (6)

  • 4a381ab Improve AMD HIP support with hipify-perl
  • c36d0a0 [TE] Add HIP support to nvlink-allocator with hipcc compilation
  • 87d78ec Add USE_HIP to the documentation
  • a6d837e [TE/NVLINK] Check CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED only if USE_CUDA
  • 4a6a86a [TE/EXAMPLE] Fix compiler error if USE_MNNVL and USE_HIP
  • c8ff0e2 Address review comments

📊 Changes

20 files changed (+188 additions, -128 deletions)

View changed files

📝 doc/en/build.md (+1 -0)
📝 docs/source/getting_started/build.md (+1 -0)
📝 mooncake-common/common.cmake (+40 -16)
📝 mooncake-p2p-store/build.sh (+4 -0)
📝 mooncake-transfer-engine/example/CMakeLists.txt (+18 -8)
📝 mooncake-transfer-engine/example/transfer_engine_bench.cpp (+4 -4)
📝 mooncake-transfer-engine/example/transfer_engine_bench_with_notify.cpp (+7 -7)
📝 mooncake-transfer-engine/example/transfer_engine_validator.cpp (+4 -5)
📝 mooncake-transfer-engine/include/cuda_alike.h (+1 -0)
📝 mooncake-transfer-engine/include/gpu_vendor/hip.h (+16 -64)
📝 mooncake-transfer-engine/include/transport/nvlink_transport/nvlink_transport.h (+1 -1)
📝 mooncake-transfer-engine/nvlink-allocator/CMakeLists.txt (+19 -1)
📝 mooncake-transfer-engine/nvlink-allocator/build.sh (+25 -3)
📝 mooncake-transfer-engine/nvlink-allocator/nvlink_allocator.cpp (+1 -2)
📝 mooncake-transfer-engine/src/CMakeLists.txt (+6 -2)
📝 mooncake-transfer-engine/src/transport/nvlink_transport/CMakeLists.txt (+10 -0)
📝 mooncake-transfer-engine/src/transport/nvlink_transport/nvlink_transport.cpp (+3 -2)
📝 mooncake-transfer-engine/src/transport/tcp_transport/CMakeLists.txt (+4 -0)
📝 mooncake-transfer-engine/tests/CMakeLists.txt (+22 -12)
📝 mooncake-transfer-engine/tests/nvlink_transport_test.cpp (+1 -1)

📄 Description

Description

(AI Assist)

This PR improves AMD GPU support by migrating to automated CUDA-to-HIP conversion using hipify-perl.

Key Changes:

  1. Automated CUDA-to-HIP conversion with hipify-perl
    • Introduced hipify_files() CMake function that converts CUDA source files to HIP-compatible code at build time
    • Eliminates need to manually maintain separate CUDA/HIP macro definitions
    • Uses official ROCm tool for proper API mapping and compatibility with ROCm updates
    • Limitation: Header files are not automatically converted
  2. HIP support for NVLink transport
  3. HIP support for nvlink-allocator
  4. Compatibility fixes
    • Fixed compilation errors in examples when both USE_MNNVL and USE_HIP are enabled
  5. Documentation updates
    • Added USE_HIP flag to build documentation

Type of Change

  • 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?

  1. Checked build:
    cmake .. -DUSE_HIP=ON -DUSE_MNNVL=ON -DUSE_ETCD=ON -DSTORE_USE_ETCD=ON -DUSE_CXL=ON -DUSE_TCP=ON && make -j$(nproc) && make install

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/1154 **Author:** [@amd-arozanov](https://github.com/amd-arozanov) **Created:** 12/2/2025 **Status:** ✅ Merged **Merged:** 12/5/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `perl_hipify` --- ### 📝 Commits (6) - [`4a381ab`](https://github.com/kvcache-ai/Mooncake/commit/4a381ab40f2755f746b9af2545bc946cff7c247c) Improve AMD HIP support with hipify-perl - [`c36d0a0`](https://github.com/kvcache-ai/Mooncake/commit/c36d0a0865d8da85f5a88f827b2a22c4d4992496) [TE] Add HIP support to nvlink-allocator with hipcc compilation - [`87d78ec`](https://github.com/kvcache-ai/Mooncake/commit/87d78ec91cfb0ea95b50fbe12c19a62e6bf6de45) Add USE_HIP to the documentation - [`a6d837e`](https://github.com/kvcache-ai/Mooncake/commit/a6d837ec9438fbffe5935829f845c5fda0c9e02e) [TE/NVLINK] Check CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED only if USE_CUDA - [`4a6a86a`](https://github.com/kvcache-ai/Mooncake/commit/4a6a86ae90e3e101341ca4c41461e9bf2deb897c) [TE/EXAMPLE] Fix compiler error if USE_MNNVL and USE_HIP - [`c8ff0e2`](https://github.com/kvcache-ai/Mooncake/commit/c8ff0e28e992b007d9bfc1c598e73783328259dc) Address review comments ### 📊 Changes **20 files changed** (+188 additions, -128 deletions) <details> <summary>View changed files</summary> 📝 `doc/en/build.md` (+1 -0) 📝 `docs/source/getting_started/build.md` (+1 -0) 📝 `mooncake-common/common.cmake` (+40 -16) 📝 `mooncake-p2p-store/build.sh` (+4 -0) 📝 `mooncake-transfer-engine/example/CMakeLists.txt` (+18 -8) 📝 `mooncake-transfer-engine/example/transfer_engine_bench.cpp` (+4 -4) 📝 `mooncake-transfer-engine/example/transfer_engine_bench_with_notify.cpp` (+7 -7) 📝 `mooncake-transfer-engine/example/transfer_engine_validator.cpp` (+4 -5) 📝 `mooncake-transfer-engine/include/cuda_alike.h` (+1 -0) 📝 `mooncake-transfer-engine/include/gpu_vendor/hip.h` (+16 -64) 📝 `mooncake-transfer-engine/include/transport/nvlink_transport/nvlink_transport.h` (+1 -1) 📝 `mooncake-transfer-engine/nvlink-allocator/CMakeLists.txt` (+19 -1) 📝 `mooncake-transfer-engine/nvlink-allocator/build.sh` (+25 -3) 📝 `mooncake-transfer-engine/nvlink-allocator/nvlink_allocator.cpp` (+1 -2) 📝 `mooncake-transfer-engine/src/CMakeLists.txt` (+6 -2) 📝 `mooncake-transfer-engine/src/transport/nvlink_transport/CMakeLists.txt` (+10 -0) 📝 `mooncake-transfer-engine/src/transport/nvlink_transport/nvlink_transport.cpp` (+3 -2) 📝 `mooncake-transfer-engine/src/transport/tcp_transport/CMakeLists.txt` (+4 -0) 📝 `mooncake-transfer-engine/tests/CMakeLists.txt` (+22 -12) 📝 `mooncake-transfer-engine/tests/nvlink_transport_test.cpp` (+1 -1) </details> ### 📄 Description ## Description *(AI Assist)* This PR improves AMD GPU support by migrating to automated CUDA-to-HIP conversion using `hipify-perl`. **Key Changes:** 1. **Automated CUDA-to-HIP conversion with `hipify-perl`** - Introduced `hipify_files()` CMake function that converts CUDA source files to HIP-compatible code at build time - Eliminates need to manually maintain separate CUDA/HIP macro definitions - Uses official ROCm tool for proper API mapping and compatibility with ROCm updates - **Limitation:** Header files are not automatically converted 2. **HIP support for NVLink transport** 3. **HIP support for nvlink-allocator** 4. **Compatibility fixes** - Fixed compilation errors in examples when both `USE_MNNVL` and `USE_HIP` are enabled 5. **Documentation updates** - Added `USE_HIP` flag to build documentation ## Type of Change - [ ] Bug fix - [x] New feature - [x] Transfer Engine - [ ] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [x] Documentation update - [ ] Other ## How Has This Been Tested? 1. Checked build: cmake .. -DUSE_HIP=ON -DUSE_MNNVL=ON -DUSE_ETCD=ON -DSTORE_USE_ETCD=ON -DUSE_CXL=ON -DUSE_TCP=ON && make -j$(nproc) && make install ## 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:19 +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#2042
No description provided.