Skip to content

[Distributed] Tune TP8 SM80 one-shot all-reduce crossover - #12

Closed
haosdent wants to merge 1 commit into
mainfrom
custom-ar-sm80-crossover
Closed

haosdent wants to merge 1 commit into
mainfrom
custom-ar-sm80-crossover

Conversation

@haosdent

@haosdent haosdent commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Purpose

Tune the existing custom-allreduce one-shot/two-shot selection for the exact
TP=8 SM80 fully connected case. Cudagraph measurements on 8xA100 NVLink place
the crossover above the current 256 KiB generic threshold, so the current
policy switches to two-shot too early on this topology.

This PR changes only the algorithm-selection heuristic inside the existing
barrier-based custom all-reduce. It does not add a communicator or increase the
custom-allreduce payload cap.

Exact scope and nonduplication

Publication commit: 09d8eb1d74a5e2096675d5439142e3b171e5ccbe.
Relative to origin/main@dd11df04f3b7046c40f13e586ac38a3725bc3c03,
the PR changes three files (+71/-21):

  • a constexpr one-shot-bound policy and compile-time boundary assertions;
  • propagation of exact SM80 device capability into the stable custom-AR C++
    object;
  • a ca_auto arm in the existing communicator benchmark.

Relationship to existing open work:

Changed behavior

For the automatic custom-allreduce path, with the surrounding existing
fully-connected check still required:

Case One-shot selection
world size <= 4 payload < 512 KiB (unchanged)
world size = 8 and exact SM80 payload <= 448 KiB
every other world-size/architecture case payload < 256 KiB (unchanged)

The SM80 TP=8 bound is intentionally inclusive because one-shot measured 6.7%
faster at exactly 448 KiB. 448 KiB + 1 and larger payloads select two-shot;
the next measured tile, 464 KiB, was already 1.2% faster with two-shot. Forced
VLLM_CUSTOM_ALLREDUCE_ALGO behavior is unchanged.

Measured evidence

Dense crossover sweep: 8xA100 NVLink, TP=8, BF16, hidden size 8192,
cudagraph-captured, 50 warmups and 1000 trials:

Payload One-shot Two-shot Faster arm
432 KiB 20.895 us 22.002 us one-shot by 5.0%
448 KiB 21.549 us 23.102 us one-shot by 6.7%
464 KiB 22.146 us 21.878 us two-shot by 1.2%
480 KiB 22.723 us 21.860 us two-shot by 3.8%
512 KiB 23.776 us 21.871 us two-shot by 8.0%

The raw sweep is stored locally as
benchmark/custom-ar-sm80-crossover-dense.json. A separate automatic-policy
sweep (benchmark/custom-ar-sm80-crossover-auto.json, 20 warmups, 300 trials)
covered both sides of the boundary. A broader sweep is in
benchmark/custom-ar-sm80-crossover.json.

These are collective microbenchmarks. No TTFT, TPOT, ITL, model throughput, or
combined result with vllm-project#44891 is claimed.

Build and benchmark commands run

Targeted CUDA build:

cmake --build build/temp.linux-x86_64-cpython-312 \
  --target _C_stable_libtorch --parallel 12

Result: exit 0; both custom-allreduce CUDA objects compiled and
_C_stable_libtorch.abi3.so linked.

Dense crossover:

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
VLLM_ALLREDUCE_USE_FLASHINFER=0 \
VLLM_ALLREDUCE_USE_SYMM_MEM=0 \
/root/vllm/.venv/bin/torchrun --standalone --nproc-per-node=8 \
  benchmarks/kernels/benchmark_device_communicators.py \
  --sequence-lengths 24 25 26 27 28 29 30 31 32 \
  --num-warmup 50 --num-trials 1000 \
  --output-json /root/vllm-pr-evidence/20260803-deepseek-v4-a100/benchmark/custom-ar-sm80-crossover-dense.json

Automatic-policy verification used the same environment and executable with:

--sequence-lengths 16 24 27 28 29 32 --num-warmup 20 --num-trials 300
--output-json /root/vllm-pr-evidence/20260803-deepseek-v4-a100/benchmark/custom-ar-sm80-crossover-auto.json

Compile-time assertions cover SM80/non-SM80 and both sides of the special
inclusive boundary.
Changed-range pre-commit hooks pass.

Model evaluation status

Not run. Moving 256-448 KiB reductions from two-shot to one-shot changes
the BF16 reduction order, so a model-level output/evaluation comparison is
required before merge. No DeepSeek-V4 128k/256k server result is attributed to
this microbenchmark PR.

Risks and limitations

Stack and review order

AI assistance and human ownership

AI assistance was used for research, implementation, benchmark analysis,
review, and drafting (Anthropic Claude and OpenAI Codex).

This body and the current code were prepared by code agents. @haosdent has not
yet attested to a line-by-line human review. This PR must remain a draft until
a human reviews every changed line, reviews or reruns the reported build and
measurements, understands the topology/reduction-order risks and overlap with
vllm-project#44891/vllm-project#50505, and explicitly takes responsibility for the contribution.

Cudagraph-captured TP8 A100 NVLink measurements show one-shot remains faster above the existing 256 KiB limit, with the crossover occurring above 448 KiB and below 464 KiB. Use the measured inclusive 448 KiB bound only on exact SM80 at world size 8, while preserving every other architecture and world-size policy.

Keep the policy in constexpr helpers with compile-time architecture and boundary assertions, and expose the automatic path in the communicator benchmark so its runtime selection can be compared with forced one-shot and two-shot launches.

Signed-off-by: haosdent <haosdent@gmail.com>

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Co-authored-by: OpenAI Codex <noreply@openai.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use /ci run or /ci retry. New commits do not start CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@haosdent

haosdent commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft on duplicate/value grounds rather than republishing its malformed trailer commit. Upstream vllm-project#44891 gives non-SM100 architectures (including SM80) a higher-priority TP8 push-allreduce path through 512 KiB, which intercepts this draft’s entire measured 256–448 KiB region on the target fully connected A100 topology. Revisit only with evidence for the fallback case where push AR is disabled or unavailable.

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