Skip to content

Commit adb541a

Browse files
authored
rpc : add native RDMA transport for RPC backend (RoCEv2) (ggml-org#20590)
1 parent 80d8770 commit adb541a

4 files changed

Lines changed: 607 additions & 38 deletions

File tree

ggml/include/ggml-rpc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
extern "C" {
77
#endif
88

9-
#define RPC_PROTO_MAJOR_VERSION 3
10-
#define RPC_PROTO_MINOR_VERSION 6
11-
#define RPC_PROTO_PATCH_VERSION 1
9+
#define RPC_PROTO_MAJOR_VERSION 4
10+
#define RPC_PROTO_MINOR_VERSION 0
11+
#define RPC_PROTO_PATCH_VERSION 0
1212

1313
#ifdef __cplusplus
1414
static_assert(GGML_OP_COUNT == 96, "GGML_OP_COUNT has changed - update RPC_PROTO_PATCH_VERSION");

ggml/src/ggml-rpc/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,26 @@ ggml_add_backend_library(ggml-rpc
77
if (WIN32)
88
target_link_libraries(ggml-rpc PRIVATE ws2_32)
99
endif()
10+
11+
# RDMA auto-detection (Linux only, requires libibverbs)
12+
if (NOT WIN32 AND NOT APPLE)
13+
find_library(IBVERBS_LIB ibverbs)
14+
if (IBVERBS_LIB)
15+
option(GGML_RPC_RDMA "ggml: enable RDMA transport for RPC" ON)
16+
else()
17+
option(GGML_RPC_RDMA "ggml: enable RDMA transport for RPC" OFF)
18+
endif()
19+
else()
20+
set(GGML_RPC_RDMA OFF CACHE BOOL "RDMA not available on this platform" FORCE)
21+
endif()
22+
23+
if (GGML_RPC_RDMA)
24+
if (NOT IBVERBS_LIB)
25+
find_library(IBVERBS_LIB ibverbs REQUIRED)
26+
endif()
27+
target_compile_definitions(ggml-rpc PRIVATE GGML_RPC_RDMA)
28+
target_link_libraries(ggml-rpc PRIVATE ${IBVERBS_LIB})
29+
message(STATUS " RDMA transport enabled (auto-detected)")
30+
else()
31+
message(STATUS " RDMA transport disabled")
32+
endif()

0 commit comments

Comments
 (0)