Skip to content

feat(issue2): NVSwitch intranode AllReduce switching threshold model - #20

Open
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue2-nvswitch-allreduce-threshold
Open

feat(issue2): NVSwitch intranode AllReduce switching threshold model#20
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue2-nvswitch-allreduce-threshold

Conversation

@xyaohubery

Copy link
Copy Markdown

Summary

Quantitative analysis of three intranode AllReduce implementations with automatic switching threshold model, addressing Issue #2.

Three Algorithms Compared

Algorithm Mechanism SM Usage Best For
One-Shot AllGather + Local Reduce 0 SM < 16KB
NVLS (Multimem) NVSwitch hardware reduction 0 SM 16KB - 1GB+
P2P Reduce-Scatter + AllGather on SM 1-3 SMs Never (NVLS better)

Key Findings

Size       One-Shot     NVLS         P2P          Best
4KB        0.1us        0.0us        0.9us        NVLS (0 SM)
64KB       0.9us        0.1us        14.6us       NVLS (0 SM)
1MB        15.2us       2.0us        233.7us      NVLS (0 SM)
16MB       242.8us      32.6us       3739.7us     NVLS (0 SM)
256MB      3885.2us     522.0us      20293.1us    NVLS (0 SM)

NVLS saves ~12% of total SMs vs P2P while being 3-40x faster.

Usage

python nvswitch_threshold_model.py --analyze
python nvswitch_threshold_model.py --decision-model --output thresholds.json

🤖 Generated with Claude Code

Quantitative comparison of three intranode AllReduce implementations:
- One-Shot (AllGather + Local Reduce)
- Two-Shot Multimem/NVLS (NVSwitch hardware reduction)
- Two-Shot P2P (Reduce-Scatter + AllGather on GPU SMs)

Builds switching threshold model to auto-select optimal algorithm.

Key finding: NVLS is always best when NVSwitch is available,
saving ~12% of total SMs vs P2P and reducing latency 3-40x.

Co-Authored-By: Claude <noreply@anthropic.com>
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