#33355·sglang

[Feature][DCP] symm_a2a backend: peer-direct A2A for MLA decode on single-node NVLink/NVSwitch

Author: CerdoreCreated Aug 3, 2026Updated Sep 26, 2026

Motivation

SGLang currently ships three DCP (Decode Context Parallel) attention-reduction backends (server_args.py, default ag_rs):

  • ag_rs (default): NCCL all_gather of the head-partial output + LSE, then Triton correction + reduce_scatter (cp_lse_ag_out_rs_mla in layers/dcp/comm.py). Two NCCL collectives per layer.
  • a2a: packs output + fp32 LSE into one buffer, runs NCCL all_to_all_single, then a local Triton combine (dcp_a2a_lse_reduce). Still one NCCL collective + pack/unpack copies per layer.
  • fi_a2a: FlashInfer MNNVL All-to-All kernel — requires SM90+ and MNNVL fabric memory (e.g. GB200 NVL72), unavailable on the common single-node NVLink/NVSwitch clusters.

On a single-node NVLink/NVSwitch GPU domain (e.g. H20 ×8, A100 ×8, H100 ×8), the only usable backends are ag_rs and a2a — both route the exchange through NCCL collectives. Neither leverages the direct peer-to-peer memory access that PyTorch symmetric memory makes available inside a single node. At high concurrency (conc=64+) this NCCL exchange sits on the critical path of every decode step and becomes a measurable bottleneck.

Proposed Solution

Add a new --dcp-comm-backend symm_a2a backend that:

  1. Allocates a peer-mapped symmetric memory slab across DCP ranks (via PyTorch _SymmetricMemory.empty_strided_p2p + rendezvous)
  2. Each rank directly writes partial attention output + LSE into peer buffers using vectorized uint4 P2P stores over NVLink/NVSwitch (no NCCL)
  3. Each rank signals peers (release) then spin-waits on its local signal slots (acquire) and runs a lightweight CUDA combine kernel to perform the LSE-weighted reduction
  4. Uses epoch double-buffering (parity = epoch & 1) for CUDA graph compatibility (no host-side sync between replays)

Key advantages over ag_rs/a2a:

  • No NCCL on the exchange: replaces the NCCL collective (+ pack/unpack for a2a) with direct P2P writes + a local combine kernel
  • Fully kernel-based: all four steps are plain CUDA kernels on the compute stream, captured inside the existing decode CUDA graph (epoch double-buffering removes host-side sync between replays)
  • Lower latency at high concurrency: direct NVLink/NVSwitch writes + local LSE combine vs. NCCL collective round-trip
  • No MNNVL required: works on any single-node NVLink/NVSwitch domain, unlike fi_a2a

Related

  • vLLM PR #48897 — upstream symmetric-memory direct A2A for DCP
  • Existing SGLang DCP backends: ag_rs, a2a, fi_a2a