已合并
新增 ReLU 实验算子 #4478
cwzhang创建于 4月30日
新增 ReLU 实验算子 #4478
已合并
cwzhang创建于 4月30日
cwzhang
4月30日

描述

新增 Relu 实验算子,位于 experimental/activation/relu,用于对输入 Tensor 执行 ReLU 激活函数计算,公式为 relu(x) = max(x, 0)

TBE转AscendC算子迁移项目

关联的Issue

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

测试

UT 测试覆盖以下 25 个场景 test_aclnn_relu.cpp

  • case_001_float:FLOAT32 数据类型精度验证
  • case_002_float16:FLOAT16 数据类型精度验证
  • case_003_bfloat16:BFLOAT16 数据类型精度验证(910B+ 平台支持)
  • case_004_int8:INT8 数据类型精度验证
  • case_005_int32:INT32 数据类型精度验证
  • case_006_int64:INT64 数据类型精度验证
  • case_007_empty_tensor:空 Tensor 支持
  • case_008_not_contiguous:非连续 Tensor 支持
  • case_009_invalid_input_dtype:输入非法类型 bool 校验
  • case_010_invalid_output_dtype:输出非法类型 bool 校验
  • case_011_dtype_mismatch:输入输出数据类型不一致校验
  • case_012_nullptr:空指针校验
  • case_013_shape_mismatch:输入输出 shape 不一致校验
  • case_014_max_dim:维度超限(>8)校验
  • case_015_inplace_float:原地计算 FLOAT32 精度验证
  • case_016_inplace_int64:原地计算 INT64 精度验证
  • case_017_inplace_invalid_dtype:原地计算非法类型校验
  • case_018_inplace_nullptr:原地计算空指针校验
  • case_019_inplace_max_dim:原地计算维度超限校验
  • case_020_inplace_float16:原地计算 FLOAT16 精度验证
  • case_021_inplace_bfloat16:原地计算 BFLOAT16 精度验证(910B+ 平台支持)
  • case_022_inplace_not_contiguous:原地计算非连续 Tensor 支持
  • case_023_inplace_empty_tensor:原地计算空 Tensor 支持
  • case_024_inplace_int8:原地计算 INT8 精度验证
  • case_025_inplace_int32:原地计算 INT32 精度验证

ATK 精度测试 2100 / 2100 通过

文档更新

  • 新增 API 文档:docs/aclnnRelu&aclnnInplaceRelu.md
  • 新增算子 README:README.md
  • 新增示例:examples/test_aclnn_relu.cpp & examples/test_aclnn_inplace_relu.cpp

审核问题处理

  • 修正文档路径与目录引用,统一为 experimental/activation/relu
  • 补齐 inplace 示例与 README 链接
  • 补齐 UT 覆盖并修正原地/普通算子测试口径

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cwzhang 的贡献)
Ccwzhang
4月30日 创建了 pull request,commit c40d84f9
Ccwzhang
4月30日 关联了issue:[Requirement|需求建议]: 新增Relu实验算子(关联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设为评审人
此处折叠了124条消息 查看更多
CANN-robotCANN-robot成员
5月15日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月15日 添加了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
5月15日 评论:

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月15日 关闭了关联的issue
CANN-robotCANN-robot成员
5月15日 合入了pull request