Skip to content

Add neighbor-only no-relay ring mode (LIBSIRCL_RING_ONLY / --ring-only) to SIRCL, libsircl, and installer - #400

Merged
FujitsuPolycom merged 5 commits into
mainfrom
feat/libsircl-ring-only
Nov 21, 2026
Merged

FujitsuPolycom merged 5 commits into
mainfrom
feat/libsircl-ring-only

Conversation

@FujitsuPolycom

Copy link
Copy Markdown
Owner

Summary

Adds a neighbor-only, no-relay ring mode (LIBSIRCL_RING_ONLY=1 and sparkring install --transport libsircl --ring-only) for direct-cable pairs and closed cycles of 2–8 DGX Sparks with 1 or 2 RDMA lanes per neighbor and no ConnectX hairpin relay table or diagonal QPs:

  • SIRCL RoCE proxy (_roce_proxy.c + vendored sircl_roce_proxy.c): Adds ROCE_FEATURE_SPARSE_PEERS (bit 2, ABI 9 preserved) so symmetric sparse route tables connect only routed neighbor peers, reject diagonal links in set_links/set_forward/set_chain, and guard post_lane_write against unconnected peers.
  • libsircl (engine.c): Adds LIBSIRCL_RING_ONLY=1 so all collectives (AllReduce, AllGather, ReduceScatter, Broadcast, Reduce, AlltoAll, Gather, Scatter, Fold, CUDA graphs) run over neighbor-only ring links with zero arena/diagonal QPs (forwarded=0, fw_lanes=0). Neighbor P2P (LIBSIRCL_P2P_CHANNELS=on) runs directly between ring neighbors and refuses diagonal peers cleanly with ncclInvalidUsage.
  • Route planner & installer (site_routes.py, libsircl.py, transport.py, install_workflow.py, stock_install.py): Adds --ring-only to emit neighbor-only SIRCL_PEER_ROUTES, LIBSIRCL_RING_ONLY=1, and LIBSIRCL_RING_WINDOW=0 without requiring a ConnectX relay table ("sircl" transport in fabric.json), while refusing paths/partial arcs and non-libsircl transports.
  • Test harness (library_rank.py): Models LIBSIRCL_RING_ONLY=1 schedule and receipt expectations (ring_only=True, cycle_plan=False, 60 fold ops).

Verification

Offline / CPU / GPU Emulation

  • make check (nvcc 13.3 -Werror), RTX 5090 GPU emulation for 1-lane & 2-lane collectives + pair/ring P2P (arena_ops=0), SIRCL tests (84/84), vendored source SHA-256 checks (4/4).
  • pytest runtime/common/test_libsircl.py runtime/common/test_transport.py runtime/host/test_stock_install.py spark_transport/libsircl/tests/test_site_routes.py — 187 passed, ruff check clean, check_repository_layout.py pass, check_markdown_links.py pass (4,260 links).

Real DGX Spark Hardware (4 × NVIDIA GB10 sm_121, Ring 4–7)

Built ARM64 libsircl.so.0.6.0 natively on GB10 (make check + probe_cuda_on_load.py pass) and ran over real RoCEv2 (LIBSIRCL_TRANSPORT=verbs, LIBSIRCL_FAIL_STOP=1, LIBSIRCL_RING_ONLY=1):

  • Collectives & CUDA graphs (library_rank.py vs w4-ring.json golden):
    • 1-lane (--lanes 1 --ring-only, 2 HCAs/host): 248/248 checks PASS (bad=0) on all 4 ranks.
    • 2-lane (--lanes 2 --ring-only, 4 HCAs/host): 248/248 checks PASS (bad=0) on all 4 ranks.
    • All receipts: "ring_only": true, "cycle_plan": false, "forwarded": 0, "fw_lanes": 0, "nat_ops": 0, "healthy": true.
  • Ring-only P2P (LIBSIRCL_P2P_CHANNELS=on, 1-lane & 2-lane):
    • Neighbor ncclSend/ncclRecv (1 B – 4 MiB + 16) bit-exact in both directions on all 4 ranks.
    • Diagonal peer (rank ^ 2) refused cleanly with ncclInvalidUsage (5) (channels.refused=2), followed by bit-exact AllReduce.
  • AllReduce sweep (perf_rank.py, 4 Sparks, every row correct=True, healthy=True):
    • 1-lane (2 HCAs/host): 4 KiB 202.0 us (graph) -> 64 MiB 13.13 GB/s busbw (bf16), 13.12 GB/s (fp32).
    • 2-lane (4 HCAs/host): 4 KiB 204.3 us (graph) -> 64 MiB 23.71 GB/s busbw (bf16), 23.83 GB/s (fp32, 1.82× scaling).
  • Zero new RDMA hardware error counters across all 16 HCAs.

…d libsircl

Support bare switchless cycles with 1 or 2 RDMA lanes per ring neighbor and no ConnectX hairpin relay table or diagonal QPs:

- Extend the SIRCL RoCE proxy with ROCE_FEATURE_SPARSE_PEERS (bit 2, ABI 9 preserved) so symmetric sparse route tables connect only routed peers, reject diagonal links in set_links/set_forward/set_chain, and guard post_lane_write against unconnected peers.
- Vendor the updated proxy into libsircl with matching SHA-256 and expose FEATURE_SPARSE_PEERS in the Python proxy binding.
- Add LIBSIRCL_RING_ONLY=1 to libsircl/src/engine.c so all collectives run over neighbor-only ring links with zero arena/diagonal QPs, neighbor P2P works, non-neighbor P2P fails cleanly with ncclInvalidUsage, and receipts record ring_only.
- Add --ring-only to libsircl/tools/site_routes.py to emit neighbor-only SIRCL_PEER_ROUTES and LIBSIRCL_RING_ONLY=1 while refusing relayed ring edges.
- Add CPU, shm_verbs emulation, and site_routes unit tests and update libsircl documentation.
@FujitsuPolycom
FujitsuPolycom merged commit ee9341e into main Nov 21, 2026
10 checks passed
@FujitsuPolycom
FujitsuPolycom deleted the feat/libsircl-ring-only branch November 21, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant