合并受阻
变更摘要
本 PR 完成 DivCustomTemplate 自定义算子的工程化实现:在 host 侧实现 Tiling 参数计算与 Shape/DataType 推导,在 kernel 侧基于 AscendC 完成除法计算,并配套算子定义、TF 插件注册、CMake 构建脚本、一键构建/安装/运行脚本以及基于 ACLNN 接口的测试用例。算子支持 FP16/FP32 两种数据类型,按输入规模动态生成 Tiling 参数并遵循 32B 对齐,同时支持 ascend310p 与 ascend910b 两种编译目标。
主要改动
-
算子定义与注册: 新增
div_custom_template.json定义算子输入x/y与输出z(ND 格式,float16/float),并在tensorflow_div_custom_template_plugin.cc中通过REGISTER_CUSTOM_OP("DivCustomTemplate")完成 TF 框架插件注册。 -
Host 侧 Tiling 与推导逻辑:
op_host/div_custom_template.cpp实现TilingFunc(校验输入 shape/数据类型一致性,按 32B 对齐计算blockDim/blockLength/tileLength并写入DivCustomTemplateTilingData)、InferShape/InferDataType,并通过AICore().AddConfig注册ascend910b与ascend310p配置。 -
Kernel 侧算子实现:
op_kernel/div_custom_template.cpp使用TPipe/TQue双缓冲流水,经DataCopy搬入、Div计算、DataCopy搬出完成逐 tile 处理,并根据tilingData.dataType在float与half之间分发。 -
Tiling 数据结构:
op_kernel/div_custom_template_tiling.h通过BEGIN_TILING_DATA_DEF定义totalLength/blockLength/tileLength/dataType四个字段并注册DivCustomTemplateTilingData。 -
构建、运行与验证流程: 新增
CMakePresets.json/build.sh构建配置与脚本、run.sh一键加载 CANN 环境并完成编译、安装、环境 source 与测试执行,test/main.cpp通过aclnnDivCustomTemplateGetWorkspaceSize/aclnnDivCustomTemplate验证 FP16/FP32 除法结果,并实现资源申请与异常路径的释放清理。


Hi @iss_liqinghua, welcome to submitting your first PR to cann-outreach!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


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.
For more, you also can visit HICANN.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cann-outreach | ❌ (0/2)(You can also ask: Carolina_yuan, jxlang, 傅涛, shaoyf, 田晓亮) | ❌ (0/1)(You can also ask: jxlang, gcw_tgPdOLZT, shaoyf, 田晓亮, luzx66) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
iss_liqinghua, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


/compile


/compile


当前 PR 是否有 AI 参与
变更描述 / Description
完成 DivCustomTemplate 工程化算子实现:
关联活动 / Related Activity
测试信息 / Testing
验证结果:
下图为验证环境实际终端截图,显示 CANN 9.0.0、Ascend 310P3 以及 FP16/FP32 执行通过。
查看原始终端日志 verification.log
提交说明
GitCode API v5 仅提供单文件创建或更新接口,因此本分支形成多个 commit;这些提交均属于同一功能变更,PR 已启用合入时自动 squash。
检查清单 / Checklist