Closed
feat(nn): 9 个算子支持 InferDataType(op_graph 注册,同步 rt1.0 dtype 推导策略) #10792
zzz2048Add on Sep 20Closed at 23 days ago
feat(nn): 9 个算子支持 InferDataType(op_graph 注册,同步 rt1.0 dtype 推导策略) #10792
Closed
zzz2048Add on Sep 20Closed at 23 days ago
zzz2048Collaborators
Sep 20

描述

为 activation 4 个算子(ConfusionSoftmaxGrad、LogSoftmaxGrad、LogSoftmaxV2、SoftmaxGrad)与 norm 5 个算子(LayerNorm、LayerNormV3、SyncBatchNormBackwardElemt、SyncBatchNormBackwardReduce、SyncBatchNormGatherStats)在 op_graph 目录新增 <op>_graph_infer.cpp,以 IMPL_OP(<Op>).InferDataType(fn) 注册 InferDataType,推导逻辑同步 canndev rt1.0 的 dtype 策略:

  • 同位传播:ConfusionSoftmaxGrad(y=grad)、LogSoftmaxV2(logsoftmax=logits)、SoftmaxGrad(grad_x=softmax)、SyncBatchNormBackwardElemt(grad_input=grad_output)、SyncBatchNormBackwardReduce(两输出=sum_dy)
  • 取 x(grad 为输入0):LogSoftmaxGrad
  • 多输出异源绑定:LayerNorm、LayerNormV3(y=x、mean=gamma、variance/rstd=beta)
  • 四输出取 variance(输入4):SyncBatchNormGatherStats

背景:GE 图模式下,域外 dtype 会触发符号推导 PARAM_INVALID,输出 dtype 残留未定义,进而导致引擎选择阶段 aicpu 兜底失效。注册回调后推导直接成功,输出 dtype 正确写出,恢复与 rt1.0 一致的推导行为。仅 GE 图模式消费,不影响 aclnn 链路。

关联的Issue

无

测试

g++ -fsyntax-only 语法验证 9/9 通过(CANN 9.2.0 + opbase 头文件)。

文档更新

无

类型标签

likedislike
The current Pull Request has been closed by chenqi317.
Zzzz2048Collaborators
Sep 20 Created pull request, commit 0a0fe1e6
CANN-robotCANN-robotCollaborators
Sep 20 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 20 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

⚠️ 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
activation ❌ (0/2)(You can also ask: 任如海, 唐超, 杨阳, 范其瑞, 黄迪) ❌ (0/1)(You can also ask: 上官秦南, 汤平川, 查建青, 苏跃明, 刘杰)
norm ❌ (0/2)(You can also ask: 唐超, 王瑞, 陈展熹, 刘波, 范其瑞) ❌ (0/1)(You can also ask: 汤平川, 陈昊文, 陈兴宇, 王瑞, 上官秦南)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robotCollaborators
Sep 20 Comments:

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 20 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
27 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 21 Removed label: stat/needs-squash
CANN-robot
CANN-robotCollaborators
Sep 21 Comments:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
CANN-robotCANN-robotCollaborators
Sep 21 Added label: cann-cla/yes
chenqi317Collaborators
23 days ago Comments:

长时间没有更新,暂时关闭pr,请修复后再重新打开。

likedislike
Cchenqi317Collaborators
23 days ago Close pull request