Merged
fix(foreach_acos): update doc constraints, harden tiling checks, and fix UT precision #12980
wuyanAdd on 24 days ago
fix(foreach_acos): update doc constraints, harden tiling checks, and fix UT precision #12980
Merged
wuyanAdd on 24 days ago
wuyan
wuyanCollaborators
24 days ago

描述

本次 PR 对 foreach_acos 算子进行文档约束修正、Tiling 检查加固、Kernel 分区重构与测试精度修复,具体如下:

1. 文档约束修正

  • README.md:修正输出 y 的 shape 描述,由"shape size 大于等于入参 x"改为"shape(维度及每一维长度)与入参 x 对应位置的 Tensor 一致";删除过时的"输出不支持非连续 Tensor"约束。
  • aclnnForeachAcos.md:补齐错误码表格,新增 x/out 中 Tensor dtype 不一致、Tensor 数量不一致、对应位置 shape 不一致、数据格式不支持等错误描述。

2. Tiling 检查加固(op_host/arch35/foreach_acos_tiling_arch35.cpp)

  • 修复 tensorNum 的 int32 溢出风险,改为 uint64 比较;
  • 新增 totalElements 累加与舍入算术的 int64 溢出防护;
  • 新增跨实例 Tensor dtype 一致性校验(此前仅取首 tensor 的 dtype)。

3. Kernel 重构(op_kernel/arch35/foreach_acos_simt.h)

  • 统一到 foreach tiling 框架,重构核函数分区逻辑(按 core 区间与 tensor 区间交集切分),修正元素数边界判断。

4. 新增三方 Golden(tests/assets/golden.py)

  • 基于 torch._foreach_acos 实现标准比对,覆盖 kernel/aclnn/torch 三个入口,float16/float32/bfloat16 走 cross_check L1。

5. UT 精度修复(tests/ut/op_kernel/acos_data/{compare_data,gen_data}.py、test_foreach_acos.cpp)

  • 修正精度比对判据与数据生成逻辑。

6. 补充 ST 用例:kernel 与 aclnn 各补充 5 条功能用例。

关联的Issue

测试

  • UT:更新 op_kernel 精度比对与数据生成,test_foreach_acos.cpp 覆盖 dtype 与精度场景。
  • ST:补充 kernel/aclnn 各 5 条功能用例,覆盖 float16/float32/bfloat16 等 dtype。
  • 上板:foreach_acos 精度比对通过(aclnn 与 torch 均有多条 PASS 记录)。

文档更新

  • foreach/foreach_acos/README.md
  • foreach/foreach_acos/docs/aclnnForeachAcos.md

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for wuyan's contribution.)
wuyanwuyanCollaborators
24 days ago Created pull request, commit 02940c87
CANN-robotCANN-robotCollaborators
24 days ago Added label: cann-cla/no
CANN-robot
CANN-robotCollaborators
24 days ago 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
*/*/README.md ✅ 陈娇, 汤平川, 王瑞 (3/2) ✅ 陈娇 (1/1)
*/*/docs/acl*.md ✅ 陈娇, 汤平川, 王瑞 (3/2) ✅ 陈娇 (1/1)
foreach ✅ 王瑞, 汤平川 (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

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

likedislike
CANN-robotCANN-robotCollaborators
24 days ago Set zengjuan,u010470851,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,gitcode-chenjiao,chenxingyu18,liujie12345678,east_yang,pingchuantang,Chen_HaoWen,qianzehong,fengying555682,caiwenwen,yanglu-1 as approver
CANN-robotCANN-robotCollaborators
24 days ago Set u010470851,kevin_huang1234,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,wang-xing001,gitcode-chenjiao,chenxingyu18,liujie12345678,east_yang,pingchuantang,Chen_HaoWen,qianzehong,fengying555682,caiwenwen,yanglu-1 as approver
61 messages are collapsed here。 See more
RuiWang_
RuiWang_Collaborators
19 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
19 days ago Closed associated issue
CANN-robotCANN-robotCollaborators
19 days ago Merged pull request
CANN-robot
CANN-robotCollaborators
19 days ago Comments:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike