Repository navigation
Merge spiceai-b11803 (#18, #19) into spiceai-b11999 - #22
Conversation
…n no port has its address (#18) * ggml-rpc: carry a connection to this host over the NIC's loopback when no port has its address The RDMA probe finds the port whose GID is the TCP connection's local address, so a client that reaches a server on its own host at an address no port carries (a /32 on the loopback interface, 127.0.0.1) stays on TCP over the loopback interface. When the connection's two ends are this host and no port has its address, both ends now take the IPv4 RoCE v2 GID of the first active port (of GGML_RDMA_DEV, when set), and the NIC loops the connection back. GGML_RDMA_GID and GGML_RPC_NO_RDMA keep their meaning. * ggml-rpc: take the loopback port by name and index, and share RDMA with this host only on one GID The loopback fallback handed the probe only GID bytes, so a device scanned earlier with the same GID on a down or RoCE v1 port could carry the connection; it now names the device and the GID's index it chose. Each end of a connection to this host also chooses its port from its own GGML_RDMA_DEV and GGML_RDMA_GID, and two ports need not reach each other, so such a connection now takes RDMA only when both ends chose the same GID, which both see the same way, and otherwise stays on TCP at both ends. * ggml-rpc: advertise RDMA on a connection to this host only over RoCE v2 The two ends of a connection to this host compare only the GID bytes they advertised, and a RoCE v1 entry has the same bytes as the v2 one, so one end pinned to the v1 index (GGML_RDMA_GID) and one choosing v2 passed the comparison with incompatible modes. On such a connection an end whose GID is not RoCE v2 now advertises nothing, and both stay on TCP.
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer judgment is needed on whether deployments can accept unversioned same-host RDMA negotiation requiring coordinated peer upgrades or matching RDMA settings.
No open issues 🎉
What changed in this PR
Carries #18's RPC transport change from spiceai-b11803 into spiceai-b11999, keeping the new Spice branch aligned with its predecessor.
Changes:
- Enables NIC RoCE v2 loopback for same-host RPC connections when no eligible port carries the connection's address.
- Adds same-host GID compatibility checks so peers selecting different GIDs fall back to TCP.
| File | Description |
|---|---|
ggml/src/ggml-rpc/transport.cpp |
Adds same-host detection, loopback GID selection, compatibility checks, and diagnostic logging. |
Review effort: Balanced
|
Addressed #22 (review). Same-host RDMA negotiation is #18's design. #18 was reviewed and merged on The constraint the review names is real, and #18 documents it in
Old and new builds on one host. The Spice runtime does not mix them. Each runtime process serves its own GPUs from one in-process RPC server ( A different maintainer could decide otherwise. If they would rather version the negotiation (for example a capability bit in the RDMA handshake), that belongs in a PR against #18's code, not in this forward merge. |
…it per split, stream-queued all-reduce, deferred sends (#19) * llama, ggml-backend: two graph slots and one input wait per split by default for a tensor split LLAMA_GRAPH_SLOTS and GGML_SCHED_SYNC_INPUTS_ONCE were off unless set. Unset, a tensor split (LLAMA_SPLIT_MODE_TENSOR) now gets the second graph slot, and a split on the meta backend waits for its backend once before copying its inputs; any other model keeps one slot and a wait per input, and a value in the environment still decides either way. On a GLM-5.3 split across three nodes over RPC, each was worth 3-5% of decode with the other levers on. * ggml-rpc: queue a tensor split's all-reduce on a stream and defer its sends by default GGML_RPC_COMM_ASYNC and GGML_RPC_COMM_SEND_DEFER were off unless set; they are now on unless set to 0. Only a tensor split's all-reduce reaches either. On a GLM-5.3 split across three nodes over RPC, with the other levers on, the stream-queued all-reduce was worth 1.4-2.6% of decode and the deferred sends 0.9-1.7%, with replies unchanged.
|
On the latest Copilot review (a799a6f): this PR adds no code of its own. Its net diff against The Linux paths were validated in those PRs, on the three-Spark CUDA lab, where #18's RoCE loopback and #19's defaults were measured. That evidence is in #18's and #19's descriptions. Here, on macOS: |
|
Addressed review 5726197264 after the merge: the Linux RoCE loopback negotiation (#18) and the default-on tensor-split levers (#19) on target hardware, on this PR's head Rig and build. Three DGX Spark (GB10) nodes, each pair cabled over 200 GbE ConnectX-7 (RoCE v2), Qwen3.8-Flash-Next UD-Q3_K_XL split three ways ( #18: a connection to the same host takes the NIC's loopbackThree CUDA
#19: the levers run by default on a tensor split, and change no output
Which levers run. None of them logs a line of its own, so I counted calls under gdb. The breakpoints only count (
A/B.
D is faster on both: every D sample beats every O sample. These are 12 samples per arm, so no P99 is stated. Outputs.
|
| env | world 3 | two-rank phases | exit | servers on the stream-queued path | links |
|---|---|---|---|---|---|
| D | 4/4 sizes exact | 8/8 | 0 | 3/3 | 8 over RDMA |
| O | 4/4 sizes exact | 8/8 | 0 | 0/3 | 8 over RDMA |
Not run: a two-rank NCCL split, and backends other than CUDA.
Carries #18 and #19 forward into
spiceai-b11999. Both merged intospiceai-b11803, the previous Spice branch, afterspiceai-b11999was cut.spiceai/README.mdsays every PR merged into the previous branch must be in the new one before it is tagged. #15 and #16 came forward the same way in a42907e.What changes
Two merge commits of
spiceai-b11803intospiceai-b11999(f3bce26), neither with conflicts:996473e brings ggml-rpc: carry a connection to this host over the NIC's loopback when no port has its address #18 (4312ca5):
ggml/src/ggml-rpc/transport.cpp, +103/−3. When both ends of an RPC connection are this host and no port carries the connection's address, the connection takes the NIC's RoCE loopback instead of staying on TCP.a799a6f brings Turn the tensor-split levers on by default: graph slots, one input wait per split, stream-queued all-reduce, deferred sends #19 (aad0211):
ggml/src/ggml-backend.cpp,ggml/src/ggml-rpc/ggml-rpc.cppandsrc/llama-context.cpp, +28/−18. A tensor split now gets its levers by default:A value in the environment still decides either way. b11999 already has each switch with the same name, so only the defaults move.
The details and lab evidence are in #18's and #19's descriptions.
Evidence (macOS, Metal, 2026-11-01, on a799a6f, from a clean build directory)
test-llama-archs:all 548 test(s) passed.test-rpc-transport: exit 0.ubuntujobs build the Linux side.