docs: 更新优化路线(PR#1 三项新优化)、提交记录、竞品分析

This commit is contained in:
2026-06-15 14:36:34 +08:00
parent 22c91a9522
commit cfacfda64e
+22 -11
View File
@@ -179,13 +179,20 @@ Baseline 数据:推理 229sAUC 0.759PCOC 1.110,得分 25.85。
2.**FP16 量化**`model.half()`Embedding 保留 FP32152s 2.**FP16 量化**`model.half()`Embedding 保留 FP32152s
3.**Flash Attention** — 替换 `scaled_dot_product``F.scaled_dot_product_attention`94.5s 3.**Flash Attention** — 替换 `scaled_dot_product``F.scaled_dot_product_attention`94.5s
4.**inference_mode()** — 替代 `no_grad()`92.5s+2s 小幅提升) 4.**inference_mode()** — 替代 `no_grad()`92.5s+2s 小幅提升)
8.**Expert 权重相似度合并** — 余弦相似度 >0.90 的 expert 合并(权重平均),86.5s 5.**SMoE 消除 GPU 同步** — 移除 mask.any()64 次 GPU→CPU 同步/forward),88.1s
9. **torch.compile** — 四种模式全验证(reduce-overhead/default/Expert default/dynamic),均反效果 6. **Expert 权重相似度合并** — 余弦相似度 >0.90 的 expert 合并(权重平均),86.5s
10. **MoE Top-1 gating** — PCOC 炸毁,已回退 7. **稠密向量化 MoE** — einsum 并行算 8 个 expert + gather 选取,消除 nonzero 同步(PR #1
11. **2:4 结构化稀疏** — 两次尝试(全局/Expert 级)均炸 PCOC 8. **RepEncoder 融合查表** — 28 slot 值拼成一条做单次 segment_reduce,减 per-batch kernel 启动(PR #1
12. **INT8 量化** — CUDA 后端不支持,异常 9. **Searchsorted 因果 mask** — 替代 repeat_interleave(张量repeats),消除最后同步点(PR #1
10.**过滤无关用户** — 跳过不含测试样本的用户,省算力(PR #1
11.**torch.compile** — 四种模式全验证,均反效果。CONFIG 默认 compile=false(注释:实测慢5×)
12.**MoE Top-1 gating** — PCOC 炸毁
13.**2:4 结构化稀疏** — 两次尝试均炸 PCOC
14.**INT8 量化** — CUDA 后端不支持
15.**varlen attention** — 本地 10.3s 但评测端 148s(慢 65%),已回退
16.**FlexAttention** — 比 SDPA 慢,未启用
CUDA Graph / torch.compile / 2:4 稀疏 / INT8 均已评估并放弃。 已验证无效/失败:torch.compile(×4)、2:4 稀疏(×2)、MoE k=1(×2)、INT8、varlen attention、FlexAttention
## 关键文件 ## 关键文件
@@ -206,10 +213,14 @@ CUDA Graph / torch.compile / 2:4 稀疏 / INT8 均已评估并放弃。
| 日期 | 提交次数 | 得分 | AUC | PCOC | 耗时 | 优化手段 | 备注 | | 日期 | 提交次数 | 得分 | AUC | PCOC | 耗时 | 优化手段 | 备注 |
|------|----------|------|-----|------|------|----------|------| |------|----------|------|-----|------|------|----------|------|
| 06/14 | 17 | **58.86** | 0.7526 | 1.059 | 86.5s | + Expert 相似度合并 | **当前最优** | | 06/15 | 19 | ? | ? | ? | ? | PR#1: 稠密MoE+融合查表+syncfree mask | 评测中 |
| 06/15 | 18 | 58.38 | 0.7526 | 1.059 | 88.5s | 旧版回退 | |
| 06/14 | 17 | **58.86** | 0.7526 | 1.059 | 86.5s | + Expert 相似度合并 | |
| 06/14 | 16 | 55.19 | 0.7526 | 1.059 | 102.2s | + Expert 合并 th=0.97 | 阈值过高 | | 06/14 | 16 | 55.19 | 0.7526 | 1.059 | 102.2s | + Expert 合并 th=0.97 | 阈值过高 |
| 06/13 | 10 | 58.49 | 0.7526 | 1.059 | 88.1s | + SMoE 消除 GPU 同步 | |
| 06/13 | 9 | 51.42 | 0.7525 | 1.059 | 118.4s | + compile(default) | 反效果 |
| 06/12 | 8 | 0 | 0.736 | 2.075 | 119.6s | MoE k=1 + compile | PCOC 炸毁 |
| 06/12 | 6 | 56.98 | 0.7526 | 1.059 | 94.5s | + Flash Attention | |
| 06/12 | 3 | 43.55 | 0.7525 | 1.059 | 152s | + FP16 量化 | | | 06/12 | 3 | 43.55 | 0.7525 | 1.059 | 152s | + FP16 量化 | |
### 竞品参考
| 用户 | 最高分 | 耗时 | AUC | PCOC |
|------|--------|------|-----|------|
| qianban139 | **67.87** | 47.9s | 0.7525 | 1.059 |