已合并
LogAddExp 新增 Ascend950 AscendC 算子实现 #3150
zhangqijia1创建于 6月5日
LogAddExp 新增 Ascend950 AscendC 算子实现 #3150
已合并
zhangqijia1创建于 6月5日
zhangqijia1成员
6月5日

描述

为 LogAddExp 算子新增 Ascend950(arch35)的 AscendC 算子实现,复用同一 kernel 通过 base/scale/shift 属性同时支持 aclnnLogAddExp(base=-1,自然对数)与 aclnnLogAddExp2(base=2)。

主要改动:

  • op_kernel(device 侧):新增 log_add_exp_apt.cpp kernel 入口,按 schMode/formulaType 分发 simplified/full 两套公式 × native/cast 两条数据路径;arch35/log_add_exp_dag.h 实现数值稳定公式 y = max(x1,x2) + ln(1 + exp(-|x1-x2|))(full 路径叠加 base/scale/shift),并通过 InfGuardedSub 处理 x1、x2 同为 +inf/-inf 时 inf-inf=NaN 的污染(与 910B after_v200 分支行为对齐);bf16 走 cast-to-float 路径。
  • op_host(host 侧):新增算子定义(base/scale/shift 属性、ascend950 AICore config)、broadcast infershape、arch35 tiling。

支持数据类型:FP16 / FP32 / BF16,支持 broadcast。

关联的Issue

#1868

测试

文档更新

类型标签

  • 新特性
  • Bug修复
  • 性能优化
  • 文档更新
  • 其他,请描述:
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangqijia1 的贡献)
Zzhangqijia1成员
6月5日 创建了 pull request,commit ce3dcb61
Zzhangqijia1成员
6月5日 关联了issue:[Requirement|需求建议]: LogAddExp 算子新增 Ascend950 AscendC 实现
CANN-robotCANN-robot成员
6月5日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6月5日 评论:

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
*/*/op_api/*.h 汤磊, 宋凯, 冯彤 (3/2) 汤磊 (1/1)
*/*/op_host/*_def.cpp 汤磊, 宋凯, 冯彤 (3/2) 汤磊 (1/1)
math/log_add_exp 宋凯, 唐燕峰, 冯彤 (3/2) 宋凯, 唐燕峰 (2/1)
repo-cann/ops-math 宋凯, 冯彤 (2/2) 宋凯 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
Zzhangqijia1成员
6月5日 修改了pull request 的描述
此处折叠了100条消息 查看更多
CANN-robotCANN-robot成员
6月8日 添加了label:approved
rxtfeng成员
6月8日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
6月8日 添加了label:lgtm
CANN-robotCANN-robot成员
6月8日 关闭了关联的issue
CANN-robotCANN-robot成员
6月8日 合入了pull request