From 88178f0fe3176493a1b4f3ab23cf8d4bfcd9c09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Sun, 14 Jun 2026 12:24:48 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=92=8C=E4=BC=98=E5=8C=96=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=EF=BC=88Expert=20=E5=90=88=E5=B9=B6=2058.86=20=E6=9C=80?= =?UTF-8?q?=E4=BC=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1e84b88..0b41ec6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -179,13 +179,11 @@ Baseline 数据:推理 229s,AUC 0.759,PCOC 1.110,得分 25.85。 2. ✅ **FP16 量化** — `model.half()`,Embedding 保留 FP32,152s 3. ✅ **Flash Attention** — 替换 `scaled_dot_product` 为 `F.scaled_dot_product_attention`,94.5s 4. ✅ **inference_mode()** — 替代 `no_grad()`,92.5s(+2s 小幅提升) -5. ❌ **torch.compile** — 四种模式全验证(reduce-overhead/default/Expert default/dynamic),均反效果 -6. ❌ **MoE Top-1 gating** — PCOC 从 1.059 炸到 2.075,已回退 -7. ❌ **2:4 结构化稀疏** — 两次尝试(全局/Expert 级)均炸 PCOC,to_sparse_semi_structured 不兼容 -8. ❌ **INT8 量化** — CUDA 后端不支持,异常 -9. ✅ **SMoE 消除 GPU 同步** — 移除 mask.any()(64 次 GPU→CPU 同步/forward),88.1s -10. ✅ **CTRModel 去冗余 squeeze** — reshape().squeeze() → .squeeze()(微优化) -11. ❌ **RepEncoder 批量 embedding** — 94.3s vs 92.5s,略慢 +8. ✅ **Expert 权重相似度合并** — 余弦相似度 >0.90 的 expert 合并(权重平均),86.5s +9. ❌ **torch.compile** — 四种模式全验证(reduce-overhead/default/Expert default/dynamic),均反效果 +10. ❌ **MoE Top-1 gating** — PCOC 炸毁,已回退 +11. ❌ **2:4 结构化稀疏** — 两次尝试(全局/Expert 级)均炸 PCOC +12. ❌ **INT8 量化** — CUDA 后端不支持,异常 CUDA Graph / torch.compile / 2:4 稀疏 / INT8 均已评估并放弃。 @@ -208,11 +206,9 @@ CUDA Graph / torch.compile / 2:4 稀疏 / INT8 均已评估并放弃。 | 日期 | 提交次数 | 得分 | AUC | PCOC | 耗时 | 优化手段 | 备注 | |------|----------|------|-----|------|------|----------|------| -| 06/13 | 14 | 58.47 | 0.7526 | 1.059 | 88.1s | 回退到稳定版 | **最终提交** | -| 06/13 | 13 | 55.10 | 0.7525 | 1.059 | 102.6s | compile dynamic=True | 反效果 | -| 06/13 | 12 | 53.71 | 0.7524 | 1.059 | 108.6s | compile Expert default | 反效果 | -| 06/13 | 11 | 0 | 0.751 | 1.345 | 307.4s | 2:4 sparse Expert | ❌ 炸毁 | -| 06/13 | 10 | 58.49 | 0.7526 | 1.059 | 88.1s | + SMoE 消除 GPU 同步 | **当前最优** | +| 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/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 | |