Merged
fix(operation): Fix Remainder Temp Workspace #6345
刘奕哲Add on Sep 15
fix(operation): Fix Remainder Temp Workspace #6345
Merged
刘奕哲Add on Sep 15
刘奕哲
刘奕哲
Sep 15

描述

Remainder算子临时空间尾轴未进行256B对齐导致调用vcmp时UB访问越界,现修改其对齐方式

测试

完成自测以及冒烟测试

关联Issue

#3335

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 刘奕哲's contribution.)
刘奕哲刘奕哲
Sep 15 Created pull request, commit 31516976
刘奕哲刘奕哲
Sep 15 Associated issue: [Bug-Report|缺陷反馈]: Remainder精度报错
atomgit-bot
atomgit-bot
Sep 15 Comments:

变更摘要

本 PR 为 Bug 修复:Remainder 算子(取余运算)的临时工作空间(temp workspace)尾轴未按 256B 对齐,导致调用 vcmp 指令时发生 UB 访问越界。改动将临时空间的尾轴对齐粒度从原来的 BLOCK_SIZE 调整为 256B(新增常量 NUM_VALUE_256),并同步修正 mask 相关对齐计算,涉及标量版 TiledRemainderSOperation 与二进制分块版 AddTiledBinaryOperation 中的 REM 分支。

主要改动

  • 新增 256 对齐常量:在 framework/src/interface/operation/operation_common.h 中新增常量 constexpr int32_t NUM_VALUE_256 = 256;,为后续对齐计算提供统一的 256B 基准。
  • 修正 TiledRemainderSOperation 临时空间对齐:在 framework/src/interface/operation/vector/binary_scalar.cpp 中,将 alignSize 由 BLOCK_SIZE / BytesOf(...) 改为 NUM_VALUE_256 / BytesOf(...),并将 maskFloats 的对齐基准由 BLOCK_SIZE 改为 NUM_VALUE_256,使临时空间尾轴按 256B 对齐。
  • 修正 AddTiledBinaryOperation REM 分支对齐:在 framework/src/interface/operation/vector/binary_tiled.h 中,对 REM 算子的 alignSize 与 maskFloats 做同样的 BLOCK_SIZE 到 NUM_VALUE_256 对齐基准替换,避免分块路径下 vcmp 访问越界。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 15 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 15 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 15 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.
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 ✅ 尹杰, lyz0328 (2/2) ✅ lyz0328, 尹杰 (2/1)
framework/src/interface/operation ✅ shi-dingkun, 尹杰 (2/2) ✅ shi-dingkun, 尹杰 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Set xinweiliu,lyz0328,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 15 Set xinweiliu,lyz0328,cam_bxh,dai-zhentao,shi-dingkun,gguuaanngg,foundea,yinjie27_,tsungl4,make_pto,linjiashu as approver
刘奕哲
刘奕哲
Sep 15 Comments:

compile

likedislike
刘奕哲刘奕哲
Sep 15 Pre merge succeeded (commit_id: efcd022348625b1369c36de7760f6e94fe2ac431)
CANN-robot
CANN-robotCollaborators
Sep 15 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Added label: ci-pipeline-running
6 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 16 Removed label: ci-pipeline-passed
CANN-robot
CANN-robotCollaborators
Sep 16 Comments:

Notification

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 16 Added label: cann-cla/yes
lyz0328
lyz0328Collaborators
Sep 16 Comments:

/approve

likedislike
刘奕哲
刘奕哲
Sep 16 Comments:

compile

likedislike
刘奕哲刘奕哲
Sep 16 Pre merge succeeded (commit_id: aa7994f92afa9dcb2b235d518871668888fc93a9)
CANN-robot
CANN-robotCollaborators
Sep 16 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 16 Added label: ci-pipeline-running
shi-dingkun
shi-dingkunCollaborators
Sep 16 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 16 Added label: approved
CANN-robotCANN-robotCollaborators
Sep 16 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 16 Added label: ci-pipeline-passed
Jie Yin
Jie YinCollaborators
Sep 16 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 16 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 16 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 16 Merged pull request