已合并
迁移symm/trmm/planarComplex/950gmmGelu至examples目录 #1109
sunhao_hw创建于 7 天前
迁移symm/trmm/planarComplex/950gmmGelu至examples目录 #1109
已合并
sunhao_hw创建于 7 天前
sunhao_hw成员
7 天前

描述

涉及样例:

  • experimental/gmm/grouped_matmul_slice_m_gelu
  • experimental/matmul/planar_complex_matmul
  • experimental/matmul/symm
  • experimental/matmul/trmm

optest/atk测试交付件均完备

关联的Issue

原因

测试

基于开源社区精度标准泛化自验,精度通过

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 sunhao_hw 的贡献)
Ssunhao_hw成员
7 天前 创建了 pull request,commit 2f4b9c08
atomgit-bot
atomgit-bot
7 天前 评论:

变更摘要

本 PR 主要将 symmtrmmplanar_complex_matmulgrouped_matmul_slice_m_gelu 等示例迁移到 examples 目录下带编号的子目录中,并同步调整相关路径、参数解析与测试用例。核心改动包括:简化 planar_complex_matmul.cpp 的命令行参数解析、更新示例内部依赖的数据路径、为多个测试文件补充许可证头,以及在 test_example.py 中集成新迁移的示例用例。

主要改动

  • 示例目录迁移与重命名:将 symmtrmmplanar_complex_matmulgrouped_matmul_slice_m_gelu 相关文件迁移并重命名为 examples/75_symmexamples/76_trmmexamples/77_planar_complex_matmulexamples/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_matmulascend950_grouped_matmul_slice_m_gelu.cppdatapath./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_symm76_trmm77_planar_complex_matmul 加入 normal_cases_2201,同时补全了 102_dynamic_optimized_matmul103_dynamic_optimized_quant_matmul_per_token_basic 之间缺失的逗号。

  • 补充许可证头与格式清理:为 test_71_ascend950_fp8_mx_grouped_matmul_finalize_routing_no_deter.pytest_76_trmm.pytest_77_planar_complex_matmul.pytest_80_grouped_matmul_slice_m_gelu.py 等测试文件添加 Copyright 许可证头,并清理了 test_80_grouped_matmul_slice_m_gelu.py 中的多余空行。

likedislike
atomgit-bot
atomgit-bot
7 天前 评论:

代码审查

审查结论

共报告 5 个问题:P0 × 1P1 × 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

⛔ 需要修改

likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
7 天前 添加了label:stat/needs-squash
此处折叠了75条消息 查看更多
longjihui
longjihui成员
6 天前 评论:

/lgtm

likedislike
yuantao
yuantao成员
6 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
6 天前 合入了pull request
CANN-robot
CANN-robot成员
6 天前 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike