Files
xtrain/docs/known-issues.md
Gahow Wang c87a0bc44e docs: known-issues / perf backlog — KI-1 DDP weak scaling at small global batch
Surfaced by v2 (world=4, global_batch=32): ~3593 tok/s, no speedup vs v1
single-GPU. Root cause + proposed fixes recorded; also consolidates deferred
T7 items (bf16, activation recompute) and the large-vocab modeling note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 19:56:58 +08:00

39 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# xtrain — Known Issues & Perf Backlog
已知问题(性能 / 正确性 / 建模)与延后项的活文档:记录现象、复现、根因、拟修复、优先级、状态。
发现即记,修复即标 `FIXED`(附 commit
---
## Open
### KI-1 · DDP 弱扩展性small global batch— `P1` · 由 v2 暴露
- **现象**4 卡 DDP 仅 ~3593 tok/s几乎不快于 v1 单卡 ~3310 tok/s≈1.08×远低于近线性T8 在 tiny 规模为 3.0×@4)。
- **复现**v2 训练 `dim384/12L, world=4, global_batch=32每卡 8, seq 256`
- **根因**:每个 step 对**全部参数梯度**做一次 NCCL all-reduce 是固定开销;`global_batch` 太小 → 每卡 compute 太少 → 通信/同步开销占比过高,吃掉扩展性。
- **拟修复**
1. 显著加大 `global_batch`(每卡 batch ↑:摊薄 all-reduce、喂饱 GPU—— v3 先用此缓解;
2. 梯度 all-reduce **分桶 + 与 backward 重叠**bucketed / overlapped all-reduce
3. 减少 per-step 同步点(与 KI-2/KI 性能项协同)。
- **参考**[docs/07-distributed.md](07-distributed.md)、[docs/06-performance.md](06-performance.md)。
---
## Deferred来自 T7放大后重启
### KI-2 · bf16 混合精度fp32 master— `deferred`
- T7 延后理由tiny 规模延迟瓶颈、bf16 改变数值会威胁 fp32 正确性闸门。
- **重启条件**模型放大v2+ `dim≥384`)后 GEMM 渐成 compute-boundtensor-core 收益显现。需 fp32 master weights + 单独 looser-tol 测试 + 收敛对比。
### KI-3 · 激活重计算gradient checkpointing— `deferred`
- T7 延后理由:单序列、显存不紧。
- **重启条件**:更大模型 / 更长 seq / 更大 batch 后显存成约束。
---
## Modeling notes
### KI-4 · 大词表 embedding 占比过高
- gpt2 `vocab=50257` 在 dim 小时让 embed+lm_head 主导参数v1 25.7M/34M、v2 38.6M/66.9Mcore transformer 才是学习主体。
- 后续可考虑更贴合 TinyStories 的小 vocab会牺牲 xserv gpt2-tokenizer 复用);或在更大 dim 下让 core 自然成为主体(继续 scaling 即可缓解占比)。