| Files | Last commit | Last update |
|---|---|---|
aidd扫描问题修改 Co-authored-by: y60124828<yanglou1@h-partners.com> # message auto-generated for no-merge-commit merge: !6143 merge master into master aidd扫描问题修改 Created-by: yanglu-1 Commit-by: y60124828 Merged-by: cann-robot Description: ## 描述 aidd扫描问题修改 ## 关联的Issue 关联issue [#3309](https://gitcode.com/cann/ops-math/issues/3309) ## 测试 md文档更新不涉及测试 ## 文档更新 experimental/math/arg_max_with_value/docs/aclnnMaxDim.md experimental/math/not_equal_v2/docs/aclnnNeScalar&aclnnInplaceNeScalar.md experimental/math/rsqrt/docs/aclnnRsqrt&aclnnInplaceRsqrt.md experimental/math/sqrt/docs/aclnnSqrt.md math/add_n/docs/aclnnAddN.md math/cummin/docs/aclnnCummin.md math/mod/docs/aclnnFmodTensor&aclnnInplaceFmodTensor.md math/muls/docs/aclnnMuls&aclnnInplaceMuls.md random/stateless_random_normal_v2/docs/aclnnNormalFloatFloat.md random/stateless_sample_multinomial/docs/aclnnMultinomial.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6143 | 1 month ago | |
refactor: 统一 experimental 目录代码风格(全仓 clang-format) Co-authored-by: songkai111<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !3382 merge master into master refactor: 统一 experimental 目录代码风格(全仓 clang-format) Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 对 experimental/ 目录下的算子源码统一执行 clang-format 格式化,使全仓代码风格与根目录 .clang-format 配置保持一致。 本次改动范围: - 共 1279 个文件,涵盖 experimental/math(1151)与 experimental/conversion(128)两大目录。 - 涉及代码层级:op_kernel(490)、op_host(375)、op_api(200)、examples(171)、tests(156)、op_graph(37)。 - 文件类型:.cpp(834)、.h(445)。 - 涉及硬件分支目录:arch35(48)、arch32(2)。 改动内容为纯格式化(缩进、空格、对齐、单行语句拆分为多行、指针 * 贴合类型等),不涉及任何逻辑修改、新增文件或删除文件,代码语义保持不变。 ## 关联的Issue #1986 ## 测试 clang-format 格式化不改变代码语义,无需新增功能测试;格式化后的算子代码在编译与既有单测/二级冒烟用例下保持原有行为。 ## 文档更新 无。本次仅对源码做格式化,未修改任何文档文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化(clang-format 全仓风格统一) See merge request: cann/ops-math!3382 | 4 months ago | |
refactor: 迁移 experimental 公共头文件引用到 math 后缀 Co-authored-by: clinglai0517<laichangling@huawei.com> # message auto-generated for no-merge-commit merge: !6346 merge refactor/math-prefix-common-headers-1014 into master refactor: 迁移 experimental 公共头文件引用到 math 后缀 Created-by: clinglai0517 Commit-by: clinglai0517 Merged-by: cann-robot Description: ## 描述 继续将 ops-math 的公共 op_api 头文件引用迁移到带 _math 后缀的名称,减少多个算子仓库集成时同名头文件误引用的风险。 本次更新 36 个 experimental 文件中的 42 处引用: - level2_base.h → level2_base_math.h:14 处。 - level2_base_caculation.h → level2_base_caculation_math.h:4 处。 - op_api_def.h → op_api_def_math.h:24 处。 29 个文件附带仓库要求的 clang-format、空白或 EOF 调整,7 个文件仅替换 include;合计新增 418 行、删除 469 行。C++ token 对比在映射头文件名称并忽略注释、空白后保持一致。 现有兼容转发头及 classification 元数据保留;本批继续迁移源码引用,最终软件包的同名头文件冲突仍待后续处理。 ## 关联的Issue 延续公共头文件增加 math 后缀的分阶段迁移:[cann/ops-math#3243](https://gitcode.com/cann/ops-math/issues/3243)。 ## 测试 以下容器结果为该次 37 文件验证记录。 - git diff --check:通过,保留原有 CRLF 文件行尾。 - pre-commit:全部适用 hook 通过,包含 clang-format 18.1.8。 - 显式 OAT:完整扫描 37 文件,全部通过。 - 暂缓 Tile 后,仓库 scripts/ci/gen_ci_cmd.py 按实际 37 文件清单生成并执行 experimental op_api UT,指定 ascend910b:242 用例、24 个 suite 全部通过,未设置 GTEST_FILTER;包含 cross BF16 用例。 - 按实际 37 文件清单生成并执行 experimental --pkg 命令:142 条 kernel 编译任务通过,生产动态库链接及完整出包成功,退出码 0;产出 cann-ops-math-experimental_linux-aarch64.run(4,763,686 字节)。 ## 文档更新 不涉及用户文档更新。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:公共头文件引用重构及格式规范化。 See merge request: cann/ops-math!6346 | 27 days ago | |
Rsqrt算子原型定义添加去重宏 Co-authored-by: Dyrong<dengyirong@huawei.com> # message auto-generated for no-merge-commit merge: !5371 merge master into master Rsqrt算子原型定义添加去重宏 Created-by: Dyrong Commit-by: Dyrong Merged-by: cann-robot Description: ## 描述 Rsqurt算子原型添加去重宏 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/3036 ## 测试 全量包测试 ## 文档更新 ## 类型标签 <!-- [x] 表示选中 --> - [ x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5371 | 2 months ago | |
rsqrt add support int datatype in A2/A3 Co-authored-by: Nice_try<nicetryzzw@163.com> # message auto-generated for no-merge-commit merge: !3863 merge submit-InplaceSqrt into master 【CANN开源开放社区任务】【社区任务】InplaceRsqrt 新增整型数据类型支持 Created-by: Nice_try Commit-by: Nice_try Merged-by: cann-robot Description: ## 描述 ### 改动背景 Rsqrt/InplaceRsqrt 算子原仅支持浮点类型(float16、float、bfloat16),本次 PR 将其数据类型支持扩展至全部整型和布尔类型(int8、int16、int32、uint8、bool),对齐 AscendC 算子的通用数据覆盖范围。 ### 改动内容 #### 1. 算子定义层(op_def / op_proto) - **op_host/rsqrt_def.cpp**:Input/Output 的 DataType 列表新增 DT_INT8、DT_INT16、DT_INT32、DT_UINT8、DT_BOOL - **op_graph/rsqrt_proto.h**:INPUT/OUTPUT 的 TensorType 列表新增上述整型和布尔类型 #### 2. 算子 Tiling 层(op_host/rsqrt_tiling.cpp) - 新增 DATA_NUM_INT32 = 2、DATA_NUM_INT16 = 2、DATA_NUM_INT8 = 6、DATA_NUM_UINT8 = 4、DATA_NUM_BOOL = 2 五个常量,用于各数据类型在 UB 空间中的 Buffer 分配计算 - 在 switch 分支中新增对应数据类型到 ubDataNumber 的映射 - tiling 函数已扩展覆盖全部新增类型,无需额外修改注册逻辑 #### 3. 算子 ACLNN API 层(op_api/aclnn_rsqrt.cpp) - DTYPE_SUPPORT_LIST 移除旧版的独立 DTYPE_OUT_LIST(仅浮点),统一为一个支持全部 8 种类型的列表 - 移除 CheckDtypeValid 中不必要的 OUTPUT 类型检查重复逻辑 - 移除多余的 Cast 中间转换序列(由 rsqrt.cpp 内部统一处理) - **新增关键校验**:CheckDtypeValid 增加 self->GetDataType() != out->GetDataType() 检查,确保 self 和 out 的数据类型必须一致,避免 ViewCopy 在 dtype 不匹配时出现未定义行为 #### 4. 算子 Kernel 层(op_kernel/rsqrt.h / rsqrt.cpp) - rsqrt_tiling_data.h:RsqrtTilingData 结构体将 tile/tail 相关字段从 uint32_t 升级为 uint64_t,避免大 shape 下溢出 - rsqrt.h:KernelRsqrt 模板类新增 ComputeImpl 分派函数,按 TYPE_X 类型分发至以下计算函数: - **int32**:Cast 到 float → Rsqrt → Cast(CAST_RINT) 写回 int32 - **int16**:Cast 到 half → Rsqrt → ComputeIntCorrection(Mins/Adds/Maxs/Muls/Sub 校正)→ Cast(CAST_RINT) 写回 int16 - **int8**:Cast 到 half → Rsqrt → ComputeIntCorrection → Cast(CAST_RINT) 写回 int8 - **uint8**:Cast 到 half → Rsqrt → Cast(CAST_RINT) 写回 uint8 - **bool**:直接 Duplicate(0x0101) 填充 int16_t 模式,每个输入元素输出 true - ComputeIntCorrection 为 int16/int8 类型提供分段线性校正:将 [0, 2] 范围的 Rsqrt 结果通过 min(2)→add(-1)→max(0)→mul(3)→sub 的校正公式压缩到正确范围 - rsqrt.cpp:扩展 REGISTER_TILING_DEFAULT 和 DTYPE_X 宏路径,单入口 rsqrt<schMode> 模板支持 schMode=0(双缓冲)和 schMode=1(单缓冲) #### 5. 测试层(tests/ut) **op_api 测试**(test_aclnn_rsqrt.cpp): - 16 个测试用例,覆盖 int16、float16、bf16、float、int32、uint8 等类型的正常入参 - 覆盖不同 shape、空 tensor、非连续、低维/高维、inplace 等场景 - 覆盖 dtype 不匹配(ACLNN_ERR_PARAM_INVALID)、shape 不一致、nullptr 等错误路径 **op_host 测试**: - test_rsqrt_infershape.cpp:3 个测试用例覆盖 float、float16、bf16 的 shape 推导 - test_rsqrt_tiling.cpp:5 个测试用例覆盖不同 shape(8x8、8x2048、1023x2047)和数据类型(float、float16、bf16)的 tiling 参数计算 **op_kernel 测试**: - test_rsqrt.cpp:float32 单缓冲(单流水)测试 + float32 双缓冲(双流水)测试,均检查 system() 返回值 - test_rsqrt_int8.cpp:int8 类型 kernel 端到端测试 - test_rsqrt_int16.cpp:int16 类型 kernel 端到端测试 - test_rsqrt_int32.cpp:int32 类型 kernel 端到端测试 - test_rsqrt_uint8.cpp:uint8 类型 kernel 端到端测试 - test_rsqrt_bool.cpp:bool 类型 kernel 端到端测试 - 使用 rsqrt_test_entry.h 共享入口模板(宏拼接生成唯一函数名 rsqrt_int8、rsqrt_int16 等),避免多 DTYPE_X 文件的 ODR 冲突 - gen_data.py / compare_data.py:同时支持 8 种数据类型的 golden 数据生成与结果比对,整型使用 float32 精度计算对齐 AscendC Rsqrt 结果 ## 关联的Issue [#2156](https://gitcode.com/cann/ops-math/issues/2156) ## 测试 - **UT 测试**(全部通过): - --opapi:16/16 ✅ - --ophost:8/8 ✅ - --opkernel:7/7 ✅ - **AscendOpTest 测试**:已通过算子泛化测试 - **测试覆盖的数据类型**:float16、float、bfloat16、int8、int16、int32、uint8、bool ## 文档更新 - 更新了 README.md 文件,补充新增的整型/布尔类型支持说明 - 更新了 docs/aclnnRsqrt&aclnnInplaceRsqrt.md 文件 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3863 | 3 months ago | |
rsqrt add support int datatype in A2/A3 Co-authored-by: Nice_try<nicetryzzw@163.com> # message auto-generated for no-merge-commit merge: !3863 merge submit-InplaceSqrt into master 【CANN开源开放社区任务】【社区任务】InplaceRsqrt 新增整型数据类型支持 Created-by: Nice_try Commit-by: Nice_try Merged-by: cann-robot Description: ## 描述 ### 改动背景 Rsqrt/InplaceRsqrt 算子原仅支持浮点类型(float16、float、bfloat16),本次 PR 将其数据类型支持扩展至全部整型和布尔类型(int8、int16、int32、uint8、bool),对齐 AscendC 算子的通用数据覆盖范围。 ### 改动内容 #### 1. 算子定义层(op_def / op_proto) - **op_host/rsqrt_def.cpp**:Input/Output 的 DataType 列表新增 DT_INT8、DT_INT16、DT_INT32、DT_UINT8、DT_BOOL - **op_graph/rsqrt_proto.h**:INPUT/OUTPUT 的 TensorType 列表新增上述整型和布尔类型 #### 2. 算子 Tiling 层(op_host/rsqrt_tiling.cpp) - 新增 DATA_NUM_INT32 = 2、DATA_NUM_INT16 = 2、DATA_NUM_INT8 = 6、DATA_NUM_UINT8 = 4、DATA_NUM_BOOL = 2 五个常量,用于各数据类型在 UB 空间中的 Buffer 分配计算 - 在 switch 分支中新增对应数据类型到 ubDataNumber 的映射 - tiling 函数已扩展覆盖全部新增类型,无需额外修改注册逻辑 #### 3. 算子 ACLNN API 层(op_api/aclnn_rsqrt.cpp) - DTYPE_SUPPORT_LIST 移除旧版的独立 DTYPE_OUT_LIST(仅浮点),统一为一个支持全部 8 种类型的列表 - 移除 CheckDtypeValid 中不必要的 OUTPUT 类型检查重复逻辑 - 移除多余的 Cast 中间转换序列(由 rsqrt.cpp 内部统一处理) - **新增关键校验**:CheckDtypeValid 增加 self->GetDataType() != out->GetDataType() 检查,确保 self 和 out 的数据类型必须一致,避免 ViewCopy 在 dtype 不匹配时出现未定义行为 #### 4. 算子 Kernel 层(op_kernel/rsqrt.h / rsqrt.cpp) - rsqrt_tiling_data.h:RsqrtTilingData 结构体将 tile/tail 相关字段从 uint32_t 升级为 uint64_t,避免大 shape 下溢出 - rsqrt.h:KernelRsqrt 模板类新增 ComputeImpl 分派函数,按 TYPE_X 类型分发至以下计算函数: - **int32**:Cast 到 float → Rsqrt → Cast(CAST_RINT) 写回 int32 - **int16**:Cast 到 half → Rsqrt → ComputeIntCorrection(Mins/Adds/Maxs/Muls/Sub 校正)→ Cast(CAST_RINT) 写回 int16 - **int8**:Cast 到 half → Rsqrt → ComputeIntCorrection → Cast(CAST_RINT) 写回 int8 - **uint8**:Cast 到 half → Rsqrt → Cast(CAST_RINT) 写回 uint8 - **bool**:直接 Duplicate(0x0101) 填充 int16_t 模式,每个输入元素输出 true - ComputeIntCorrection 为 int16/int8 类型提供分段线性校正:将 [0, 2] 范围的 Rsqrt 结果通过 min(2)→add(-1)→max(0)→mul(3)→sub 的校正公式压缩到正确范围 - rsqrt.cpp:扩展 REGISTER_TILING_DEFAULT 和 DTYPE_X 宏路径,单入口 rsqrt<schMode> 模板支持 schMode=0(双缓冲)和 schMode=1(单缓冲) #### 5. 测试层(tests/ut) **op_api 测试**(test_aclnn_rsqrt.cpp): - 16 个测试用例,覆盖 int16、float16、bf16、float、int32、uint8 等类型的正常入参 - 覆盖不同 shape、空 tensor、非连续、低维/高维、inplace 等场景 - 覆盖 dtype 不匹配(ACLNN_ERR_PARAM_INVALID)、shape 不一致、nullptr 等错误路径 **op_host 测试**: - test_rsqrt_infershape.cpp:3 个测试用例覆盖 float、float16、bf16 的 shape 推导 - test_rsqrt_tiling.cpp:5 个测试用例覆盖不同 shape(8x8、8x2048、1023x2047)和数据类型(float、float16、bf16)的 tiling 参数计算 **op_kernel 测试**: - test_rsqrt.cpp:float32 单缓冲(单流水)测试 + float32 双缓冲(双流水)测试,均检查 system() 返回值 - test_rsqrt_int8.cpp:int8 类型 kernel 端到端测试 - test_rsqrt_int16.cpp:int16 类型 kernel 端到端测试 - test_rsqrt_int32.cpp:int32 类型 kernel 端到端测试 - test_rsqrt_uint8.cpp:uint8 类型 kernel 端到端测试 - test_rsqrt_bool.cpp:bool 类型 kernel 端到端测试 - 使用 rsqrt_test_entry.h 共享入口模板(宏拼接生成唯一函数名 rsqrt_int8、rsqrt_int16 等),避免多 DTYPE_X 文件的 ODR 冲突 - gen_data.py / compare_data.py:同时支持 8 种数据类型的 golden 数据生成与结果比对,整型使用 float32 精度计算对齐 AscendC Rsqrt 结果 ## 关联的Issue [#2156](https://gitcode.com/cann/ops-math/issues/2156) ## 测试 - **UT 测试**(全部通过): - --opapi:16/16 ✅ - --ophost:8/8 ✅ - --opkernel:7/7 ✅ - **AscendOpTest 测试**:已通过算子泛化测试 - **测试覆盖的数据类型**:float16、float、bfloat16、int8、int16、int32、uint8、bool ## 文档更新 - 更新了 README.md 文件,补充新增的整型/布尔类型支持说明 - 更新了 docs/aclnnRsqrt&aclnnInplaceRsqrt.md 文件 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3863 | 3 months ago | |
rsqrt add support int datatype in A2/A3 Co-authored-by: Nice_try<nicetryzzw@163.com> # message auto-generated for no-merge-commit merge: !3863 merge submit-InplaceSqrt into master 【CANN开源开放社区任务】【社区任务】InplaceRsqrt 新增整型数据类型支持 Created-by: Nice_try Commit-by: Nice_try Merged-by: cann-robot Description: ## 描述 ### 改动背景 Rsqrt/InplaceRsqrt 算子原仅支持浮点类型(float16、float、bfloat16),本次 PR 将其数据类型支持扩展至全部整型和布尔类型(int8、int16、int32、uint8、bool),对齐 AscendC 算子的通用数据覆盖范围。 ### 改动内容 #### 1. 算子定义层(op_def / op_proto) - **op_host/rsqrt_def.cpp**:Input/Output 的 DataType 列表新增 DT_INT8、DT_INT16、DT_INT32、DT_UINT8、DT_BOOL - **op_graph/rsqrt_proto.h**:INPUT/OUTPUT 的 TensorType 列表新增上述整型和布尔类型 #### 2. 算子 Tiling 层(op_host/rsqrt_tiling.cpp) - 新增 DATA_NUM_INT32 = 2、DATA_NUM_INT16 = 2、DATA_NUM_INT8 = 6、DATA_NUM_UINT8 = 4、DATA_NUM_BOOL = 2 五个常量,用于各数据类型在 UB 空间中的 Buffer 分配计算 - 在 switch 分支中新增对应数据类型到 ubDataNumber 的映射 - tiling 函数已扩展覆盖全部新增类型,无需额外修改注册逻辑 #### 3. 算子 ACLNN API 层(op_api/aclnn_rsqrt.cpp) - DTYPE_SUPPORT_LIST 移除旧版的独立 DTYPE_OUT_LIST(仅浮点),统一为一个支持全部 8 种类型的列表 - 移除 CheckDtypeValid 中不必要的 OUTPUT 类型检查重复逻辑 - 移除多余的 Cast 中间转换序列(由 rsqrt.cpp 内部统一处理) - **新增关键校验**:CheckDtypeValid 增加 self->GetDataType() != out->GetDataType() 检查,确保 self 和 out 的数据类型必须一致,避免 ViewCopy 在 dtype 不匹配时出现未定义行为 #### 4. 算子 Kernel 层(op_kernel/rsqrt.h / rsqrt.cpp) - rsqrt_tiling_data.h:RsqrtTilingData 结构体将 tile/tail 相关字段从 uint32_t 升级为 uint64_t,避免大 shape 下溢出 - rsqrt.h:KernelRsqrt 模板类新增 ComputeImpl 分派函数,按 TYPE_X 类型分发至以下计算函数: - **int32**:Cast 到 float → Rsqrt → Cast(CAST_RINT) 写回 int32 - **int16**:Cast 到 half → Rsqrt → ComputeIntCorrection(Mins/Adds/Maxs/Muls/Sub 校正)→ Cast(CAST_RINT) 写回 int16 - **int8**:Cast 到 half → Rsqrt → ComputeIntCorrection → Cast(CAST_RINT) 写回 int8 - **uint8**:Cast 到 half → Rsqrt → Cast(CAST_RINT) 写回 uint8 - **bool**:直接 Duplicate(0x0101) 填充 int16_t 模式,每个输入元素输出 true - ComputeIntCorrection 为 int16/int8 类型提供分段线性校正:将 [0, 2] 范围的 Rsqrt 结果通过 min(2)→add(-1)→max(0)→mul(3)→sub 的校正公式压缩到正确范围 - rsqrt.cpp:扩展 REGISTER_TILING_DEFAULT 和 DTYPE_X 宏路径,单入口 rsqrt<schMode> 模板支持 schMode=0(双缓冲)和 schMode=1(单缓冲) #### 5. 测试层(tests/ut) **op_api 测试**(test_aclnn_rsqrt.cpp): - 16 个测试用例,覆盖 int16、float16、bf16、float、int32、uint8 等类型的正常入参 - 覆盖不同 shape、空 tensor、非连续、低维/高维、inplace 等场景 - 覆盖 dtype 不匹配(ACLNN_ERR_PARAM_INVALID)、shape 不一致、nullptr 等错误路径 **op_host 测试**: - test_rsqrt_infershape.cpp:3 个测试用例覆盖 float、float16、bf16 的 shape 推导 - test_rsqrt_tiling.cpp:5 个测试用例覆盖不同 shape(8x8、8x2048、1023x2047)和数据类型(float、float16、bf16)的 tiling 参数计算 **op_kernel 测试**: - test_rsqrt.cpp:float32 单缓冲(单流水)测试 + float32 双缓冲(双流水)测试,均检查 system() 返回值 - test_rsqrt_int8.cpp:int8 类型 kernel 端到端测试 - test_rsqrt_int16.cpp:int16 类型 kernel 端到端测试 - test_rsqrt_int32.cpp:int32 类型 kernel 端到端测试 - test_rsqrt_uint8.cpp:uint8 类型 kernel 端到端测试 - test_rsqrt_bool.cpp:bool 类型 kernel 端到端测试 - 使用 rsqrt_test_entry.h 共享入口模板(宏拼接生成唯一函数名 rsqrt_int8、rsqrt_int16 等),避免多 DTYPE_X 文件的 ODR 冲突 - gen_data.py / compare_data.py:同时支持 8 种数据类型的 golden 数据生成与结果比对,整型使用 float32 精度计算对齐 AscendC Rsqrt 结果 ## 关联的Issue [#2156](https://gitcode.com/cann/ops-math/issues/2156) ## 测试 - **UT 测试**(全部通过): - --opapi:16/16 ✅ - --ophost:8/8 ✅ - --opkernel:7/7 ✅ - **AscendOpTest 测试**:已通过算子泛化测试 - **测试覆盖的数据类型**:float16、float、bfloat16、int8、int16、int32、uint8、bool ## 文档更新 - 更新了 README.md 文件,补充新增的整型/布尔类型支持说明 - 更新了 docs/aclnnRsqrt&aclnnInplaceRsqrt.md 文件 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3863 | 3 months ago | |
提交Ascend C实现的Rsqrt算子 Co-authored-by: skywang2<727854256@qq.com> # message auto-generated for no-merge-commit merge: !643 merge math-Rsqrt into master 提交Ascend C实现的Rsqrt算子 Created-by: skywang2 Commit-by: skywang2 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 使用Ascend C实现rsqrt算子。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [https://gitcode.com/cann/ops-math/issues/369](https://gitcode.com/cann/ops-math/issues/369) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 测试命令: bash build.sh --run_example rsqrt eager cust --vendor_name=custom_wang ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 无 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!643 | 7 months ago | |
产品名变更 Co-authored-by: gitcode-chenjiao<chenjiao31@huawei.com> # message auto-generated for no-merge-commit merge: !5912 merge master into master 产品名变更 Created-by: gitcode-chenjiao Commit-by: gitcode-chenjiao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> AI处理器对应的产品型号名称更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#3258](https://gitcode.com/cann/ops-math/issues/3258) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ok ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> *.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5912 | 1 month ago |
Rsqrt
支持的产品型号
- Atlas A2训练系列产品
产品形态详细说明请参见昇腾产品形态说明
算子描述
-
功能描述
Rsqrt算子将数据进行开方并取倒数运算。 -
原型信息
算子类型(OpType) Rsqrt name Type data type format 算子输入 x tensor float32,float16,bfloat16,int8,int16,int32,uint8,bool ND 算子输出 y tensor float32,float16,bfloat16,int8,int16,int32,uint8,bool ND 核函数名 rsqrt
约束与限制
- x,y,out的数据类型只支持 float32,float16,bfloat16,int8,int16,int32,uint8,bool,数据格式只支持ND
运行验证
测试命令调用方式:build.sh
| 目录 | 描述 |
|---|---|
| test_aclnn_rsqrt.cpp | 通过aclnn调用的方式调用Rsqrt算子。 |
贡献说明
| 贡献者 | 贡献方 | 贡献算子 | 贡献时间 | 贡献内容 |
|---|---|---|---|---|
| skywang2 | 个人开发者 | Rsqrt | 2026/03/30 | 新增Rsqrt算子 |
| Nice_try | 个人开发者 | Rsqrt | 2026/07/06 | Rsqrt新增支持整型数据支持(A2/A3) |