Skip to content

Add SGLang stock-image support and fix stock libnccl.so.2 shadow-mount / runtime binding - #401

Merged
FujitsuPolycom merged 5 commits into
mainfrom
feat/libsircl-sglang-stock
Nov 21, 2026
Merged

FujitsuPolycom merged 5 commits into
mainfrom
feat/libsircl-sglang-stock

Conversation

@FujitsuPolycom

Copy link
Copy Markdown
Owner

Summary

Extends the research-only sparkring install --image REF --transport libsircl --plan stock-image flow to support unmodified ARM64 SGLang images alongside vLLM, and fixes two hardware-discovered stock-image binding bugs that blocked both SGLang (lmsysorg/sglang:v0.5.21-cu130-runtime) and community vLLM (eugr/spark-vllm:nightly-20261013) on real DGX Sparks:

  • SGLang stock-image detection, preflight, and Compose planning (stock_image_probe.py, stock_image.py, stock_install.py):
    • Detects sglang without importing it (refusing images with neither or both of vllm and sglang), checks SGLANG_NCCL_SO_PATH in find_nccl_library(), verifies every function NCCLLibrary binds against api_manifest.json, and checks sglang/launch_server.py + multi-node args across both srt/server_args.py and modular srt/arg_groups/ (SGLang v0.5.23+).
    • Refuses unsupported/bypassing SGLang flags (--pp-size/--dp-size/--ep-size > 1, --enable-dp-attention, --enable-ep-moe, --enable-dp-lm-head, --disaggregation-mode, --enable-memory-saver, --enable-symm-mem, --enable-torch-symm-mem, --enable-mscclpp, --enable-flashinfer-allreduce-fusion, --flashinfer-allreduce-fusion-backend, --load-format instanttensor, SGLANG_DISABLE_PYNCCL) and emits SGLang-specific plan summary output (SGLANG_OFF_TEXT).
    • Plans each rank's Compose spec with python3 -m sglang.launch_server, SGLANG_NCCL_SO_PATH, LD_PRELOAD, --disable-custom-all-reduce, --tp-size, --nnodes, --node-rank, and --dist-init-addr.
  • Shadow bind mounts for image libnccl.so.2 files & runtime libtorch_cuda.so binding verification:
    • PyTorch wheels (torch._preload_cuda_deps()) and base images dlopen bundled libnccl.so.2 by absolute path, bypassing LD_PRELOAD SONAME matching and leaving two libnccl.so.2 mappings in /proc/self/maps. The facts probe now discovers image libnccl.so.2 realpaths (torch.nccl_libraries), and both --binding and rank_spec() shadow bind-mount the host libsircl.so.<version> read-only over each path so glibc reuses the preloaded inode and never maps the image's NCCL.
    • torch.cuda.nccl.version() reports PyTorch's compile-time NCCL headers (e.g. [2, 29, 7]) rather than runtime ncclGetVersion(). The --binding probe now checks libtorch_cuda.so directly (torch_provider via dladdr and torch_runtime_nccl_version == 22705), while still refusing any torch_error (such as ABI-incompatible NGC images).

Verification

Offline / Unit Tests

  • pytest runtime/common/test_stock_image.py runtime/host/test_stock_install.py — 82 passed (Windows and WSL Linux), ruff check clean, check_repository_layout.py pass, check_markdown_links.py pass (4,260 links).
  • Statically inspected lmsysorg/sglang:v0.5.23-runtime (linux/arm64) to confirm modular srt/arg_groups/ layout and nvidia/nccl wheel path.

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

  • Live preflight + --binding probes on host spark-aa42:
    • lmsysorg/sglang:v0.5.21-cu130-runtime: 0 preflight problems, 0 binding problems (mapped=[libsircl], torch_provider=libsircl, torch_runtime_nccl_version=22705).
    • eugr/spark-vllm:nightly-20261013: 0 preflight problems, 0 binding problems (mapped=[libsircl], torch_provider=libsircl, torch_runtime_nccl_version=22705).
    • nvcr.io/nvidia/vllm:26.09-py3: cleanly refused at --binding (ImportError: libtorch_cuda.so: undefined symbol: ncclGetPeerDeviceLeInfo).
  • Live 2-Spark RoCEv2 collective smoke inside unmodified lmsysorg/sglang:v0.5.21-cu130-runtime (hosts spark-aa42 & spark-4a87, 2 lanes):
    • Only /opt/sparkring/libsircl/lib/libsircl.so.0.6.0 mapped in /proc/self/maps on both ranks.
    • torch.distributed ProcessGroupNCCL: bit-exact all_reduce, all_gather, broadcast (bf16 + fp32, 4 KiB / 1 MiB / 16 MiB) — PASS (healthy=true, forwarded=0).
    • SGLang PyNcclCommunicator: available=True, ncclGetVersion=2.27.5, bit-exact eager all_reduce / all_gather / broadcast (bf16 + fp32, 4 KiB / 1 MiB / 16 MiB) + 10× CUDA graph capture & replay — PASS on both ranks, clean teardown, zero new RDMA errors.

Extend SGLANG_REFUSED_FLAGS in runtime/common/stock_image.py to refuse --enable-torch-symm-mem, --enable-mscclpp, --enable-flashinfer-allreduce-fusion, and --flashinfer-allreduce-fusion-backend so stock SGLang plans cannot bypass PyNccl/libsircl.

Print SGLang-specific Off text (stock_image.SGLANG_OFF_TEXT) in runtime/host/stock_install.py lines() instead of vLLM-specific libsircl.OFF_TEXT, and update docs/architecture/libsircl.md and unit tests accordingly.

Validation: pytest (123 passed across test_stock_image.py, test_stock_install.py, test_libsircl.py), ruff check, check_repository_layout.py, and check_markdown_links.py.
@FujitsuPolycom
FujitsuPolycom force-pushed the feat/libsircl-sglang-stock branch from 802fb1f to 3da4c29 Compare November 21, 2026 03:17
@FujitsuPolycom
FujitsuPolycom merged commit dfa0fbd into main Nov 21, 2026
10 checks passed
@FujitsuPolycom
FujitsuPolycom deleted the feat/libsircl-sglang-stock branch November 21, 2026 04:39
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