Closed
[Task|任务跟踪]: 移除 ops/pypto_pro/deepseek_v4_1 冗余 jit 算子树(pro 交付形态全量覆盖) #433
sunhaoxuan2024Add on  3 days agoClosed at  3 days ago
sunhaoxuan2024
sunhaoxuan2024Collaborators
3 days ago Create

背景

ops/pypto_pro/deepseek_v4_1 保存 DeepSeek V4.1 IFA 算子的 jit-only 原型形态;ops/pro/deepseek_v4_1 在同一批 kernel 基础上增加了 aclnn 支持(op_host tiling/infershape、torch_extension、aclnn_bridge、CMake 交付链),并保留 JIT 直调路由(GYM_TEST_MODE=jit),为完整超集。

目标

  1. 删除冗余的 jit-only 树(14 个算子),统一以 ops/pro/deepseek_v4_1 为唯一维护入口
  2. 保留 9 个算子的 DESIGN.md / RESULTS.md 设计与验证文档(迁入 pro 树)
  3. 保留 quant_lightning_indexer 的 golden 资产并修正 routes 测试的 BASE 路径
  4. 同步 README 表格与文档中的路径引用

验收标准

  • pro 树覆盖原 14 个算子的全部用例(254 个相同用例两侧对比验证)
  • 文档与 golden 资产不丢失
  • 删除后仓库引用无断链(pytest 收集验证)

验证数据见评论区。

likedislike
sunhaoxuan2024sunhaoxuan2024Collaborators
3 days ago Associated pull request
sunhaoxuan2024
sunhaoxuan2024Collaborators
3 days ago Comments:

验证数据:删除 ops/pypto_pro/deepseek_v4_1 的依据

1. 覆盖性:14/14 算子全有 pro 对应且验证过(共 254 个相同用例)

验证方式 算子 结果
两侧各自原生测试(8 算子 111 用例) mhc_pre_fuse / attn_prologue / kv_compress_epilog_v2 / mhc_post_fwd / engram_hash / indexer_prologue_k / indexer_prologue_qw / mixed_quant 全绿;mixed_quant pro 侧 13/13,原 jit 侧 4/13 精度失败(基线自身问题)
jit 侧适配后互跑(3 算子 42 用例) engram_gate / engram_gate_bwd / compressor_v2 两侧全绿(jit 侧需移除已废弃的 enable_slice 接口)
kernel 交换 A/B(3 算子 119 用例) attn_epilogue↔atten_epilogue / quant_lightning_indexer / quant_sparse_lightning_indexer pro kernel 功能精度全部通过;个别白盒用例窥探旧实现内部属性不适用(非功能问题);quant_lightning pro routes 69/69 全过

2. msprof 性能对比(NPU kernel 时间,Ascend950DT,CANN 9.3.0)

算子 用例 jit 侧 pro 侧 Δ
mhc_pre_fuse 5 451.1us 462.9us +2.6%
attn_prologue 6 558.5us 572.2us +2.4%
kv_compress_epilog_v2 15 54.9us 59.3us +8%(≈0.3us/次)
mhc_post_fwd 14 1397.6us 1406.7us +0.7%
engram_hash 29 497.9us 119.0us -76%(4.2 倍提升)
indexer_prologue_k 60 954.6us 936.1us -1.9%
engram_gate_bwd 12 4095.1us 4091.8us -0.1%
compressor_v2 25 824.2us(50次) 843.3us(54次) 按次持平,vector 段 -18.6%
attn_epilogue 45 中位 48.0us/次 中位 46.5us/次 持平
quant_lightning_indexer 12 597.5us 518.2us 主 kernel -13%
quant_sparse_lightning 62 18.2us/次 18.8us/次 持平
mixed_quant_mla 13 270.7us(4 用例算错) 512.0us(13/13 正确) 基线不可比

结论:pro 的修改没有造成 JIT 路径性能劣化(大 kernel 全部持平,engram_hash 显著优化,仅 us 级小 kernel 有固定 launch 开销)。

3. 删除后仓库完整性

  • pro 树 pytest 收集 331 个用例无断链(4 个依赖构建产物的 binding 测试文件状态与删除前一致)
  • quant_lightning_indexer routes 69/69 通过(golden 资产迁移 + BASE 路径修正后)
  • 设计/验证文档(DESIGN/RESULTS 18 个文件)与 golden 资产已迁入 pro 树

采集方式:msprof --type=all,跑一侧时移走另一侧目录避免同名模块串扰。

likedislike
sunhaoxuan2024sunhaoxuan2024Collaborators
3 days ago Assign sunhaoxuan2024 as responsible person
wangzheng97
wangzheng97Collaborators
3 days ago Comments:

!1132 已合入 master。感谢贡献,关闭此 Issue。

likedislike
wangzheng97wangzheng97Collaborators
3 days ago Close issue
wangzheng97wangzheng97Collaborators
3 days ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
3 days ago Added label: resolved