docs: T17 process-per-GPU results — measured throughput-neutral
Records the key empirical finding: process-per-GPU is statistically identical to thread-per-GPU at this scale (thread 5.27x vs proc 5.31x @8, <1% noise; all 8 GPUs 95-99% util). The residual ~5.3x@8 non-linearity is the NCCL/PCIe communication wall, NOT single-CUDA-context launch/cuBLAS serialization as the old KI-5/T11 note speculated — measurement falsifies that hypothesis (same methodology as T11 falsifying "bucket the all-reduce"). Correctness all green: proc==thread loss 1.5e-7, cross-rank 1.2e-7, full regression + xserv md5 b04fc9f9 identical. Closes the process-per-GPU backlog item (measured no-op); default training path unchanged. evolution.md Infra row + README T17 row + known-issues entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -128,9 +128,12 @@ thread-per-GPU 的残留非线性(KI-5 / T11 doc)来自:**N rank 线程共
|
||||
pool allocator 消掉了 malloc 这一最大笔,但 launch / cuBLAS 串行仍在,表现为 8 卡 ~5× 而非 ~8×。
|
||||
|
||||
process-per-GPU 下**每个 rank 是独立进程 → 独立 CUDA context → 独立 driver 状态**:各进程的 kernel
|
||||
launch / cuBLAS 调用**互不在同一 context 排队**,残留串行被结构性移除。这正是闸门 ③(before→after 线性度)
|
||||
要量出来的东西——若 process-per-GPU 把 8 卡从 ~5× 推到明显更高,即验证了根因诊断。**诚实原则**:若提升
|
||||
有限,如实报告(说明残留瓶颈转移到 NCCL all-reduce / PCIe 拓扑,那是另一层,非本任务 scope)。
|
||||
launch / cuBLAS 调用**互不在同一 context 排队**,残留串行(按此假设)应被结构性移除。这正是闸门 ③
|
||||
(before→after 线性度)要量出来的东西——若 process-per-GPU 把 8 卡从 ~5× 推到明显更高,即验证此假设。
|
||||
**诚实原则**:若提升有限,如实报告(说明残留瓶颈在 NCCL all-reduce / PCIe 拓扑,那是另一层,非本任务 scope)。
|
||||
|
||||
> ⚠️ **此假设被实测证伪**——见下方「实测结果 · 闸门 ③」:process-per-GPU 与 thread-per-GPU 吞吐统计上一致
|
||||
> (~5.3×@8 都一样),且 8 卡全 95–99% util。残留非线性是通信/PCIe 墙,不是单 context 串行。结论钉死、留档。
|
||||
|
||||
### ④ 训练 step / 一致性论证:原样复用 T8,零改动
|
||||
|
||||
@@ -206,7 +209,53 @@ CUDA_VISIBLE_DEVICES=0,1,2,3 cargo run -p xtrain-distributed --release --bin tra
|
||||
--dim 384 --heads 12 --head-dim 32 --layers 12 --ffn 1536 --steps 200 --batch 128 --seq 256
|
||||
```
|
||||
|
||||
实测数字回填见 xtrain.md T17 note / commit。
|
||||
实测数字见下方「实测结果」。
|
||||
|
||||
## 实测结果(dash5, 8× RTX 5090, sm_120)
|
||||
|
||||
### 正确性(闸门 ①②④ 全绿)
|
||||
|
||||
- **闸门 ① loss 对单卡 / 对 thread 路径**(`ddp_proc`, world=2,合成语料 20 步):
|
||||
proc-per-GPU vs single-GPU `max_rel = 5.67e-7`;**proc-per-GPU vs thread-per-GPU `max_rel = 1.5e-7`**
|
||||
(两条路径数值同量级,符合预期——只差进程/线程,sharding+all-reduce 同)。
|
||||
- **闸门 ② 跨 rank 参数**:`max|p0−p1| = 1.19e-7`(< 1e-6,KI-5 既有 ULP 容差,PCIe NCCL run-to-run 抖动)。
|
||||
- **闸门 ④ 全回归**:全 workspace `--test-threads=1` 全绿(autograd/structural/batched/bf16/recompute/
|
||||
overfit/AdamW/既有 DDP/flash/gqa/grad_accum/dropout)+ **xserv 闭环**:v3 ckpt 用 T17 代码重导
|
||||
safetensors 与 registry **md5 逐位一致 `b04fc9f9a0c9af04c47d9ca649aea12e`**(T17 不碰任何数值路径 → 必然一致)。
|
||||
|
||||
### 闸门 ③ 线性度 before→after —— **本任务的关键发现:process-per-GPU 在本尺度对吞吐中性**
|
||||
|
||||
固定每卡 batch 32 / dim384 / seq256 / 150 步(与 T11 KI-5 表同口径),steady-state tok/s:
|
||||
|
||||
| world | thread-per-GPU (`train_ddp`) | speedup | process-per-GPU (`train_ddp_mp`) | speedup |
|
||||
|---|---|---|---|---|
|
||||
| 1 | 93257 | 1.00× | 92952 | 1.00× |
|
||||
| 2 | 149747 | 1.61× | 148809 | 1.60× |
|
||||
| 4 | 278276 | 2.98× | 273308 | 2.94× |
|
||||
| 8 | **491360** | **5.27×** | **493128** | **5.31×** |
|
||||
|
||||
(world=8 重复 2 次确认非噪声:thread 493671/493292,proc 491102/494123——**两路差异 < 1%,落在 run-to-run 噪声内**。)
|
||||
|
||||
→ **process-per-GPU 与 thread-per-GPU 吞吐统计上一致(~5.3×@8 都一样)**。本 doc 设计假设 ③
|
||||
(「残留 5×@8 来自单 CUDA context 的 kernel-launch/cuBLAS 串行,process-per-GPU 给独立 context 即可移除」)
|
||||
**被实测证伪**——这正是 ③ 里预留的「诚实原则」分支。
|
||||
|
||||
**根因重定位(实测佐证)**:proc-per-GPU world=8 跑时 `nvidia-smi` 抽样 **8 卡全部 95–99% util**
|
||||
(每卡 ~23GB)——GPU **已 compute-bound 喂满、并非串行空转**(KI-5 当年「1–2/8 在忙」的串行病在 T11 的
|
||||
caching allocator 就已治好)。8 卡已满载却仍只 5.3×,缺的 ~35% 吞吐只能去向**每步 grad all-reduce +
|
||||
本机 PCIe-only 拓扑在 8 rank 下的通信开销**——即 T11 早已点明的「~7% all-reduce + 8 卡 PCIe 余量」那一层,
|
||||
在 8 卡下被放大。换独立 context 不动这一层,故吞吐不变。
|
||||
|
||||
**这与 T11 自身的方法论一致**:T11 实测证伪了「分桶 all-reduce」;T17 实测证伪了「process-per-GPU 解残留
|
||||
串行」。两次都靠 profile/measure 推翻假设而非硬上。**结论**:本尺度(dim384–1024、单机 8× PCIe RTX 5090)
|
||||
残留非线性是**通信/拓扑墙**,不是 launch 模型;要再逼近线性得动 all-reduce overlap / 更快互联(NVLink),
|
||||
那是另一条线,**非 T17 scope**。
|
||||
|
||||
**T17 的净价值(诚实记账)**:① 学到 / 落地了 torchrun 式 process-per-GPU 这条训练栈标准链路(独立进程 +
|
||||
独立 CUDA context + 跨进程 NCCL bootstrap)——**项目本职「学训练全栈」的目标达成**;② **实测把「process-per-GPU
|
||||
是残留非线性的解」这个长期挂在 KI-5/T11 doc 里的猜想钉死为「在本尺度无吞吐收益」**,移除一个误导性 backlog
|
||||
项;③ 正确性零回归、与 thread 路径数值对齐。**吞吐上它与 thread-per-GPU 等价**——故默认训练路径**不变**
|
||||
(thread-per-GPU 仍是 v1–v8 用的那条),process-per-GPU 作为并列可选路径 + 这条诊断结论留档。
|
||||
|
||||
## 不做(本任务范围外,记 follow-up)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user