From c5fee2da9ba715f3000793b48e15f636637551c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Fri, 12 Jun 2026 21:55:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B7=AF=E7=BA=BF=E5=92=8C=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=88Flash=20Attention=2056.98=20=E5=88=86,=2094.5s?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bd90085..5e5b916 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -104,13 +104,13 @@ score_all = score_latency * 70 + score_model * 30 Baseline 数据:推理 229s,AUC 0.759,PCOC 1.110,得分 25.85。 -1. **接口对齐**(必须先做)— 确认能在评测系统跑通(得分 > 0) -2. **FP16 量化** — `model.half()`,Embedding 保留 FP32,预期 229s → ~120s -3. **Flash Attention** — 替换 `scaled_dot_product` 为 `F.scaled_dot_product_attention`,数学等价 -4. **torch.compile** — `mode="reduce-overhead"` → `"max-autotune"`,build_env.sh 中预热 -5. **数据流优化** — 缓存时预转 FP16 + 预搬到 GPU -6. **MoE 优化** — 统计 expert 负载,合并/移除低频 expert -7. **INT8 量化**(可选)— 精度风险较高,仅在前几步不够时尝试 +1. ✅ **接口对齐** — 确认能在评测系统跑通(得分 > 0) +2. ✅ **FP16 量化** — `model.half()`,Embedding 保留 FP32,152s +3. ✅ **Flash Attention** — 替换 `scaled_dot_product` 为 `F.scaled_dot_product_attention`,94.5s +4. 🔲 **torch.compile** — `mode="reduce-overhead"`,待验证 +5. 🔲 **数据流优化** — 缓存时预转 FP16 + 预搬到 GPU +6. 🔲 **MoE 优化** — 统计 expert 负载,合并/移除低频 expert +7. 🔲 **INT8 量化**(可选)— 精度风险较高,仅在前几步不够时尝试 CUDA Graph 已评估并放弃(batch 形状不固定,不适用)。 @@ -133,4 +133,5 @@ CUDA Graph 已评估并放弃(batch 形状不固定,不适用)。 | 日期 | 提交次数 | 得分 | AUC | PCOC | 耗时 | 优化手段 | 备注 | |------|----------|------|-----|------|------|----------|------| +| 06/12 | 6 | **56.98** | 0.7526 | 1.059 | 94.5s | + Flash Attention | build_env.sh 预热脚本导致第5次异常 | | 06/12 | 3 | **43.55** | 0.7525 | 1.059 | 152s | 接口对齐 + FP16 量化 | 第 1、2 次因 requirements.txt 异常 |