Pull Request已成功合入, 合并人@CANN-robot
(感谢 sunhao_hw 的贡献)变更摘要
本 PR 主要将 symm、trmm、planar_complex_matmul、grouped_matmul_slice_m_gelu 等示例迁移到 examples 目录下带编号的子目录中,并同步调整相关路径、参数解析与测试用例。核心改动包括:简化 planar_complex_matmul.cpp 的命令行参数解析、更新示例内部依赖的数据路径、为多个测试文件补充许可证头,以及在 test_example.py 中集成新迁移的示例用例。
主要改动
-
示例目录迁移与重命名:将
symm、trmm、planar_complex_matmul、grouped_matmul_slice_m_gelu相关文件迁移并重命名为examples/75_symm、examples/76_trmm、examples/77_planar_complex_matmul、examples/80_ascend950_grouped_matmul_slice_m_gelu,对应的测试文件也同步重命名。 -
复用通用参数解析:
planar_complex_matmul.cpp删除了本地自定义的Options结构体及其Parse函数,改为using Options = GemmOptions;,统一复用通用的GemmOptions参数解析逻辑。 -
路径适配更新:
gen_data_compare.py中默认算子路径由planar_complex_matmul更新为77_planar_complex_matmul;ascend950_grouped_matmul_slice_m_gelu.cpp中datapath由./examples/grouped_matmul_slice_m_gelu/data/更新为./examples/80_ascend950_grouped_matmul_slice_m_gelu/data/。 -
测试用例集成:
test_example.py新增test_80_ascned950_grouped_matmul_slice_m_gelu测试,并将75_symm、76_trmm、77_planar_complex_matmul加入normal_cases_2201,同时补全了102_dynamic_optimized_matmul与103_dynamic_optimized_quant_matmul_per_token_basic之间缺失的逗号。 -
补充许可证头与格式清理:为
test_71_ascend950_fp8_mx_grouped_matmul_finalize_routing_no_deter.py、test_76_trmm.py、test_77_planar_complex_matmul.py、test_80_grouped_matmul_slice_m_gelu.py等测试文件添加 Copyright 许可证头,并清理了test_80_grouped_matmul_slice_m_gelu.py中的多余空行。


代码审查
审查结论
共报告 5 个问题:P0 × 1、P1 × 4。
| 优先级 | 文件 | 问题 |
|---|---|---|
| P0 | examples/77_planar_complex_matmul/planar_complex_matmul.cpp:37 | using Options = GemmOptions 丢失 dataPath 成员 → 编译失败 |
| P1 | examples/76_trmm/CMakeLists.txt:12-13 | target 名误写为 80_trmm → 测试找不到 76_trmm 二进制 |
| P1 | examples/CMakeLists.txt:145 | 77_planar_complex_matmul 未加入构建列表 → 不编译、测试失败 |
| P1 | tests/test_example.py:525 | gen_data.py 目录名 ascen950 拼写错误 → FileNotFoundError |
| P1 | tests/test_example.py:537 | 可执行名 ascen950 拼写错误 → FileNotFoundError |
总体风险评估:高。 本次迁移存在一处确定性的编译错误(一旦示例被编译即失败),以及多处会导致 CI 测试必然失败的命名/列表遗漏问题,需在合入前修复。
逐文件审查确认:
- examples/75_symm/CMakeLists.txt — 无问题(target 名
75_symm一致) - examples/75_symm/symm.cpp — 无问题(仅重命名,自包含生成数据)
- examples/76_trmm/CMakeLists.txt — 问题:target 名
80_trmm拼写错误 - examples/76_trmm/trmm.cpp — 无问题(仅重命名,参数契约与测试一致)
- examples/77_planar_complex_matmul/CMakeLists.txt — 无独立问题(改名一致)
- examples/77_planar_complex_matmul/gen_data_compare.py — 无问题(路径改名一致)
- examples/77_planar_complex_matmul/planar_complex_matmul.cpp — 问题:dataPath 缺失导致编译失败
- examples/80_ascend950_grouped_matmul_slice_m_gelu/CMakeLists.txt — 无问题(改名一致)
- examples/80_ascend950_grouped_matmul_slice_m_gelu/ascend950_grouped_matmul_slice_m_gelu.cpp — 无问题(datapath 改名正确)
- examples/80_ascend950_grouped_matmul_slice_m_gelu/gen_data.py — 无问题(仅重命名)
- examples/80_ascend950_grouped_matmul_slice_m_gelu/launcher/grouped_matmul_slice_m_gelu_launcher.h — 无问题(仅重命名)
- examples/CMakeLists.txt — 问题:缺少
77_planar_complex_matmul列表条目 - tests/optest/tests/test_71_ascend950_fp8_mx_grouped_matmul_finalize_routing_no_deter.py — 无问题(仅加 license 头)
- tests/optest/tests/test_75_symm.py — 无问题(仅重命名)
- tests/optest/tests/test_76_trmm.py — 无问题(仅加 license 头)
- tests/optest/tests/test_77_planar_complex_matmul.py — 无问题(仅加 license 头)
- tests/optest/tests/test_80_grouped_matmul_slice_m_gelu.py — 无问题(license 头 + 空行调整,无功能变更)
- tests/test_example.py — 问题:两处
ascen950拼写错误(并修复了原先 102/103 条目缺逗号的旧问题)
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 5 |
| 🟡 建议 | 0 |
⛔ 需要修改


/lgtm


/lgtm
/approve


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
涉及样例:
optest/atk测试交付件均完备
关联的Issue
原因
测试
基于开源社区精度标准泛化自验,精度通过
文档更新
类型标签