已合并
fix GetVecTensor size get #6448
fix GetVecTensor size get #6448
已合并
zc1110创建于 9 天前
zc1110
zc1110成员
9 天前

描述

修复Matmul GetVecTensor() 设备侧丢失 tensor 长度,MSTX 打点上报 size=0,导致 mssanitizer memcheck 误报 62 条

关联的Issue

https://gitcode.com/cann/asc-devkit/issues/1783

测试

蓝区冒烟 toolkit&ops包编译 二级冒烟

文档更新

类型标签

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

你好,这个问题我无法回答,很遗憾不能帮助你。

likedislike
不准确?
atomgit-bot
atomgit-bot
9 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
9 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9 天前 评论:

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
include/adv_api ✅ wuzhaolin, DragonBornHD84 (2/2) ✅ wuzhaolin (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
9 天前 将zengjuan,zhanghao_0689,suqwe,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,XuebinYang,sjtulxh,bianque,houyuyang,Lycheeeee,YANXI_ZHAO,chentianyu19,shi_nanxiang,wuyang_hw,jiangxinyu3,ascendhjh,hujiawen_kaven,wangxiaozhi,DragonBornHD84,louyuxuan,hyolee,yukangchen,wuzhaolin设为评审人
CANN-robotCANN-robot成员
9 天前 将ascendhjh,wuzhaolin设为审查人
zc1110zc1110成员
9 天前 关联了issue:[Bug-Report|缺陷反馈][工具检测] Matmul `GetVecTensor()` 设备侧丢失 tensor 长度,MSTX 打点上报 `size=0`,导致 mssanitizer memcheck 误报 62 条
zc1110
zc1110成员
9 天前 评论:

compile

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

流水线分析报告 — asc-devkit run#5173

流水线: run#5173 | PR#6448 | 2026-09-28 17:06:15 ~ 17:17:27 | 失败 Job 6 个

定界结论: 代码问题 / LLT编译失败 — master 既有缺陷(非本 PR 引入): CalcGoSize 调用参数不匹配
  • 失败类型: 代码问题 / LLT编译失败 —— 但非 PR#6448 引入,是 master 分支合入顺序冲突导致的既有缺陷
  • 根因: master 提交 cd1c881e2c(feat: 迁移 CcuSchedReduceScatterSoleNHR,2026-09-28 15:57 合入)在 hccl_ccu_v0_prepare.h 新增的 CcuPrepareForReduceScatterSoleNhr2DieM2M 中按旧 4 参签名调用 CalcGoSize;而 3 分钟前合入的 01cf25af44(add a6 feature,15:54)已将 CalcGoSize 签名改为 5 参(新增 CcuProtocolVersion ccuVersion),导致编译确定性失败
  • 处置建议:
    • PR#6448 提交者: 无需修改本 PR —— PR 变更仅 include/adv_api/matmul/matmul_client.h(移动 #if ASCENDC_CPU_DEBUG 守卫),与失败完全无关;master 修复前重触发仍会失败
    • hccl 模块维护者 / cd1c881e2c 作者: 修复 master —— 在 impl/adv_api/detail/hccl/ccu/hccl_ccu_v0_prepare.h:661-662 两处 CalcGoSize(...) 调用补第 5 参 ccuProtocolVersion_(同文件其余 20+ 处调用均已带该参数),或回退 cd1c881e2c
  • 排除项:
    • 非 PR#6448 变更引入(run 内 pr_filelist 工件证实触发时 PR 也仅改 matmul_client.h)
    • 非环境/平台问题(确定性编译错误,master 当前代码仍可复现该失配)
    • run 期间 PR 有新推送(c665de82 → e92667d2,17:17:23),但新旧两版均仅改 matmul_client.h,结论不受影响

失败根因分析

根因 #1: 代码问题 / LLT编译失败 — hccl_ccu_v0_prepare.h:661-662 以 4 参调用 5 参的 CalcGoSize(master 既有缺陷)
  • 判据: UT 任务中的编译错误: 源文件编译报错(too few arguments to function)
  • 定位步骤: 4_ut_acc.log(编译 ascendc_ut_basic_api_ascend950pr_9599_AIC 测试目标时触发)
  • 影响 Job: 6 个 ut Job(同因);下游 UT_report / PreSmoke_A2 因级联未启动;其余 21 个 Job(含 4 个 compile、CodeCheck 全系、SCA、2 个 ut)全部通过
  • 根因证据(日志原文):
hccl_ccu_v0_prepare.h: In member function 'void AscendC::HcclImpl<AscendC::HCCL_SERVER_TYPE_CCU, config>::CcuPrepareForReduceScatterSoleNhr2DieM2M(AscendC::CommonPrepareParamCcu*)':
hccl_ccu_v0_prepare.h:661:15: error: too few arguments to function 'void AscendC::CalcGoSize(uint64_t, uint64_t, uint64_t, uint64_t*, CcuProtocolVersion)'
  661 |     CalcGoSize(sliceSize, localCopyLoopCount, CCU_MEMSLICE_SIZE * 8, &xnData_[KFC_RS_SOLE_NHR_2DIE_GO_SIZE_NORMAL_0]);
hccl_ccu_xn_utils.h:169:24: note: declared here
  169 | __aicore__ inline void CalcGoSize(
hccl_ccu_v0_prepare.h:662:15: error: too few arguments to function 'void AscendC::CalcGoSize(uint64_t, uint64_t, uint64_t, uint64_t*, CcuProtocolVersion)'
  662 |     CalcGoSize(sliceSize, localCopyLoopCount, CCU_MEMSLICE_SIZE * 8, &xnData_[KFC_RS_SOLE_NHR_2DIE_GO_SIZE_LAST_0]);
gmake[3]: *** [tests/api/basic_api/CMakeFiles/ascendc_ut_basic_api_ascend950pr_9599_AIC.dir/.../test_aic_sub_block_dim.cpp.o] Error 1
  • 版本对照(master 合入顺序冲突):
ref hccl_ccu_xn_utils.h CalcGoSize 签名 hccl_ccu_v0_prepare.h:661-662
a102ac5eea (08-29) 4 参 (该函数不存在)
01cf25af44 (09-28 15:54, add a6 feature) 改为 5 参(+CcuProtocolVersion),既有调用全部同步 —
cd1c881e2c (09-28 15:57, 迁移 CcuSchedReduceScatterSoleNHR) 5 参 新增函数按旧 4 参调用 ← 引入失配
master(当前) 5 参 4 参调用仍在,缺陷至今未修
  • 与 PR#6448 的关系: PR 变更文件仅 include/adv_api/matmul/matmul_client.h(+1/-1,移动 #if ASCENDC_CPU_DEBUG 守卫),不涉及任何 hccl/ccu 文件;失败文件均来自 master 侧(预合并提交 95c3e77b0 中与 master 一致)。本 run 属"踩雷"——master 在 run 触发前约 70 分钟被 cd1c881e2c 打破。

由门禁失败定界分析自动生成 | repo: asc-devkit | run: 170c9c0ef722425997831e1dc55a43e3 | PR#6448

likedislike
zc1110
zc1110成员
9 天前 评论:

compile

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

流水线分析报告 — asc-devkit run#5197

流水线: https://gitcode.com/CANN/asc-devkit/actions/runs/4adb66cce6ba4808ab5b8323579a7113 | PR#6448 | 2026-09-28 19:47:38 ~ 19:58:50 | 失败 Job 6 个

定界结论: 代码问题 / LLT编译失败 — CalcGoSize 调用缺第 5 参(基线不匹配, 非本 PR 引入)
  • 失败类型: 代码问题 / LLT编译失败(UT 任务编译错误)
  • 根因: 目标分支公共头文件 impl/adv_api/detail/hccl/ccu/hccl_ccu_v0_prepare.h:661-662 调用 CalcGoSize 仅传 4 个实参, 而 hccl_ccu_xn_utils.h:169 的声明要求 5 个参数(含 CcuProtocolVersion ccuVersion), 导致 ascendc_ut_adv_api_kernel_ascend950pr_9599_AIC 等 UT 目标编译失败
  • 归属: 该不匹配由 9/28 相隔 3 分钟合入 master 的两个提交造成(01cf25af44 "add a6 feature" 给 CalcGoSize 增加第 5 参; cd1c881e2c "feat: 迁移 CcuSchedReduceScatterSoleNHR" 新增的调用仍为 4 参)。非本 PR 变更引入(本 PR 仅改 include/adv_api/matmul/matmul_client.h)
  • 处置建议: ① 基线修复(该谁修: 模块维护者/上述提交作者)——在 hccl_ccu_v0_prepare.h:661-662 补传第 5 个实参 ccuProtocolVersion_(同文件其余 CalcGoSize 调用均已传); ② 本 PR 提交者无需为该失败修改代码, 基线修复后重新触发流水线即可
  • 排除项: 已核实 PR 当前 head(e92667d) 上上述两文件的不匹配代码仍然存在, 现在直接重触发仍会失败(确定性编译错误); 下游 UT_report / PreSmoke_A2 为前置失败未启动(INIT 级联), 无独立失败

失败根因分析

根因 #1: 代码问题 / LLT编译失败 — hccl_ccu_v0_prepare.h 4 参调用 vs hccl_ccu_xn_utils.h 5 参声明
  • 判据: UT/ST 任务中的编译错误: 源文件编译报错
  • 定位步骤: 4_ut_acc.log 从末尾回溯 gmake Error 2 → 首个 error: 行(ut Job 6b706cf09dd546d599a40e9c2844ad90)
  • 影响 Job: 6 个 ut Job 全部失败(同因, 耗时 34s~173s); UT_report / PreSmoke_A2 因前置失败未启动(INIT 级联)
  • 根因证据(日志原文):
hccl_ccu_v0_prepare.h: In member function 'void AscendC::HcclImpl<AscendC::HCCL_SERVER_TYPE_CCU, config>::CcuPrepareForReduceScatterSoleNhr2DieM2M(AscendC::CommonPrepareParamCcu*)':
hccl_ccu_v0_prepare.h:661:15: error: too few arguments to function 'void AscendC::CalcGoSize(uint64_t, uint64_t, uint64_t, uint64_t*, CcuProtocolVersion)'
  661 |     CalcGoSize(sliceSize, localCopyLoopCount, CCU_MEMSLICE_SIZE * 8, &xnData_[KFC_RS_SOLE_NHR_2DIE_GO_SIZE_NORMAL_0]);
hccl_ccu_xn_utils.h:169:24: note: declared here
  169 | __aicore__ inline void CalcGoSize(
      |     uint64_t sliceSize, uint64_t loopCount, uint64_t ccuMemsliceSize, uint64_t* goSize, CcuProtocolVersion ccuVersion)
hccl_ccu_v0_prepare.h:662:15: error: too few arguments to function 'void AscendC::CalcGoSize(uint64_t, uint64_t, uint64_t, uint64_t*, CcuProtocolVersion)'
  662 |     CalcGoSize(sliceSize, localCopyLoopCount, CCU_MEMSLICE_SIZE * 8, &xnData_[KFC_RS_SOLE_NHR_2DIE_GO_SIZE_LAST_0]);
...
gmake[3]: *** [.../ascendc_ut_adv_api_kernel_ascend950pr_9599_AIC.dir/matmul/kfc/test_matmul_server_c310.cpp.o] Error 1
gmake: *** [Makefile:625: ascendc_ut_adv_api_kernel_ascend950pr_9599_AIC] Error 2

基线归属补充论证:

  • 触发链: test_matmul_constant_tiling_impl.cpp:11 → kernel_operator.h → kernel_api.h:29 → hccl.h:420 → hccl_impl.h:25 → platform_v310/hccl_ccu_v0.h:19 → ccu/hccl_ccu_v0_prepare.h(标准 UT 包含链, 与本 PR 改动的 matmul_client.h 无关)
  • 本 PR 当前变更仅 1 个文件 include/adv_api/matmul/matmul_client.h, 未触及任何 hccl 文件
  • 已核实 PR 当前 head(e92667d) 上 hccl_ccu_v0_prepare.h:661-662 仍为 4 参调用、hccl_ccu_xn_utils.h:169 仍为 5 参声明 → 不匹配在目标分支基线上, 重触发不会消除
  • 两文件在 master 上的最近提交: hccl_ccu_xn_utils.h ← 01cf25af44 "add a6 feature"(2026-09-28 15:54, 引入第 5 参 CcuProtocolVersion); hccl_ccu_v0_prepare.h ← cd1c881e2c "feat: 迁移 CcuSchedReduceScatterSoleNHR"(2026-09-28 15:57, 新增 CcuPrepareForReduceScatterSoleNhr2DieM2M 的 4 参调用)——两提交间隔 3 分钟先后合入, 各自门禁未能交叉验证, 合并后基线对该 UT 编译目标损坏
  • 时效性说明: 本 run 触发时 PR head 为 f5926cc, PR 其后已有新推送(当前 head e92667d), 但如上所述错误代码在当前 head 依然存在, 失败与 PR 版本演进无关

由门禁失败定界分析自动生成 | repo: asc-devkit | run: 4adb66cce6ba4808ab5b8323579a7113 | PR#6448

likedislike
zc1110
zc1110成员
9 天前 评论:

compile

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

/lgtm

likedislike
zc1110zc1110成员
8 天前 修改了pull request 的描述
zc1110zc1110成员
8 天前 预合并成功(commit_id: d4f1faee87d661276c0bb21fa72cb226f806bc5a)
zc1110zc1110成员
8 天前 强制推送  1 个提交:53ffe5fe-fix GetVecTensor size get
zc1110zc1110成员
8 天前 预合并成功(commit_id: 0df62749020d233a9c9b40af98f01e586cf32907)
CANN-robotCANN-robot成员
8 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
8 天前 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
8 天前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): ci-pipeline-passed.

likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:cann-cla/yes
zc1110
zc1110成员
8 天前 评论:

compile

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

/approve

likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:approved
DragonBornHD84成员
8 天前 评论:

/lgtm

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