Repository navigation
Add CUDA-graph P2P channels, SIRCL-EP MoE all-to-all, and vLLM b12x EP integration - #404
Open
FujitsuPolycom wants to merge 7 commits into
Open
FujitsuPolycom wants to merge 7 commits into
FujitsuPolycom wants to merge 7 commits into
Conversation
… and DeepSeek V4.1 EP record
…d grouped routing Verified on Ring 4-7 (DeepSeek-V4.1-Flash-1017 TP4+EP4): - Fused Triton _remap_expert_ids_kernel replacing ~258 eager ATen ops/step - Text-only dsv4_topk is_padding forwarding to skip padded CUDA-graph slots - EP grouped MoE routing override avoiding direct-routing slowdown at M=5 - Unit tests covering Triton remap fallback, router padding skip, and grouped routing
Update serving.EXPERT_PARALLEL_LINK, installer/transport unit tests, and the DeepSeek V4.1 EP performance record with the verified R1-leg2 balanced tuning: - SIRCL_ONESHOT_MAX_BYTES=262144 (256 KiB ceiling, eliminating decode twoshot phases) - SIRCL_FORWARD_CHUNK_BYTES=65536 and SIRCL_PROGRESS_CPU=9 (GB10 X925 P-core) - B12X_DYNAMIC_W4A8_SHARE_INPUT=1, VLLM_MOE_SKIP_PADDING=1, OMP_NUM_THREADS=4 - Retains 1 MiB link slot/pieces and 8,192-token prefill batch (+9.0% Coding Peak, +8-15% C=2/C=4 decode, 6.4-6.8 ktok/s prefill, 18.5 GiB KV at 256K)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements, hardware-verifies, and end-to-end benchmarks a 3-stage Expert-Parallelism (EP) & All-to-All (A2A) stack in
libsircland thelibsirclvLLM plugin on a 4-Spark ConnectX-7 ring (positions 4–7) targeting DeepSeek-V4.1-Flash-1017:LIBSIRCL_P2P_CHANNELS(spark_transport/libsircl):kernels/sircl_p2p.cu,src/engine.c) so captured P2P channel ops advance item numbers across replays without host intervention.cuMemAllocAsync/cuMemFreeAsync) on the channel stream joined to the capturing stream by CUDA graph events for unaligned/non-pack sizes, zero-copy for aligned buffers.libsirclC/CUDA "SIRCL-EP" Dynamic MoE All-to-All (include/sircl.h,exports.map,kernels/sircl_p2p.cu,src/api.c,src/engine.c,src/kernelpack.c):sirclEpWorkspaceBytes,sirclEpDispatch, andsirclEpCombinedirectly overlibsircl's existingp2p_ctxRDMA arena and unmodified vendoredsircl_p2p_proxy.c(byte-identical SHA-256 preserved).channels.epreceipt telemetry.integrations/vllm/libsircl/):SIRCL_B12X_EP_MOE=1(sircl_ep_b12x.py): wiresb12x.moe.ep_moe/run_w4a16_moeinto vLLM'sB12xExpertsfor both TP+EP (Stage 1) and DP+EP (Stage 3), including DP global-rank coordination fix, DP expanded-workspace fix, and DeepSeek-V4.1 CED layer-20 DP metadata sync hook.SIRCL_EP_ALL2ALL=1(sircl_ep_all2all.py):SirclEpAll2AllManagerreplacingAgRsAll2AllManagerfor EP dispatch/combine across all 40/40 MoE layers inside decode CUDA graphs (with automatic eager fallback toAgRswhenmax_tokens > SIRCL_EP_MAX_TOKENSwhile pre-warming map/workspace for graph capture).Hardware Verification & Benchmarks (Ring 4–7: 4× NVIDIA DGX Spark GB10, ConnectX-7)
1. Stage 3 CUDA-Graph Microbenchmark (
H=5120, BF16, E=384, K=6,libsircl.so.0.6.08005169b...)B=1: 71.07 µs (1.63× faster than fixed P2P)B=64: 298.13 µs (1.14× faster than fixed P2P)B=128: 489.60 µs (1.09× faster than AgRs536.08 µs, 1.27× faster than fixed P2P619.87 µs)2. End-to-End DeepSeek-V4.1-Flash-1017 —
no_specLadder (cudagraph_capture_sizes=[1,2,4,8,16], BF16 W4A16)libsirclReceiptsA_tp4_w4a16(baseline TP4)healthy=True,captured=1512,ar=6494..6498B_tp4_ep4(Stage 1 TP4+EP4)healthy=True,captured=1512,ar=6340..6341C_dp4_ep4_agrs(DP4+EP4 AgRs)*healthy=True,captured=2880,ag=5280,rs=1760D_dp4_ep4_sircl_ep(Stage 3b SIRCL-EP)healthy=True,captured=1440,ep={2581/2580}, 5.12 GB / 996,733 RDMA writes,staged=0,refused=0*Note:
C_dp4_ep4_agrsrequiredCUDA_LAUNCH_BLOCKING=1to avoid an intermittent asyncCUBLAS_STATUS_INTERNAL_ERRORinb12x/gemm/bf16_gemv(torch.mm) on CUDA 13.4;D_dp4_ep4_sircl_epran fully asynchronous with zero errors across all 4 ranks and 9.1× concurrency scaling (cc=1 → 16) alongside 4× KV-cache capacity.3. End-to-End DeepSeek-V4.1-Flash-1017 —
specLadder (DSpark speculative decoding)libsirclReceiptsA_tp4_w4a8healthy=True,captured=9076A_tp4_w4a16healthy=True,captured=9076B_tp4_ep4(Stage 1)healthy=True,captured=9076Test Plan
make checkinside GB10 CUDA 13.4 container (nvccsm_120/sm_121):check_entries(all 358 entries across 4 packs),test_fabric(10,057 checks),test_link_plan(15),test_kernelpack_cache(69),test_vendored_sources(5),test_abi(17),test_bootstrap(27),test_lifecycle(23),test_engine_cpu,test_shm_verbs,test_mpi_shim(6),test_check_nccl_tests(12),test_kernel_entries(3),test_build_flags(3),test_source_snapshot(2),test_concurrent_close(8) — all passed.tests/emulation/p2p_channels.py --world 4 --case graph): 32/32 checks passed, 0 failed (10 mutated-payload graph replays bit-exact).tests/emulation/p2p_channels.py --world 4 --case ep): 40/40 checks passed, 0 failed (bf16/fp16/fp32asymmetric, all-local, and 8 dynamic-routing CUDA graph replays bit-exact).integrations/vllm/libsircl/test_sparkring_libsircl.py) inside container with PyTorch 2.13.0+cu130: 19/19 passed, 0 skipped.pytest spark_transport/libsircl/tests/test_docs_consistency.py spark_transport/libsircl/tests/test_vendored_sources.py -v: 7/7 passed (sircl_p2p_proxy.candsircl_roce_proxy.cuntouched).ruff checkon all modified/added Python files: 0 errors.