Merged
fix(softsign): 支持动态高维输入 #11207
fix(softsign): 支持动态高维输入 #11207
Merged
yulianjieAdd on Sep 24
yulianjie
yulianjieCollaborators
Sep 24

描述

Softsign 在 Ascend 950 动态 Shape / 动态 Rank 场景下,运行时具体化为 9 维 Tensor 时会在 SoftsignTilingFunc 被 MAX_INPUT_RANK = 8 提前拒绝。

Softsign 是纯逐元素算子,后续公共 ElewiseBaseTiling 会把 StorageShape 的全部维度连乘为一维总元素数 dim0,Kernel 按连续内存线性处理,不依赖各轴语义。因此该 Host Tiling rank 限制会阻断本可正常执行的动态高维输入。

本 PR:

  • 删除 Softsign Host Tiling 中 inputRank > 8 的拦截;
  • 删除随之失去用途的 MAX_INPUT_RANK 常量;
  • 保留动态 Rank [-2]、标量和空 Tensor 的既有处理逻辑;
  • 不修改计算公式、dtype、TilingData 或 Kernel 实现。

关联的Issue

关联 Issue:#6218

测试

测试环境:Ascend950PR_9579,TTK 3.0.0,CANN 9.2.0。

  1. 构建与产物检查
bash build.sh --pkg --soc=ascend950 --ops=softsign \
  --vendor_name=softsign_rank9_test -j16
  • 包构建成功;
  • Build Inspector:FP16/BF16/FP32 共 3/3 个 .o 完整;
  • 每个 .o 各包含 1 个子 Kernel;
  • 构建产物与隔离安装目录中的 .o SHA256 一致。
  1. 动态 GEIR 真机验证

使用隔离 vendor softsign_rank9_test_nn,执行 -c=false -d=true:

场景 编译描述 运行时具体 Shape 结果
动态 Shape 8D control [-1] × 8 [2] × 8 PASS
动态 Shape 9D [-1] × 9 [2] × 9 PASS
动态 Rank control [-2] [2] × 8 PASS
动态 Rank 9D [-2] [2] × 9 PASS

结果:4 PASS / 0 FAIL / 0 SKIP,四条均为 DYN_GOLD: PASS。运行日志确认 custom_op_file_path、Tiling SO、Kernel .o 和实际 Kernel launch 均来自本次隔离 vendor。

  1. 本地提交门禁
  • clang-format:PASS
  • codespell:PASS
  • OAT Compliance Check:PASS
  • 其他 pre-commit 检查:PASS

文档更新

无。本次仅移除动态执行路径中的冗余 Host Tiling rank 限制,不修改 Softsign 数学语义和接口定义。

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for yulianjie's contribution.)
yulianjieyulianjieCollaborators
Sep 24 Created pull request, commit 6b0b15f5
CANN-robotCANN-robotCollaborators
Sep 24 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 24 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
activation ✅ 王星, 陈琦 (2/2) ✅ 王星 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robotCollaborators
Sep 24 Comments:

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 24 Set zengjuan,u010470851,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong as approver
56 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 28 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 28 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 28 Added label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
Sep 28 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 28 Merged pull request