Pull Request has been successfully merged by CANN-robot.
(Thank you for zhang-song-rui's contribution.)变更摘要
本 PR 从原 #6242 中拆出「算子独立实现路径」的 workspace 清理,涉及 Lerp、Muls、Pow、Select SIMT、TanhGrad 五个算子。核心是将各 tiling 侧申请的 workspace 大小从系统库 API 默认值(32 或 16777216)统一置为 0,并同步移除 Pow kernel 入口中针对零 workspace 的判空返回、SetSysWorkspace/GetUserWorkspace 调用以及不再需要的 platform_ascendc.h 依赖,配套更新相关算子 UT 的 workspace 期望值。
主要改动
- Tiling 侧 workspace 申请量归零:
Lerp、TanhGrad、SelectSIMT 将WORKSPACE_SIZE常量由32改为0,Muls的SetTilingData与Pow的GetWorkspaceSize则直接将workspaces[0]赋为0,不再调用GetLibApiWorkSpaceSize()。 - Pow kernel 入口简化:
pow_apt.cpp的powkernel 删除workspace == nullptr判空返回、SetSysWorkspace与GetUserWorkspace转换逻辑,保留KERNEL_TASK_TYPE_DEFAULT、TPipe及原有 tiling key 分支调用形式。 - Pow tiling 依赖清理:
pow_tiling_arch35.cpp移除#include "platform/platform_ascendc.h"及GetPlatformInfo/OP_CHECK_NULL_WITH_CONTEXT相关代码,仅保留 workspace 指针获取与失败校验。 - UT 期望值同步调整:
test_lerp_tiling_arch35.cpp、test_muls_tiling_arch35.cpp、test_pow_tiling_arch35.cpp、test_tanh_grad_tiling_arch35.cpp中的expectWorkspaces由{32}或{16777216}改为{0};其中Pow对应用例的ExecuteTestCaseForEle调用仍处于注释状态,未实际执行该断言。 - 拆分边界说明:
Select公共BroadcastBaseTiling路径的 16 MiB→0 断言不在本 PR 内,保留在 #6242,本 PR 仅覆盖SelectSIMT 独立路径。
🧩 本次 Review 已使用自定义 Skill:




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 |
|---|---|---|
| math/lerp | ✅ 顾宝成, 王林木 (2/2) | ✅ 顾宝成 (1/1) |
| math/muls | ✅ 顾宝成, 王林木 (2/2) | ✅ 顾宝成 (1/1) |
| math/pow | ✅ 顾宝成, 王林木 (2/2) | ✅ 顾宝成 (1/1) |
| math/select | ✅ 王林木, 顾宝成 (2/2) | ✅ 顾宝成 (1/1) |
| math/tanh_grad | ✅ 顾宝成, 王林木 (2/2) | ✅ 顾宝成 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhang-song-rui, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm
/approve
by agent


修改内容
清理 Lerp、Muls、Pow、Select SIMT、TanhGrad 独立实现路径中未使用的 workspace 申请。没有额外用户 workspace 的路径将申请量设为 0;kernel 入口允许零 workspace 下继续执行计算。保留内部 kernel 的 workspace 参数及原调用形式。
同时原样包含 Lerp、Muls、Pow、TanhGrad 对应的 4 个算子 Host UT 文件修改,将 workspace 期望值更新为 0。本 PR 共 10 个文件。
与 BRC PR 的边界
本 PR 为原 PR #6242 的独立实现部分;公共 BroadcastBaseTiling(BRC)模板相关的 29 个算子 UT 文件留在 #6242。
Select 的现有 UT 命中 BRC 路径,原期望为 16 MiB,其断言修改留在 #6242;本 PR 的 Select 修改仅为 SIMT 独立实现。Lerp、Pow、TanhGrad 中使用底层 BroadcastTiling 的实现按其自行申报 workspace 的实际修改归入本 PR。
两个 PR 使用相同基线,各一次提交,改动文件互不重叠;两份补丁合并后的 Git tree 与拆分前提交 6875c10f04af0cc8f012cba867892a1f660702d5 完全一致。拆分未改变任何代码内容、排版或换行格式。
验证
拆分前整体联调版本在 CANN 9.2.0、已接入 Broadcast workspace 补丁的依赖环境下,完成 Host UT 对象编译、静态归档重建、最终链接及运行,333/333 通过,39 个改动文件 pre-commit 通过。
该结果属于拆分前整体版本,不替代本 PR 拆分后的线上 CI。Pow arch35 原有用例整段处于注释中,其 workspace 断言未实际执行。
关联
公共 BRC 算子 UT 更新:PR #6242。本 PR 不修改 CMake、公共 UT 框架或远程依赖版本。