char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
f3a33dff2
char/aliceai-t5-moe
1message ( STATUS "Using RPC backend" ) 2 3ggml_add_backend_library ( ggml-rpc 4ggml-rpc.cpp 5transport.cpp 6) 7 8if ( WIN32) 9target_link_libraries ( ggml-rpc PRIVATE ws2_32 ) 10endif () 11 12# RDMA auto-detection: Linux RoCE/IB via libibverbs, Apple RDMA-over-Thunderbolt via librdma 13if ( APPLE) 14set ( RDMA_LIB_NAME rdma ) 15set ( RDMA_DESC "Apple RDMA-over-Thunderbolt, UC" ) 16elseif ( NOT WIN32) 17set ( RDMA_LIB_NAME ibverbs ) 18set ( RDMA_DESC "auto-detected" ) 19endif () 20 21if ( RDMA_LIB_NAME) 22find_library ( RDMA_LIB ${ RDMA_LIB_NAME }) 23if ( RDMA_LIB) 24option ( GGML_RPC_RDMA "ggml: enable RDMA transport for RPC" ON ) 25else () 26option ( GGML_RPC_RDMA "ggml: enable RDMA transport for RPC" OFF ) 27endif () 28else () 29set ( GGML_RPC_RDMA OFF CACHE BOOL "RDMA not available on this platform" FORCE ) 30endif () 31 32if ( GGML_RPC_RDMA) 33if ( NOT RDMA_LIB) 34find_library ( RDMA_LIB ${ RDMA_LIB_NAME } REQUIRED ) 35endif () 36target_compile_definitions ( ggml-rpc PRIVATE GGML_RPC_RDMA ) 37if ( APPLE) 38# librdma.dylib only exists on macOS 26.2 and later. Link it weakly so a build made 39# where it exists still loads where it does not; checked at runtime before use 40# but with BUILD_SHARED_LIBS=OFF ggml-rpc is a static archive and never links 41# so the librdma symbols used by transport-apple.cpp stay undefined. 42target_link_options ( ggml-rpc PUBLIC "LINKER:-weak_library, ${ RDMA_LIB } " ) 43target_compile_definitions ( ggml-rpc PRIVATE GGML_RPC_RDMA_APPLE ) 44target_sources ( ggml-rpc PRIVATE transport-apple.cpp ) 45else () 46target_link_libraries ( ggml-rpc PRIVATE ${ RDMA_LIB }) 47endif () 48message ( STATUS " RDMA transport enabled ( ${ RDMA_DESC } )" ) 49else () 50message ( STATUS " RDMA transport disabled" ) 51endif ()