Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/code/issue10/README-2026.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Issue 10 单机可完成部分:离线标定与在线选择器

`selector_2026.py` 读取如下 CSV:

```text
collective,topology,world_size,message_bytes,algorithm,protocol,latency_us
```

它会在每个 `collective × topology × world_size × message size` 点选择最快的
算法/协议,把连续相同选择压缩为消息区间,并生成可在线查询的 JSON 选择表。

本机先用明确标记的合成数据验证 Tree(小消息)、Ring(中消息)、NVLS(大消息)
三段切换和混合负载统计:

```bash
python -m pytest src/code/issue10/test_selector_2026.py
python src/code/issue10/selector_2026.py --synthetic-demo
```

真实验收时,把 `nccl-tests` 在目标 NVSwitch 拓扑上采集的数据整理成上述 CSV,再运行:

```bash
python src/code/issue10/selector_2026.py --calibration path/to/nccl_calibration.csv
```

合成结果只验证选择器逻辑,不构成性能结论。最终报告必须使用独立于标定集的混合消息
trace 做验证,避免用训练数据自证收益。

152 changes: 152 additions & 0 deletions src/code/issue10/results-2026/mixed_workload_evaluation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
[
{
"collective": "all_gather",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"message_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072,
262144,
524288,
1048576,
2097152,
4194304,
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
],
"dynamic_total_us": 6930.745453714286,
"fixed_choices": [
{
"algorithm": "NVLS",
"protocol": "Simple",
"total_us": 7165.213380266667,
"dynamic_improvement": 0.03272309059184708
},
{
"algorithm": "Ring",
"protocol": "Simple",
"total_us": 14343.868672000002,
"dynamic_improvement": 0.5168147720674917
},
{
"algorithm": "Tree",
"protocol": "LL",
"total_us": 98861.48070400002,
"dynamic_improvement": 0.9298943794452609
}
],
"warning": "in-sample selector self-check; collect a separate validation trace for acceptance"
},
{
"collective": "all_reduce",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"message_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072,
262144,
524288,
1048576,
2097152,
4194304,
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
],
"dynamic_total_us": 7533.418971428571,
"fixed_choices": [
{
"algorithm": "NVLS",
"protocol": "Simple",
"total_us": 7788.275413333334,
"dynamic_improvement": 0.03272309059184719
},
{
"algorithm": "Ring",
"protocol": "Simple",
"total_us": 15591.161600000001,
"dynamic_improvement": 0.5168147720674917
},
{
"algorithm": "Tree",
"protocol": "LL",
"total_us": 107458.1312,
"dynamic_improvement": 0.9298943794452609
}
],
"warning": "in-sample selector self-check; collect a separate validation trace for acceptance"
},
{
"collective": "reduce_scatter",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"message_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072,
262144,
524288,
1048576,
2097152,
4194304,
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
],
"dynamic_total_us": 7156.748022857142,
"fixed_choices": [
{
"algorithm": "NVLS",
"protocol": "Simple",
"total_us": 7398.861642666667,
"dynamic_improvement": 0.03272309059184719
},
{
"algorithm": "Ring",
"protocol": "Simple",
"total_us": 14811.60352,
"dynamic_improvement": 0.5168147720674917
},
{
"algorithm": "Tree",
"protocol": "LL",
"total_us": 102085.22464,
"dynamic_improvement": 0.9298943794452609
}
],
"warning": "in-sample selector self-check; collect a separate validation trace for acceptance"
}
]
161 changes: 161 additions & 0 deletions src/code/issue10/results-2026/selection_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"schema_version": 1,
"tables": [
{
"collective": "all_gather",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"intervals": [
{
"min_message_bytes": 0,
"max_message_bytes": 185363,
"algorithm": "Tree",
"protocol": "LL",
"calibrated_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072
]
},
{
"min_message_bytes": 185364,
"max_message_bytes": 5931641,
"algorithm": "Ring",
"protocol": "Simple",
"calibrated_sizes": [
262144,
524288,
1048576,
2097152,
4194304
]
},
{
"min_message_bytes": 5931642,
"max_message_bytes": null,
"algorithm": "NVLS",
"protocol": "Simple",
"calibrated_sizes": [
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
]
}
]
},
{
"collective": "all_reduce",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"intervals": [
{
"min_message_bytes": 0,
"max_message_bytes": 185363,
"algorithm": "Tree",
"protocol": "LL",
"calibrated_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072
]
},
{
"min_message_bytes": 185364,
"max_message_bytes": 5931641,
"algorithm": "Ring",
"protocol": "Simple",
"calibrated_sizes": [
262144,
524288,
1048576,
2097152,
4194304
]
},
{
"min_message_bytes": 5931642,
"max_message_bytes": null,
"algorithm": "NVLS",
"protocol": "Simple",
"calibrated_sizes": [
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
]
}
]
},
{
"collective": "reduce_scatter",
"topology": "synthetic-nvswitch-8gpu",
"world_size": 8,
"intervals": [
{
"min_message_bytes": 0,
"max_message_bytes": 185363,
"algorithm": "Tree",
"protocol": "LL",
"calibrated_sizes": [
1024,
2048,
4096,
8192,
16384,
32768,
65536,
131072
]
},
{
"min_message_bytes": 185364,
"max_message_bytes": 5931641,
"algorithm": "Ring",
"protocol": "Simple",
"calibrated_sizes": [
262144,
524288,
1048576,
2097152,
4194304
]
},
{
"min_message_bytes": 5931642,
"max_message_bytes": null,
"algorithm": "NVLS",
"protocol": "Simple",
"calibrated_sizes": [
8388608,
16777216,
33554432,
67108864,
134217728,
268435456,
536870912,
1073741824
]
}
]
}
]
}
Loading