Repository navigation
Conversation
Opt-in VLLM_CUSTOM_ALL_GATHER_SMALL: CudaCommunicator.all_gather() sends inputs of at most VLLM_CUSTOM_ALL_GATHER_SMALL_MAX_BYTES per rank (default 64 KiB) to the existing CustomAllreduce.custom_all_gather (falls back to NCCL when it declines), for latency-bound gathers such as the speculative drafter's per-step gathers. Only all_gather's routing changes; the dim-0 result is rearranged for other dims exactly as on the NCCL path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fair question, and you're right. I'd avoided So I've reduced the PR locally to routing only: |
7017887 to
ff197b2
Compare
Overview
Opt-in
VLLM_CUSTOM_ALL_GATHER_SMALL=1(default off):CudaCommunicator.all_gather()sends TP all-gathers of at mostVLLM_CUSTOM_ALL_GATHER_SMALL_MAX_BYTESper rank (default 64 KiB) to the existingCustomAllreduce.custom_all_gather, falling back to NCCL when it declines. Reworked after review: no new kernel orCustomAllreducemethod, only routing. Related: #57856.Claims
custom_all_gatheris only reached fromsp_all_gather;tensor_model_parallel_all_gatheralways uses NCCL.dim, except that on multicast-capable GPUs a-0.0comes back as+0.0(see Details).Validation
On
ac9126e58(nightly image with this branch'svllm/files overlaid):pytest -v tests/distributed/test_custom_all_gather_small.py(4x B200, Ray): 8 passed. Routing and layout fordim0 / 1 / -1, threshold and decline fallbacks (unit); TP2 / TP4 comparison against the NCCL path on drafter-like shapes (bf16[1..48, 1024],[1, 32768], fp32[1, 16],[8, 16],[8, 2], and one size above the threshold), with NaN / inf / subnormal / signed-zero inputs, eagerly and over 20 CUDA graph replays. Values are compared bitwise with signed zeros canonicalized.custom_all_gather(Lamport on this node)[1, 16](64 B)[8, 16](512 B)[1, 1024](2 KiB)[8, 1024](16 KiB)[1, 32768](64 KiB)[48, 1024](96 KiB)No end-to-end measurement of this change alone on this commit.
Details
0 < nbytes <= capandcustom_all_gather()returns a tensor; otherwise NCCL. The dim-0 result gets the samemovedim/reshapeas the NCCL path (shared helper). The cap is read once at init.custom_all_gather's: the MNNVL Lamport kernel when multicast is available, else the one-shot CUDA-IPC kernel. Both use buffers registered at init, so they are CUDA-graph safe. Inputs thatcustom_all_gatherdoes not take (not a 16-byte multiple such as a single[1, 2]fp32 row, non-float dtypes, above its size limit) fall back to NCCL.0x80000000as its "not written yet" marker and stores such words as 0, so-0.0arrives as+0.0(and in bf16/fp16 a word holding-0.0with a zero neighbour). All other bit patterns are preserved. For the drafter's gathers (hidden states, logits, argmax candidates) this does not change any result.LogitsProcessortocustom_all_gather(). This PR routes small gathers at the communicator level; the call sites are complementary.AI assistance: Claude Code was used to write this change and its tests, run the validation and draft this description. The human submitter reviews every changed line before this leaves draft.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
🤖 Generated with Claude Code