已合并
fix bug: stateless normal导致host重启 #3897
fix bug: stateless normal导致host重启 #3897
已合并
biabu创建于 7月8日
biabu
biabu成员
7月8日

描述

fix bug: stateless normal导致host重启

关联的Issue

测试

已冒烟

文档更新

不涉及

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 biabu 的贡献)
biabubiabu成员
7月8日 创建了 pull request,commit ccbbf4bb
atomgit-bot
atomgit-bot
7月8日 评论:

变更摘要

此 PR 修复了在 NormalLauncher 大 case 下高并发访问全局内存(GM)中 mean/std 标量导致 MTE 挂死、host 重启的问题。核心思路是将 NormalTransform 从持有 GM 指针改为持有标量值,并在 NormalLauncher 中通过 DataCopy 将 mean 和 std 标量从 GM 预搬运到 UB(统一缓冲区)后再传递给 NormalTransform,从而避免高并发下对 GM 的直接访问。

主要改动

  • NormalTransform 成员变量由指针改为值: meanGM_volatile M_T*)改为 meanVal_M_T),stdevGM_volatile S_T*)改为 stdVal_S_T),构造函数参数类型和初始化列表相应调整,不再持有 GM 指针引用。
  • NormalLauncher 中新增标量预搬运逻辑: 使用 TPipeTBuf<TPosition::VECCALC> 在 UB 上分配 32 字节缓冲区,通过 DataCopy 分别将 meanPtrstdevPtr 指向的 GM 标量拷贝到 UB,再用 GetValue(0) 读取为局部变量 meanValstdVal
  • NormalTransform 构造方式相应变更: NormalLauncher 中不再以 GM 指针构造 NormalTransform,改为传递已搬运到 UB 的标量值 meanValstdVal
likedislike
不准确?
atomgit-bot
atomgit-bot
7月8日 评论:

代码审查

经过全面审查,我已确认该 diff 中仅存在一个明确的问题。


审查总结

已审查文件:

  • random/stateless_normal/op_kernel/arch35/stateless_normal.h — 发现 1 个 P0 问题

问题统计:

  • P0: 1
  • P1: 0
  • P2: 0
  • P3: 0

整体风险评估: 🔴 高风险 — 该变更存在一个确定的编译错误(P0),将导致 stateless_normal 算子 kernel 无法编译通过。NormalTransform 结构体的成员从 GM 指针改为标量值,构造函数和调用方(NormalLauncher::operator())均已同步更新,但 NormalTransform::operator() 第 58 行被遗漏,仍引用已删除的旧成员名 meanGM_stdevGM_(且错误地使用了数组下标 [0]),必须修复后才能合并。

类型 数量
🔴 阻塞 1
🟡 建议 0

⛔ 需要修改

likedislike
不准确?
CANN-robotCANN-robot成员
7月8日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月8日 评论:

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
repo-cann/ops-math 宋恺, wangrui_ (2/2) 宋恺 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了59条消息 查看更多
songkai111成员
7月10日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
7月10日 添加了label:approved
RuiWang_成员
7月10日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
7月10日 添加了label:lgtm
CANN-robotCANN-robot成员
7月10日 合入了pull request