Merged
fix MatmulImpl in docs and examples #4142
ruanyyAdd on Jul 7
fix MatmulImpl in docs and examples #4142
Merged
ruanyyAdd on Jul 7
ruanyyCollaborators
Jul 7

描述

修复代码以及文档中不应该出现的MatmulImpl

关联的Issue

测试

前冒烟测试

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for ruanyy's contribution.)
RruanyyCollaborators
Jul 7 Created pull request, commit 773a8f07
atomgit-bot
atomgit-bot
Jul 7 Comments:

变更摘要

此 PR 主要修复文档和示例代码中错误使用的 MatmulImpl 类名,将其统一替换为正确的 AscendC::Matmul,同时更新对应的头文件引用和编译宏定义,确保示例代码与实际 API 一致。

主要改动

  • 更正 MatMul API 类名:将 AscendC::MatmulImpl<...> 替换为 AscendC::Matmul<...>,消除示例代码中不应出现的旧类名。
  • 更新头文件引用:移除 #include "lib/matrix/matmul/matmul.h",改为 #include "lib/matmul_intf.h",匹配当前库的接口头文件路径。
  • 新增编译宏:在头文件包含前添加 #define ASCENDC_CUBE_ONLY,以适配仅使用 Cube 运算的 MatMul 接口编译要求。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Jul 7 Comments:

代码审查

审查总结

本次 PR 将文档和示例代码中的 MatmulImpl 统一替换为 Matmul,并同步更新了相关的头文件引用和宏定义。逐文件审查结论如下:

文件 审查结论
CubeResGroupHandle使用说明.md 无问题 — 仅 MatmulImpl → Matmul 一行替换
Matmul模板参数.md P3 — "函数原型"代码块仅剩 template 参数列表,缺少完整声明体
SetSubBlockIdx.md 无问题 — 新增 ASCENDC_CUBE_ONLY + matmul_intf.h,替换正确
Matmul高阶API使能NBuffer33模板.md 无问题 — MatmulImpl → Matmul,类型参数更新符合 MatmulType API
基础API迁移指导.md 无问题 — 仅 MatmulImpl → Matmul 一行替换
README.md(matmul_mxfp4) 无问题 — 仅文本中 MatmulImpl → Matmul 一处替换
matmul_s4.asc 无问题 — 头文件切换 + ASCENDC_CUBE_ONLY 定义位置符合文档规范

发现数统计:P0: 0,P1: 0,P2: 0,P3: 1。

整体风险判断:低风险。变更是一次清晰的 API 重命名(MatmulImpl → Matmul)传播到文档和示例代码,代码逻辑无改动,所有引用已全面清理(docs/ 和 examples/ 目录下已无残留的 MatmulImpl)。唯一的 P3 问题是文档展示形式上的可读性退化,不影响功能正确性。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Jul 7 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jul 7 Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
** ✅ gcw_kUomxQ2l, bluesky901 (2/2) ✅ gcw_kUomxQ2l (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

ruanyy, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
Jul 7 Set zengjuan,zhanghao_0689,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,bianque,houyuyang,shi_nanxiang,wuyang_hw,jiangxinyu3,munanhw,ai_xin,ascendhjh,DragonBornHD84,hyolee,gcw_kUomxQ2l,Andy-lb as approver
CANN-robotCANN-robotCollaborators
Jul 7 Set munanhw,ai_xin,gcw_kUomxQ2l,Andy-lb as approver
changxianyuCollaborators
Jul 7 Comments:

/approve

likedislike
CANN-robot
CANN-robotCollaborators
Jul 7 Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
changxianyu

likedislike
gao_dafaCollaborators
Jul 7 Comments:

ruanyy,感谢您的提交,建议在完成PR充分自验证后,再触发线上构建任务。

若您的PR已具备检视条件,可根据下表的责任田,@对应的committer进行代码检视,我们会在第一时间对您的提交进行处理。

代码责任田:

module committer
adv_api chenyiyuan, wuyang_hw
basic_api chenyiyuan, wuyang_hw
c_api pangfd, yue_mo_du_qian
cmake xun_zhuge, DragonBornHD84
docs munanhw, ai_xin
examples changxianyu, bianque
simt_api wulinyu, zhanghao_0689
scripts xun_zhuge, kevin365
tools YANXI_ZHAO, XuebinYang, sjtulxh

💡 如您不确定可以@谁,可以直接@我或者ascend-c sig的maintainer,xun_zhuge和ascendhjh,我们会为您分配合适的committer进行代码检视。

再次感谢您参与CANN的社区贡献。

likedislike
bluesky901Collaborators
Jul 7 Comments:

/lgtm

likedislike
CANN-robot
CANN-robotCollaborators
Jul 7 Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
changxianyu

likedislike
ruanyyCollaborators
Jul 8 Comments:

compile

likedislike
RruanyyCollaborators
Jul 8 Pre merge succeeded (commit_id: 94ad1f34143936ca2585a55ed0a8a6868fafe132)
CANN-robotCANN-robotCollaborators
Jul 8 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Jul 8 Comments:

流水线任务触发成功
任务链接 [cd50d9a746054274a0bb6b1d5d7a6de5][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ✅ SUCCESS >>>>> >>>>>

[2026-07-08 09:28:14]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Jul 8 Comments:

流水线任务触发成功
任务链接 [44ae3ccca4464e158271939d46a3e138][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>

[2026-07-08 09:22:03]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Jul 8 Comments:

流水线任务触发成功
任务链接 [efb2bf6b959f4a51b4496b785dc2dd07][流水线指导]

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
UT_Test_adv_test_one ✅ SUCCESS
UT_Test_adv_test_two ✅ SUCCESS
UT_Test_basic_test_two ✅ SUCCESS
UT_Test_basic_test_three ✅ SUCCESS
UT_Test_basic_test_four ✅ SUCCESS
UT_Test_basic_test_five ✅ SUCCESS
UT_Test_arm ✅ SUCCESS
UT_Test_report ✅ SUCCESS >>>>>

[2026-07-08 09:30:53]    CI执行结束

likedislike
CANN-robotCANN-robotCollaborators
Jul 8 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Jul 8 Added label: ci-pipeline-passed
liulun0308Collaborators
Jul 8 Comments:

/approve

likedislike
CANN-robot
CANN-robotCollaborators
Jul 8 Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
changxianyu

likedislike
CANN-robotCANN-robotCollaborators
Jul 8 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Jul 8 Merged pull request