已合并
新增ThresholdBackward实验算子(relu_grad_v2) #4479
cwzhang创建于 4月30日
新增ThresholdBackward实验算子(relu_grad_v2) #4479
已合并
cwzhang创建于 4月30日
cwzhang
4月30日

描述

新增 ThresholdBackward 实验性算子,位于 experimental/activation/relu_grad_v2,用于计算 Relu 激活函数的反向传播,公式为:当输入 self > threshold 时输出 gradOutput,否则输出 0。

TBE转AscendC算子迁移项目,支持该算子后续开发与演进。

  • 算子目录:experimental/activation/relu_grad_v2
  • 导出接口:aclnnThresholdBackward

关联的Issue

[Requirement|需求建议]: 新增ThresholdBackward实验算子(relu_grad)(关联PR用于追踪)

测试

UT 测试 17 / 17 通过
测试命令: bash build.sh --experimental --ops=relu_grad_v2 -u --opapi -j8 -O2

测试覆盖以下场景:

  • FLOAT32/FLOAT16/BFLOAT16/UINT8/INT8/INT32/INT64 正例精度测试
  • empty_tensor
  • not_contiguous
  • 无效输入 dtype
  • 无效输出 dtype
  • 输入输出 dtype 不匹配
  • shape 不匹配
  • dim 超限
  • nullptr
  • threshold != 0
  • 标量输入

ATK 精度测试 2100 / 2100 通过

文档更新

  • 新增 API 文档:docs/aclnnThresholdBackward.md
  • 新增算子 README:README.md
  • 新增 example:examples/test_aclnn_relu_grad_v2.cpp
  • 新增 example 脚本:examples/run.sh

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cwzhang 的贡献)
Ccwzhang
4月30日 创建了 pull request,commit e2a719f6
Ccwzhang
4月30日 关联了issue:[Requirement|需求建议]: 新增ThresholdBackward实验算子(relu_grad)(关联PR用于追踪)
CANN-robot
CANN-robot成员
4月30日 评论:

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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
experimental/activation 周奇龙, 查建青 (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

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

likedislike
CANN-robotCANN-robot成员
4月30日 添加了label:cann-cla/no
CANN-robotCANN-robot成员
4月30日 将crystalhu,yangyang016,fanqirui,zhou-qilong,zhajianqing123,chenqi317,liubo75,tangweiwei2,liujie12345678,Chen_HaoWen,wangyongguang,zhang-wu设为评审人
此处折叠了91条消息 查看更多
zhajianqing123成员
5月13日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月13日 添加了label:lgtm
CANN-robot
CANN-robot成员
5月13日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 查建青, 周奇龙.
Reviewers who wrote a comment of /lgtm are: 周奇龙, 查建青.

likedislike
CANN-robotCANN-robot成员
5月13日 关闭了关联的issue
CANN-robotCANN-robot成员
5月13日 合入了pull request