| Files | Last commit | Last update |
|---|---|---|
docs(selu): 移除elementwise算子资料中的维度上限描述 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !13409 merge hardening/Selu-elewise-dims into master docs(selu): 移除elementwise算子资料中的维度上限描述 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 Selu 为 elementwise 算子,经代码审查,算子六层实现(proto/def/infershape/tiling/kernel/aclnn)均无维度限制,aclnn 接口对超过 8 维的输入经展平路径(ReshapeLongTensor)支持(社区压测已实测 9 维输入成功)。原资料维度列"1-8"系错误复述 AscendC 编译框架限制(asc_op_compile_base 的 para_check.py RANK_LIMIT=8 硬编码,仅 GEIR 在线编译链生效),与算子代码真实能力不符。 按资料口径以算子代码真实能力为准的原则(elementwise 算子资料不写维度限制,编译器框架限制不复述入算子资料),将维度列改为不限维度表述(中文"任意维",英文 Any dimension,中英双份成对同步)。 同步删除看护集 rank 异常用例:Selu 算子能力为任意维,测试看护集( tests/st/arch35/)中 rank 异常用例(期望 ACL_ERROR_INVALID_DIMENSION)与"任意维"口径矛盾。图路 rank≤8 属 AscendC 编译框架限制(para_check RANK_LIMIT=8,仅 GEIR 在线编译链生效),不属算子能力看护范围,按评审意见删除。 ### 改动清单 | 文件 | 位置 | 修改 | |---|---|---| | activation/selu/README.md | x 行维度列 | 1-8 → 任意维 | | activation/selu/README.md | y 行维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu self 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu out 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu self 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu out 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → Any dimension | 共 8 处维度单元格(中文 docs 3 + 英文 docs 3 + README 2),其余内容零变化(+8/-8)。其中英文 _en.md 三处系评审指出遗漏后补充同步(同目录中英双份描述同一组接口参数,维度列必须一致)。 看护集 rank 异常用例删除(仅删 4 行,其余用例零变化): | 文件 | 修改 | |---|---| | activation/selu/tests/st/arch35/ttk_kernel_selu_st.csv | 删 L2_Selu_exc_rank_001/003/005 三行(50→47) | | activation/selu/tests/st/arch35/ttk_aclnn_selu_st.csv | 删 L2_aclnnSelu_exc_rank_001 一行(50→49) | ## 关联的Issue Closes #7959 ## 测试 纯文档+看护集用例删除,无代码改动。已核对:算子六层实现 grep dim/rank 零维度拦截;activation/selu 全目录维度语义"1-8"零残留(含中英双份资料);无 README 英文版;表格结构完整;看护 CSV python csv 解析核验(行数 kernel 47/aclnn 49、列结构不变、rank 用例零残留、其余行零变化);pre-commit 全部通过。 ## 文档更新 更新 activation/selu/README.md(2 处)与 activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md(3 处)、activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md(3 处)维度列表述,中英双份同步;删除 activation/selu/tests/st/arch35/ 下两个看护 CSV 中 rank 异常用例共 4 行。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 > 参考:#11931、#12374 已合入,本 PR 为 Selu 资料修正补充。 > 致谢:感谢评审指出英文 _en.md 三处维度单元格漏改(中英双份成对维护契约)及原自检结论"两文件零残留"表述不成立的问题,本版已同步 _en.md 三处并修正自检结论为"activation/selu 全目录维度语义 1-8 零残留(含中英双份)"。 > 补充致谢:感谢评审指出看护集 rank 异常用例(ttk_kernel_selu_st.csv 48/49/50 行、ttk_aclnn_selu_st.csv 42 行)与"任意维"口径矛盾的问题,本版已删除该 4 条用例(处置说明见"描述"节)。 See merge request: cann/ops-nn!13409 | 18 days ago | |
test(selu): 补充 GEIR 静态/动态 example 数值校验 Co-authored-by: aqt666<2016141505@qq.com> Co-authored-by: raywcm<wcm@njust.edu.cn> # message auto-generated for no-merge-commit merge: !9176 merge cherry-pick-mr-8972-1787642179305-auto into master test(selu): 补充 GEIR 静态/动态 example 数值校验 Created-by: aqt666 Commit-by: aqt666;raywcm Merged-by: cann-robot Description: ## 描述 补充 SELU 算子 GEIR 静态和动态 example 的数值校验,验证算子执行结果与预期结果一致,覆盖静态 Shape 和动态 Shape 场景。 同时根据 pre-commit 检查结果,对相关 C++ 文件执行了文件末尾换行修复和 clang-format 格式化。 ## 关联的Issue 无。 ## 测试 1. 执行 SELU GEIR 静态 example。 2. 执行 SELU GEIR 动态 example。 3. 校验输出 Shape、数据类型和计算结果。 4. 执行 pre-commit 检查,end-of-file-fixer 和 clang-format 均通过。 5. 通过 compile 评论触发 CI 门禁,并执行冒烟测试。 ## 文档更新 无。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:补充 SELU 算子 GEIR 静态和动态 example 数值校验测试 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9176 | 2 months ago | |
TF plugin开源 Co-authored-by: sunchun<sunchun4@h-partners.com> # message auto-generated for no-merge-commit merge: !7516 merge nn into master TF plugin开源 Created-by: sunchun Commit-by: sunchun Merged-by: cann-robot Description: ## 描述 TF plugin开源修改 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/4196 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!7516 | 3 months ago | |
[selu] 移除aclnn接口CanCast过度拦截并更正看护集混合dtype用例命名 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12374 merge hardening/Selu-cast-fix into master [selu] 移除aclnn接口CanCast过度拦截并更正看护集混合dtype用例命名 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 背景 PR #11931 合入的 OP_CHECK_RESULT_DTYPE_CAST_FAILED 静态 CanCast 检查属过度拦截: CanCast 静态判断表不代表 l0::Cast 运行时真实能力。实测 exc_format_005/007(self=float16, out=int32)移除该行后恢复执行,输出 binary_equal 100% PASS;dump 级全元素佐证输出==trunc(golden_f16)(005: 2,358,720/2,358,720;007: 61,034,400/61,034,400,torch copy_ 截断语义)。 ## 改动清单(4 文件,+6/-22) | 文件 | 改动 | |---|---| | op_api/aclnn_selu.cpp | 删 CheckDtypeValid 中 CanCast 1 行(恢复两条 NOT_SUPPORT 支持表校验,5 处判空 CHECK_RET 保留) | | docs/aclnnSelu&aclnnInplaceSelu.md | 161002 错误码表删除第③行"参数out的数据类型不是self可转换的。",rowspan 3→2(该拦截已不存在) | | tests/ut/op_host/op_api/test_aclnn_selu.cpp | 删 test_selu_dtype_not_castable;test_selu_mixed_dtype_cast 增 FLOAT→INT32 合法组合(共 5 组断言 SUCCESS) | | tests/st/arch35/ttk_aclnn_selu_st.csv | 看护集 005/007 更名 exc_format→mixed_dtype(与 006/008~011 命名一致),remark 改"混合 dtype f16→i32; l0::Cast 运行时转换",dtype/shape 等参数零变化 | ## 测试证据 - 三层核验: build --pkg SUCCESS→.run 安装 SUCCESS→verify_install rc=0(安装产物新于源码)→binpath rc=0(Selu kernel 落 vendors/hardening_nn) - 定向 117 条回归(Ascend950PR,cann-9.2.0): 37 PASS+73 FAIL+7 GEN,与 R5 基线逐条对账零迁移(005/007[新名]维持 PASS,CSV 改名不影响执行,冒烟佐证) - 冒烟: L1_aclnnSelu_mixed_dtype_005/007 各 1/1 PASS(--pc 1 --compare mixed) - UT: nn_op_api_ut 20/20 PASSED(含 test_selu_mixed_dtype_cast FLOAT→INT32)+nn_op_host_ut 19/19 PASSED - pre-commit 12 hooks 全过(OAT 127 warning 属环境缺 oat 包,hook Passed) ## 关联 Refs #6674(移除口径: 期望行为=删除文档第③行、不补 CanCast 防护、混合 dtype UT 断言 SUCCESS) 基于 #11931 已合入内容(相对 upstream master 纯增量 diff,恰 4 文件)。 See merge request: cann/ops-nn!12374 | 1 month ago | |
legacy下线:整改NN算子图模式注册与日志规范 Co-authored-by: zhouxuan78<zhouxuan78@huawei.com> # message auto-generated for no-merge-commit merge: !8388 merge master into master legacy下线:整改NN算子图模式注册与日志规范 Created-by: zhouxuan78 Commit-by: zhouxuan78 Merged-by: cann-robot Description: ## 描述 本 PR 用于 ops-nn 仓 Legacy 下线整改,补齐部分算子的直调/图模式注册、InferShape / InferDataType 拆分、日志规范整改及必要的编译/预提交问题修复。 1. 补齐多个算子的 op_graph 侧 InferDataType / graph infer 注册文件,并同步补充对应 CMakeLists.txt: - 如 FastGeluV2、HardShrinkGrad、HardSigmoidGrad、HardSwish、HardSwishGrad、Selu、SeluGrad、Shrink、SoftplusGrad、SoftplusV2、SoftplusV2Grad、Softsign、SoftsignGrad、SmoothL1Loss、SoftMarginLoss、LpNormUpdateV2、ApplyFtrlV2、ApplyMomentum、ApplyRMSProp 等。 2. 调整部分算子的 op_host infer 文件: - 将 InferDataType 逻辑从 infershape 文件中拆分/迁移到 op_graph 侧; - 保留 InferShape 逻辑,避免 shape/type 混在同一处注册; - 收敛 IndexCheck infershape 日志,仅保留入口日志。 3. 补充 SoftMarginLoss 图模式原型: - 新增 loss/soft_margin_loss/op_graph/soft_margin_loss_proto.h; - 新增 OPS_PROTO_DEF_SOFTMARGINLOSS 去重宏,避免重复注册; - 补充 SoftMarginLoss 的 op_graph/CMakeLists.txt 和 graph infer 注册。 4. 日志整改: - 为 Arch35 tiling 入口补充统一入口日志; - 对本 PR 修改范围内新增/调整的外部输入错误日志,按规范使用 OP_LOGE_FOR_INVALID_* 系列上报接口; - 收敛部分过多的 tiling / infershape 日志打印,避免循环或冗余打印。 5. 回退/收敛不属于本次整改范围的 Softshrink 重命名相关改动: - Softshrink -> SoftShrink 的命名调整不放在本 PR 中,后续单独 PR 处理。 6. 修复 pre-commit 格式问题: - 按仓库 .clang-format 修复格式; - 不修改 .pre-commit-config.yaml。 影响范围 主要影响 activation、index、loss、norm、optim、quant、vfusion 等目录下 Legacy 下线相关算子的 op_graph 注册、InferDataType 拆分、tiling 入口日志和错误日志规范。 ## 变更内容 ## 关联的Issue ## 测试 ## 文档更新 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:Legacy包下线整改 See merge request: cann/ops-nn!8388 | 2 months ago | |
legacy下线:整改NN算子图模式注册与日志规范 Co-authored-by: zhouxuan78<zhouxuan78@huawei.com> # message auto-generated for no-merge-commit merge: !8388 merge master into master legacy下线:整改NN算子图模式注册与日志规范 Created-by: zhouxuan78 Commit-by: zhouxuan78 Merged-by: cann-robot Description: ## 描述 本 PR 用于 ops-nn 仓 Legacy 下线整改,补齐部分算子的直调/图模式注册、InferShape / InferDataType 拆分、日志规范整改及必要的编译/预提交问题修复。 1. 补齐多个算子的 op_graph 侧 InferDataType / graph infer 注册文件,并同步补充对应 CMakeLists.txt: - 如 FastGeluV2、HardShrinkGrad、HardSigmoidGrad、HardSwish、HardSwishGrad、Selu、SeluGrad、Shrink、SoftplusGrad、SoftplusV2、SoftplusV2Grad、Softsign、SoftsignGrad、SmoothL1Loss、SoftMarginLoss、LpNormUpdateV2、ApplyFtrlV2、ApplyMomentum、ApplyRMSProp 等。 2. 调整部分算子的 op_host infer 文件: - 将 InferDataType 逻辑从 infershape 文件中拆分/迁移到 op_graph 侧; - 保留 InferShape 逻辑,避免 shape/type 混在同一处注册; - 收敛 IndexCheck infershape 日志,仅保留入口日志。 3. 补充 SoftMarginLoss 图模式原型: - 新增 loss/soft_margin_loss/op_graph/soft_margin_loss_proto.h; - 新增 OPS_PROTO_DEF_SOFTMARGINLOSS 去重宏,避免重复注册; - 补充 SoftMarginLoss 的 op_graph/CMakeLists.txt 和 graph infer 注册。 4. 日志整改: - 为 Arch35 tiling 入口补充统一入口日志; - 对本 PR 修改范围内新增/调整的外部输入错误日志,按规范使用 OP_LOGE_FOR_INVALID_* 系列上报接口; - 收敛部分过多的 tiling / infershape 日志打印,避免循环或冗余打印。 5. 回退/收敛不属于本次整改范围的 Softshrink 重命名相关改动: - Softshrink -> SoftShrink 的命名调整不放在本 PR 中,后续单独 PR 处理。 6. 修复 pre-commit 格式问题: - 按仓库 .clang-format 修复格式; - 不修改 .pre-commit-config.yaml。 影响范围 主要影响 activation、index、loss、norm、optim、quant、vfusion 等目录下 Legacy 下线相关算子的 op_graph 注册、InferDataType 拆分、tiling 入口日志和错误日志规范。 ## 变更内容 ## 关联的Issue ## 测试 ## 文档更新 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:Legacy包下线整改 See merge request: cann/ops-nn!8388 | 2 months ago | |
test(selu): 补充 GEIR 静态/动态 example 数值校验 Co-authored-by: aqt666<2016141505@qq.com> Co-authored-by: raywcm<wcm@njust.edu.cn> # message auto-generated for no-merge-commit merge: !9176 merge cherry-pick-mr-8972-1787642179305-auto into master test(selu): 补充 GEIR 静态/动态 example 数值校验 Created-by: aqt666 Commit-by: aqt666;raywcm Merged-by: cann-robot Description: ## 描述 补充 SELU 算子 GEIR 静态和动态 example 的数值校验,验证算子执行结果与预期结果一致,覆盖静态 Shape 和动态 Shape 场景。 同时根据 pre-commit 检查结果,对相关 C++ 文件执行了文件末尾换行修复和 clang-format 格式化。 ## 关联的Issue 无。 ## 测试 1. 执行 SELU GEIR 静态 example。 2. 执行 SELU GEIR 动态 example。 3. 校验输出 Shape、数据类型和计算结果。 4. 执行 pre-commit 检查,end-of-file-fixer 和 clang-format 均通过。 5. 通过 compile 评论触发 CI 门禁,并执行冒烟测试。 ## 文档更新 无。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:补充 SELU 算子 GEIR 静态和动态 example 数值校验测试 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9176 | 2 months ago | |
docs(selu): 移除elementwise算子资料中的维度上限描述 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !13409 merge hardening/Selu-elewise-dims into master docs(selu): 移除elementwise算子资料中的维度上限描述 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 Selu 为 elementwise 算子,经代码审查,算子六层实现(proto/def/infershape/tiling/kernel/aclnn)均无维度限制,aclnn 接口对超过 8 维的输入经展平路径(ReshapeLongTensor)支持(社区压测已实测 9 维输入成功)。原资料维度列"1-8"系错误复述 AscendC 编译框架限制(asc_op_compile_base 的 para_check.py RANK_LIMIT=8 硬编码,仅 GEIR 在线编译链生效),与算子代码真实能力不符。 按资料口径以算子代码真实能力为准的原则(elementwise 算子资料不写维度限制,编译器框架限制不复述入算子资料),将维度列改为不限维度表述(中文"任意维",英文 Any dimension,中英双份成对同步)。 同步删除看护集 rank 异常用例:Selu 算子能力为任意维,测试看护集( tests/st/arch35/)中 rank 异常用例(期望 ACL_ERROR_INVALID_DIMENSION)与"任意维"口径矛盾。图路 rank≤8 属 AscendC 编译框架限制(para_check RANK_LIMIT=8,仅 GEIR 在线编译链生效),不属算子能力看护范围,按评审意见删除。 ### 改动清单 | 文件 | 位置 | 修改 | |---|---|---| | activation/selu/README.md | x 行维度列 | 1-8 → 任意维 | | activation/selu/README.md | y 行维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu self 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu out 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu self 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu out 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → Any dimension | 共 8 处维度单元格(中文 docs 3 + 英文 docs 3 + README 2),其余内容零变化(+8/-8)。其中英文 _en.md 三处系评审指出遗漏后补充同步(同目录中英双份描述同一组接口参数,维度列必须一致)。 看护集 rank 异常用例删除(仅删 4 行,其余用例零变化): | 文件 | 修改 | |---|---| | activation/selu/tests/st/arch35/ttk_kernel_selu_st.csv | 删 L2_Selu_exc_rank_001/003/005 三行(50→47) | | activation/selu/tests/st/arch35/ttk_aclnn_selu_st.csv | 删 L2_aclnnSelu_exc_rank_001 一行(50→49) | ## 关联的Issue Closes #7959 ## 测试 纯文档+看护集用例删除,无代码改动。已核对:算子六层实现 grep dim/rank 零维度拦截;activation/selu 全目录维度语义"1-8"零残留(含中英双份资料);无 README 英文版;表格结构完整;看护 CSV python csv 解析核验(行数 kernel 47/aclnn 49、列结构不变、rank 用例零残留、其余行零变化);pre-commit 全部通过。 ## 文档更新 更新 activation/selu/README.md(2 处)与 activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md(3 处)、activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md(3 处)维度列表述,中英双份同步;删除 activation/selu/tests/st/arch35/ 下两个看护 CSV 中 rank 异常用例共 4 行。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 > 参考:#11931、#12374 已合入,本 PR 为 Selu 资料修正补充。 > 致谢:感谢评审指出英文 _en.md 三处维度单元格漏改(中英双份成对维护契约)及原自检结论"两文件零残留"表述不成立的问题,本版已同步 _en.md 三处并修正自检结论为"activation/selu 全目录维度语义 1-8 零残留(含中英双份)"。 > 补充致谢:感谢评审指出看护集 rank 异常用例(ttk_kernel_selu_st.csv 48/49/50 行、ttk_aclnn_selu_st.csv 42 行)与"任意维"口径矛盾的问题,本版已删除该 4 条用例(处置说明见"描述"节)。 See merge request: cann/ops-nn!13409 | 18 days ago | |
[CANNBot] selu算子迁移到build-in支持Ascend950 Co-authored-by: lianjieyu<yulianjie@huawei.com> # message auto-generated for no-merge-commit merge: !5064 merge selu into master [CANNBot] selu算子迁移到build-in支持Ascend950 Created-by: lianjieyu Commit-by: lianjieyu Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> selu算子迁移到build-in支持Ascend950 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/2843 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!5064 | 5 months ago | |
docs(selu): 移除elementwise算子资料中的维度上限描述 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !13409 merge hardening/Selu-elewise-dims into master docs(selu): 移除elementwise算子资料中的维度上限描述 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 Selu 为 elementwise 算子,经代码审查,算子六层实现(proto/def/infershape/tiling/kernel/aclnn)均无维度限制,aclnn 接口对超过 8 维的输入经展平路径(ReshapeLongTensor)支持(社区压测已实测 9 维输入成功)。原资料维度列"1-8"系错误复述 AscendC 编译框架限制(asc_op_compile_base 的 para_check.py RANK_LIMIT=8 硬编码,仅 GEIR 在线编译链生效),与算子代码真实能力不符。 按资料口径以算子代码真实能力为准的原则(elementwise 算子资料不写维度限制,编译器框架限制不复述入算子资料),将维度列改为不限维度表述(中文"任意维",英文 Any dimension,中英双份成对同步)。 同步删除看护集 rank 异常用例:Selu 算子能力为任意维,测试看护集( tests/st/arch35/)中 rank 异常用例(期望 ACL_ERROR_INVALID_DIMENSION)与"任意维"口径矛盾。图路 rank≤8 属 AscendC 编译框架限制(para_check RANK_LIMIT=8,仅 GEIR 在线编译链生效),不属算子能力看护范围,按评审意见删除。 ### 改动清单 | 文件 | 位置 | 修改 | |---|---|---| | activation/selu/README.md | x 行维度列 | 1-8 → 任意维 | | activation/selu/README.md | y 行维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu self 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnSelu out 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → 任意维 | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu self 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnSelu out 维度列 | 1-8 → Any dimension | | activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md | aclnnInplaceSelu selfRef 维度列 | 1-8 → Any dimension | 共 8 处维度单元格(中文 docs 3 + 英文 docs 3 + README 2),其余内容零变化(+8/-8)。其中英文 _en.md 三处系评审指出遗漏后补充同步(同目录中英双份描述同一组接口参数,维度列必须一致)。 看护集 rank 异常用例删除(仅删 4 行,其余用例零变化): | 文件 | 修改 | |---|---| | activation/selu/tests/st/arch35/ttk_kernel_selu_st.csv | 删 L2_Selu_exc_rank_001/003/005 三行(50→47) | | activation/selu/tests/st/arch35/ttk_aclnn_selu_st.csv | 删 L2_aclnnSelu_exc_rank_001 一行(50→49) | ## 关联的Issue Closes #7959 ## 测试 纯文档+看护集用例删除,无代码改动。已核对:算子六层实现 grep dim/rank 零维度拦截;activation/selu 全目录维度语义"1-8"零残留(含中英双份资料);无 README 英文版;表格结构完整;看护 CSV python csv 解析核验(行数 kernel 47/aclnn 49、列结构不变、rank 用例零残留、其余行零变化);pre-commit 全部通过。 ## 文档更新 更新 activation/selu/README.md(2 处)与 activation/selu/docs/aclnnSelu&aclnnInplaceSelu.md(3 处)、activation/selu/docs/aclnnSelu&aclnnInplaceSelu_en.md(3 处)维度列表述,中英双份同步;删除 activation/selu/tests/st/arch35/ 下两个看护 CSV 中 rank 异常用例共 4 行。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 > 参考:#11931、#12374 已合入,本 PR 为 Selu 资料修正补充。 > 致谢:感谢评审指出英文 _en.md 三处维度单元格漏改(中英双份成对维护契约)及原自检结论"两文件零残留"表述不成立的问题,本版已同步 _en.md 三处并修正自检结论为"activation/selu 全目录维度语义 1-8 零残留(含中英双份)"。 > 补充致谢:感谢评审指出看护集 rank 异常用例(ttk_kernel_selu_st.csv 48/49/50 行、ttk_aclnn_selu_st.csv 42 行)与"任意维"口径矛盾的问题,本版已删除该 4 条用例(处置说明见"描述"节)。 See merge request: cann/ops-nn!13409 | 18 days ago | |
docs: add English translations for operator READMEs and repo docs Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !13351 merge docs/add-english-docs into master docs: add English translations for operator READMEs and repo docs Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## Description Add English translations for 652 markdown documents: - Repo-level guides: README_en.md, CONTRIBUTING_en.md, SECURITY_en.md, CHANGELOG_en.md, codearts_check_rule_config_en.md - Operator READMEs under activation/, conv/, control/, foreach/, hash/, index/, loss/, matmul/, norm/, optim/, pooling/, quant/, rnn/, vfusion/, etc. - API and design docs under docs/ (aclnn_*, ascendir_*, fusion pass docs) - examples/ and torch_extension/ guides Note: a few cross-reference links whose English targets are not published yet temporarily point to their Chinese counterparts to keep links valid; they will be switched back to the English docs in a follow-up PR after this one is merged. ## Related Issue N/A ## Test - Verified all 1,344 intra-repo markdown links in the added files resolve against master: 0 broken links, 0 missing targets. ## Documentation Update - This PR only adds English documentation files (*_en.md); no existing Chinese documents are modified. ## Type Labels - [ ] Bug fix - [ ] New feature - [ ] Performance optimization - [x] Documentation update - [ ] Other, please describe: ## AI/Agent-Generated Declaration - [x] AI-assisted authoring See merge request: cann/ops-nn!13351 | 18 days ago |
Selu
English | 简体中文
Applicable Products
| Product | Support |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | √ |
| Atlas inference products | √ |
| Atlas training products | √ |
Function
-
Operator function: computes the SELU (Scaled Exponential Linear Unit) activation function element-wise on the input tensor.
-
Formula:
SELU(x)=scale×(max(0,x)+min(0,α×(ex−1)))\text{SELU}(x) = \text{scale} \times \left( \max(0, x) + \min\left(0, \alpha \times \left(e^x - 1\right)\right) \right) SELU(x)=scale×(max(0,x)+min(0,α×(ex−1)))
Here:
- α=1.6732632423543772848170429916717\alpha = 1.6732632423543772848170429916717α=1.6732632423543772848170429916717
- scale=1.0507009873554804934193349852946\text{scale} = 1.0507009873554804934193349852946scale=1.0507009873554804934193349852946
Piecewise behavior:
- When x>0x > 0x>0: SELU(x)=scale×x\text{SELU}(x) = \text{scale} \times xSELU(x)=scale×x (linear region)
- When x≤0x \le 0x≤0: SELU(x)=scale×α×(ex−1)\text{SELU}(x) = \text{scale} \times \alpha \times (e^x - 1)SELU(x)=scale×α×(ex−1) (exponential saturation region)
Parameters
| Parameter name | Input/Output | Description | Data type | Data format | Dimensions (shape) |
|---|---|---|---|---|---|
| x | Input | The input x in the formula. | FLOAT, FLOAT16, BFLOAT16, INT32, INT8 | ND | Any dimension |
| y | Output | The output y in the formula. The shape is the same as that of the input x. | FLOAT, FLOAT16, BFLOAT16, INT32, INT8 | ND | Any dimension |
Constraints
None
Invocation Description
| Invocation method | Invocation sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_selu | Invokes the Selu operator through the aclnnSelu&aclnnInplaceSelu API. |
| aclnn invocation | test_aclnn_inplace_selu | Invokes the Selu operator through the aclnnSelu&aclnnInplaceSelu API. |
| GE graph mode | test_geir_selu | Invokes the Selu operator through graph construction using the operator IR. |