sccl: drive allreduce tests via torch.distributed; reorganize into tests/sccl/

Convert the multidevice allreduce correctness + latency/buffer-kind sweeps
to run through the real PyTorch-distributed path
(init_process_group(backend="ahbm") -> mp.spawn -> dist.all_reduce) instead
of direct ctx.launch, and reorganize the CCL/allreduce tests into a
tests/sccl/ package split one test per file.

Production change (required for the distributed path on non-square SIP grids):
- AhbmCCLBackend now reads explicit system.sips.w/h from the spec, with a
  square-only sqrt fallback that raises on ambiguity, instead of silently
  guessing round(sqrt(count)). This fixes the 2x3 / 3x2 torus + mesh cases,
  which previously resolved to a wrong 2x2 grid. Mirrors the test helper's
  _sip_topo_dims precedence (explicit w/h > square fallback > raise).

Test reorganization (tests/sccl/):
- _allreduce_helpers.py: shared plumbing (distributed driver, config writers,
  direct-launch run_allreduce parity reference, sweep/buffer-kind constants,
  plot aggregators, topology-diagram + FSIM-comparison emitters).
- test_allreduce_ring_torus_mesh.py: correctness across ring/torus/mesh.
- test_distributed_default_topology.py: full distributed path on topology.yaml.
- test_plot_latency_sweep.py / test_plot_buffer_kind_sweep.py: sweep rows.
- test_plot_topology_diagram.py / test_plot_comparison_fsim.py: plot emitters.
- test_intercube_root_center.py: moved in (ADR-0032 center-root latency guard).

Also:
- Move the FSIM comparison plot generator out of scripts/ into the sccl suite.
- Delete superseded test files (test_allreduce_multidevice,
  test_distributed_lrab_hierarchical_allreduce, test_allreduce_buffer_kind_sweep)
  and repoint conftest aggregators + the ipcq buffer-kind importers.
- Regenerate the allreduce_latency_plots derived artifacts from the full sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 22:24:43 -07:00
parent ff7d727ddd
commit b610cb0d9a
22 changed files with 745 additions and 759 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

@@ -1,13 +1,13 @@
buffer_kind,sip_topology,n_sips,n_elem,bytes_per_pe,latency_ns
hbm,torus_2d,6,128,256,2120.0399999999754
hbm,torus_2d,6,1024,2048,2716.74499999995
hbm,torus_2d,6,8192,16384,7315.185000000081
hbm,torus_2d,6,32768,65536,23081.265000008738
sram,torus_2d,6,128,256,2060.0399999999754
sram,torus_2d,6,1024,2048,2908.74499999995
sram,torus_2d,6,8192,16384,9523.185000000081
sram,torus_2d,6,32768,65536,32201.265000008752
tcm,torus_2d,6,128,256,1964.0399999999754
tcm,torus_2d,6,1024,2048,2476.74499999995
tcm,torus_2d,6,8192,16384,6403.185000000081
tcm,torus_2d,6,32768,65536,19865.265000008738
hbm,torus_2d,6,128,256,2120.040000000012
hbm,torus_2d,6,1024,2048,2717.2783333333473
hbm,torus_2d,6,8192,16384,7315.184999999989
hbm,torus_2d,6,32768,65536,23081.26500000037
sram,torus_2d,6,128,256,2060.040000000012
sram,torus_2d,6,1024,2048,2909.2783333333473
sram,torus_2d,6,8192,16384,9523.184999999869
sram,torus_2d,6,32768,65536,32201.265000000385
tcm,torus_2d,6,128,256,1964.040000000012
tcm,torus_2d,6,1024,2048,2477.2783333333473
tcm,torus_2d,6,8192,16384,6403.185000000109
tcm,torus_2d,6,32768,65536,19865.265000000378
1 buffer_kind sip_topology n_sips n_elem bytes_per_pe latency_ns
2 hbm torus_2d 6 128 256 2120.0399999999754 2120.040000000012
3 hbm torus_2d 6 1024 2048 2716.74499999995 2717.2783333333473
4 hbm torus_2d 6 8192 16384 7315.185000000081 7315.184999999989
5 hbm torus_2d 6 32768 65536 23081.265000008738 23081.26500000037
6 sram torus_2d 6 128 256 2060.0399999999754 2060.040000000012
7 sram torus_2d 6 1024 2048 2908.74499999995 2909.2783333333473
8 sram torus_2d 6 8192 16384 9523.185000000081 9523.184999999869
9 sram torus_2d 6 32768 65536 32201.265000008752 32201.265000000385
10 tcm torus_2d 6 128 256 1964.0399999999754 1964.040000000012
11 tcm torus_2d 6 1024 2048 2476.74499999995 2477.2783333333473
12 tcm torus_2d 6 8192 16384 6403.185000000081 6403.185000000109
13 tcm torus_2d 6 32768 65536 19865.265000008738 19865.265000000378
Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

@@ -1,37 +1,37 @@
algorithm,sip_topology,n_sips,n_elem,bytes_per_pe,bytes_per_sip,latency_ns
intercube_allreduce,mesh_2d_no_wrap,6,8,16,256,2666.5524999999725
intercube_allreduce,mesh_2d_no_wrap,6,32,64,1024,2747.7399999999725
intercube_allreduce,mesh_2d_no_wrap,6,64,128,2048,2855.98999999998
intercube_allreduce,mesh_2d_no_wrap,6,128,256,4096,3072.4899999999725
intercube_allreduce,mesh_2d_no_wrap,6,512,1024,16384,3336.579999999951
intercube_allreduce,mesh_2d_no_wrap,6,1024,2048,32768,3707.49999999992
intercube_allreduce,mesh_2d_no_wrap,6,2048,4096,65536,4449.339999999875
intercube_allreduce,mesh_2d_no_wrap,6,4096,8192,131072,5933.020000000055
intercube_allreduce,mesh_2d_no_wrap,6,8192,16384,262144,8900.380000000157
intercube_allreduce,mesh_2d_no_wrap,6,16384,32768,524288,14835.099999997583
intercube_allreduce,mesh_2d_no_wrap,6,32768,65536,1048576,26704.540000017492
intercube_allreduce,mesh_2d_no_wrap,6,49152,98304,1572864,38573.980000026335
intercube_allreduce,ring_1d,6,8,16,256,2365.2558333333036
intercube_allreduce,ring_1d,6,32,64,1024,2436.9433333333036
intercube_allreduce,ring_1d,6,64,128,2048,2532.526666666643
intercube_allreduce,ring_1d,6,128,256,4096,2723.6933333333036
intercube_allreduce,ring_1d,6,512,1024,16384,3042.0349999999544
intercube_allreduce,ring_1d,6,1024,2048,32768,3390.201666666597
intercube_allreduce,ring_1d,6,2048,4096,65536,4079.7349999998714
intercube_allreduce,ring_1d,6,4096,8192,131072,5458.801666666721
intercube_allreduce,ring_1d,6,8192,16384,262144,8216.93500000014
intercube_allreduce,ring_1d,6,16384,32768,524288,13733.201666664638
intercube_allreduce,ring_1d,6,32768,65536,1048576,24765.735000014545
intercube_allreduce,ring_1d,6,49152,98304,1572864,35798.268333355256
intercube_allreduce,torus_2d,6,8,16,256,1700.6024999999754
intercube_allreduce,torus_2d,6,32,64,1024,1753.2899999999754
intercube_allreduce,torus_2d,6,64,128,2048,1823.539999999979
intercube_allreduce,torus_2d,6,128,256,4096,1964.0399999999754
intercube_allreduce,torus_2d,6,512,1024,16384,2196.2849999999653
intercube_allreduce,torus_2d,6,1024,2048,32768,2476.74499999995
intercube_allreduce,torus_2d,6,2048,4096,65536,3037.664999999919
intercube_allreduce,torus_2d,6,4096,8192,131072,4159.50500000003
intercube_allreduce,torus_2d,6,8192,16384,262144,6403.185000000081
intercube_allreduce,torus_2d,6,16384,32768,524288,10890.544999998769
intercube_allreduce,torus_2d,6,32768,65536,1048576,19865.265000008738
intercube_allreduce,torus_2d,6,49152,98304,1572864,28839.985000013185
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,8,16,256,2666.552500000015
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,32,64,1024,2747.7400000000152
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,64,128,2048,2855.990000000018
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,128,256,4096,3072.490000000019
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,512,1024,16384,3337.1133333333582
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,1024,2048,32768,3708.0333333333692
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,2048,4096,65536,4449.873333333393
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,4096,8192,131072,5933.020000000124
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,8192,16384,262144,8900.379999999863
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,16384,32768,524288,14835.099999999224
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,32768,65536,1048576,26704.540000000765
lrab_hierarchical_allreduce,mesh_2d_no_wrap,6,49152,98304,1572864,38573.97999999701
lrab_hierarchical_allreduce,ring_1d,6,8,16,256,2365.255833333347
lrab_hierarchical_allreduce,ring_1d,6,32,64,1024,2436.9433333333473
lrab_hierarchical_allreduce,ring_1d,6,64,128,2048,2532.526666666683
lrab_hierarchical_allreduce,ring_1d,6,128,256,4096,2723.693333333349
lrab_hierarchical_allreduce,ring_1d,6,512,1024,16384,3048.635000000021
lrab_hierarchical_allreduce,ring_1d,6,1024,2048,32768,3393.4016666666957
lrab_hierarchical_allreduce,ring_1d,6,2048,4096,65536,4082.401666666714
lrab_hierarchical_allreduce,ring_1d,6,4096,8192,131072,5458.80166666677
lrab_hierarchical_allreduce,ring_1d,6,8192,16384,262144,8216.934999999943
lrab_hierarchical_allreduce,ring_1d,6,16384,32768,524288,13733.201666665835
lrab_hierarchical_allreduce,ring_1d,6,32768,65536,1048576,24765.73500000064
lrab_hierarchical_allreduce,ring_1d,6,49152,98304,1572864,35798.268333331536
lrab_hierarchical_allreduce,torus_2d,6,8,16,256,1700.6025000000095
lrab_hierarchical_allreduce,torus_2d,6,32,64,1024,1753.2900000000102
lrab_hierarchical_allreduce,torus_2d,6,64,128,2048,1823.540000000012
lrab_hierarchical_allreduce,torus_2d,6,128,256,4096,1964.040000000012
lrab_hierarchical_allreduce,torus_2d,6,512,1024,16384,2196.8183333333463
lrab_hierarchical_allreduce,torus_2d,6,1024,2048,32768,2477.2783333333473
lrab_hierarchical_allreduce,torus_2d,6,2048,4096,65536,3038.1983333333583
lrab_hierarchical_allreduce,torus_2d,6,4096,8192,131072,4159.5050000000665
lrab_hierarchical_allreduce,torus_2d,6,8192,16384,262144,6403.185000000109
lrab_hierarchical_allreduce,torus_2d,6,16384,32768,524288,10890.5449999995
lrab_hierarchical_allreduce,torus_2d,6,32768,65536,1048576,19865.265000000378
lrab_hierarchical_allreduce,torus_2d,6,49152,98304,1572864,28839.98500000059
1 algorithm sip_topology n_sips n_elem bytes_per_pe bytes_per_sip latency_ns
2 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 8 16 256 2666.5524999999725 2666.552500000015
3 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 32 64 1024 2747.7399999999725 2747.7400000000152
4 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 64 128 2048 2855.98999999998 2855.990000000018
5 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 128 256 4096 3072.4899999999725 3072.490000000019
6 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 512 1024 16384 3336.579999999951 3337.1133333333582
7 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 1024 2048 32768 3707.49999999992 3708.0333333333692
8 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 2048 4096 65536 4449.339999999875 4449.873333333393
9 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 4096 8192 131072 5933.020000000055 5933.020000000124
10 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 8192 16384 262144 8900.380000000157 8900.379999999863
11 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 16384 32768 524288 14835.099999997583 14835.099999999224
12 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 32768 65536 1048576 26704.540000017492 26704.540000000765
13 intercube_allreduce lrab_hierarchical_allreduce mesh_2d_no_wrap 6 49152 98304 1572864 38573.980000026335 38573.97999999701
14 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 8 16 256 2365.2558333333036 2365.255833333347
15 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 32 64 1024 2436.9433333333036 2436.9433333333473
16 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 64 128 2048 2532.526666666643 2532.526666666683
17 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 128 256 4096 2723.6933333333036 2723.693333333349
18 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 512 1024 16384 3042.0349999999544 3048.635000000021
19 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 1024 2048 32768 3390.201666666597 3393.4016666666957
20 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 2048 4096 65536 4079.7349999998714 4082.401666666714
21 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 4096 8192 131072 5458.801666666721 5458.80166666677
22 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 8192 16384 262144 8216.93500000014 8216.934999999943
23 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 16384 32768 524288 13733.201666664638 13733.201666665835
24 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 32768 65536 1048576 24765.735000014545 24765.73500000064
25 intercube_allreduce lrab_hierarchical_allreduce ring_1d 6 49152 98304 1572864 35798.268333355256 35798.268333331536
26 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 8 16 256 1700.6024999999754 1700.6025000000095
27 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 32 64 1024 1753.2899999999754 1753.2900000000102
28 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 64 128 2048 1823.539999999979 1823.540000000012
29 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 128 256 4096 1964.0399999999754 1964.040000000012
30 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 512 1024 16384 2196.2849999999653 2196.8183333333463
31 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 1024 2048 32768 2476.74499999995 2477.2783333333473
32 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 2048 4096 65536 3037.664999999919 3038.1983333333583
33 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 4096 8192 131072 4159.50500000003 4159.5050000000665
34 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 8192 16384 262144 6403.185000000081 6403.185000000109
35 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 16384 32768 524288 10890.544999998769 10890.5449999995
36 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 32768 65536 1048576 19865.265000008738 19865.265000000378
37 intercube_allreduce lrab_hierarchical_allreduce torus_2d 6 49152 98304 1572864 28839.985000013185 28839.98500000059