已合并
fix(examples): 修复aclnn示例代码及接口文档问题 #10300
fix(examples): 修复aclnn示例代码及接口文档问题 #10300
已合并
luoyufan7创建于 7 天前
luoyufan7
7 天前

描述

修复 6 个算子示例代码与接口文档中的 codecheck 问题,完整问题清单见关联 Issue。

主要修复:

  • 宿主数据类型与 Tensor dataType 匹配:DequantBias(inputHostData int16_t→int32_t、resultData int8_t→int16_t、weight/activation/bias int32_t→float、outputDtype true1)、GeluBackward(gradOutput int→float 且 ACL_INT32→ACL_FLOAT)、GeluBackwardV2(gradOutput/gradInput int→float,0x00000001 位模式错值)
  • shape 与 tiling 实现一致:AdvanceStep inputTokens {8,1}{8};AdvanceStepV2 按 advance_step_tiling.cpp 的 CheckInputOutputShape 理顺全部输入(inputTokens/inputPositions/seqLens/slotMapping 为 1 维 [numSeqs*(1+specNum)],sampledTokenIds 为 {numSeqs, 1+specNum},specToken 为 {numSeqs, specNum}),并同步修正参数表与报错表中与实现不一致的 shape 描述(原参数表称 inputTokens 为 2 维、报错表称 sampledTokenIds 第二维为 1,均与 tiling 校验矛盾)
  • AdvanceStepV2 input7/input8 使用独立 DeviceAddr:原复用 input5/input6 的地址,指针被二次 malloc 覆盖导致首次分配泄漏
  • 清理模板残留:"mean result" 日志标签(GeluMul/SoftmaxCrossEntropyWithLogits/AdvanceStep/AdvanceStepV2/DequantBias)、头文件"//不确定头文件名字"注释、SoftplusBackward CHECK_RET 多余分号(含 experimental 副本)
  • AdvanceStep(V2) blockTables 参数描述修正为"物理块编号"(原文"block 的大小"与公式语义不符)
  • 按 clang-format 补齐 8 个示例文件末尾换行等格式;test_aclnn_advance_step_v2.cpp 版权头替换为仓库标准格式

examples 与 docs 双份同步修改。

关联的Issue

Closes #5816

测试

文档更新

  • docs/aclnnDequantBias.md、aclnnGeluBackward.md、aclnnGeluBackwardV2.md、aclnnGeluMul.md、aclnnSoftmaxCrossEntropyWithLogits.md、aclnnAdvanceStep.md、aclnnAdvanceStepV2.md、aclnnSoftplusBackward.md(含 experimental 副本)中的示例代码同步更新;aclnnAdvanceStepV2.md 参数表与报错表 shape 描述对齐实现

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 luoyufan7 的贡献)
Lluoyufan7
7 天前 创建了 pull request,commit 55ec233d
Lluoyufan7
7 天前 关联了issue:[examples] 多算子示例代码宿主数据类型/shape 与接口定义不一致及日志标签残留
luoyufan7
7 天前 评论:

/compile

likedislike
Lluoyufan7
7 天前 预合并成功(commit_id: 8f52e1377f041653d503065fac9d15152e78d8e8)
CANN-robotCANN-robot成员
7 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

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

Module Approval Details

module lgtm status approve status
*/*/docs/acl*.md 任如海, 钱泽洪, 陈风, 杜慧萍 (4/2) 杜慧萍 (1/1)
activation 钱泽洪, 任如海 (2/2) 钱泽洪 (1/1)
experimental 钱泽洪, 陈风, 任如海 (3/2) 钱泽洪, 陈风 (2/1)
optim 钱泽洪, 陈风 (2/2) 钱泽洪, 陈风 (2/1)
quant 钱泽洪, 陈风 (2/2) 钱泽洪, 陈风 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
7 天前 将zengjuan,sxb154714,cheng_gao,chenfeng61,chaotang233,kevin_huang1234,FelixTang7,crystalhu,yu-xinjie62,yangyang016,fanqirui,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,chenqi317,liu-wei,lileizheng,LinPX,fullt,wang-xing001,liubo75,LiuZonggu,tangweiwei2,wangzitao_leo,xubinglin,gitcode-chenjiao,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,wangcimeng,huafeng793,qianzehong,fengying555682,liuyang_806,liuchuangdev,shi-xiangyang225,linruihan,shenchengzong,yuxin5,caiwenwen,yanglu-1设为评审人
CANN-robotCANN-robot成员
7 天前 将zengjuan,sxb154714,cheng_gao,chenfeng61,chaotang233,kevin_huang1234,FelixTang7,crystalhu,yu-xinjie62,yangyang016,fanqirui,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,chenqi317,liu-wei,lileizheng,LinPX,fullt,wang-xing001,liubo75,LiuZonggu,tangweiwei2,wangzitao_leo,xubinglin,gitcode-chenjiao,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,wangcimeng,huafeng793,qianzehong,fengying555682,liuyang_806,liuchuangdev,shi-xiangyang225,linruihan,shenchengzong,yuxin5,caiwenwen,yanglu-1设为审查人
CANN-robot
CANN-robot成员
7 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-running
此处折叠了7条事件消息 查看更多
Lluoyufan7
7 天前 修改了pull request 的描述
luoyufan7
7 天前 评论:

/compile

likedislike
Lluoyufan7
7 天前 预合并成功(commit_id: 08530aa3c903af5f6f244f7e723c9454b86c6d6a)
CANN-robot
CANN-robot成员
7 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
7 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
7 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-passed
yuning_chen
yuning_chen成员
7 天前 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
Lluoyufan7
6 天前 修改了pull request 的描述
Lluoyufan7
6 天前 修改标题为 “fix(examples): 修复aclnn示例代码”,原标题为“fix(examples): fix dtype/shape mismatches and log labels in aclnn examples”
Lluoyufan7
6 天前 修改了pull request 的描述
Lluoyufan7
6 天前 修改标题为 “fix(examples): 修复aclnn示例代码及接口文档问题”,原标题为“fix(examples): 修复aclnn示例代码”
renruhai成员
6 天前 评论:

/lgtm

likedislike
qianzehong成员
6 天前 评论:

/lgtm
/approve

likedislike
chenfeng
chenfeng成员
6 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6 天前 添加了label:lgtm
gitee-duhuiping成员
6 天前 评论:

/approve

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