| Files | Last commit | Last update |
|---|---|---|
docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Co-authored-by: tianye<tianye82@h-partners.com> # message auto-generated for no-merge-commit merge: !7166 merge br_fixissue into master docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Created-by: transformer910 Commit-by: tianye Merged-by: cann-robot Description: ## 描述 本 PR 修复 ops-math 中 Round、Log、Exp、LogicalNot 相关 aclnn 接口的头文件注释、接口文档和示例与实现不一致的问题,全部为文档/注释口径校正及示例日志修正,不改变运行时行为。 主要改动: | Issue | 问题 | 修复 | | --- | --- | --- | | #4163 | aclnnInplaceLog2 的 selfRef 注释漏列 DOUBLE/COMPLEX64/COMPLEX128 | 按资料与实现补齐 3 种 dtype | | #4142 | aclnnInplaceRoundDecimals 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRoundDecimals 的 self 注释对齐 | | #4132 | aclnnLog10 的 161002 错误码表缺「self 与 out 的 shape 不一致」 | 补充子项,rowspan 3→4 | | #4131 | aclnnLog10 的 out 数据类型列漏列 DOUBLE | 补齐 DOUBLE,与同行使用说明及实现一致 | | #4105 | test_aclnn_inplace_log10.cpp 示例输出标签误写为 acos | 改为 log10 | | #3917 | aclnnExp 的 self 注释漏列 INT64 | 按资料与实现支持列表补齐 | | #3916 | aclnnInplaceRound 错误码表缺 161002 整类说明 | 补充 dtype/format 与维数大于 8 两项 | | #3915 | aclnnInplaceRound 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRound 的 self 注释对齐 | | #3722 | logical_not/README.md 仍称“仅包含 aclnn 接口”,但已存在 op_kernel 实现 | 按实际交付件补充功能说明、实现位置、样例与文档入口 | | #4164 | aclnnRoundDecimals 参数表 decimals 使用说明为空 | 补充整数语义与大值溢出行为说明;未写死统一取值范围,避免与不同产品/计算路径的实际边界冲突 | ## 关联的Issue - https://gitcode.com/cann/ops-math/issues/4163 - https://gitcode.com/cann/ops-math/issues/4142 - https://gitcode.com/cann/ops-math/issues/4132 - https://gitcode.com/cann/ops-math/issues/4131 - https://gitcode.com/cann/ops-math/issues/4105 - https://gitcode.com/cann/ops-math/issues/3917 - https://gitcode.com/cann/ops-math/issues/3916 - https://gitcode.com/cann/ops-math/issues/3915 - https://gitcode.com/cann/ops-math/issues/3722 - https://gitcode.com/cann/ops-math/issues/4164 ## 测试 - 对照仓内实现中的 dtype 支持列表、错误码校验路径和资料参数表逐条核对,确认修改后的注释/文档与实现一致。 - 改动均为注释、Markdown 文档和示例字符串,未改接口签名、校验逻辑或 kernel 实现。 - git diff --check 通过,无空白符错误。 - 未执行 NPU 上板验证:本次仅涉及文档、注释和示例日志标签。 ## 文档更新 - math/exp/op_api/aclnn_exp.h - math/log/op_api/aclnn_log2.h - math/log/docs/aclnnLog10&aclnnInplaceLog10.md - math/log/examples/test_aclnn_inplace_log10.cpp - math/round/op_api/aclnn_round.h - math/round/docs/aclnnRound&aclnnInplaceRound.md - math/round/docs/aclnnRoundDecimals&aclnnInplaceRoundDecimals.md - math/logical_not/README.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7166 | 4 days ago | |
docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Co-authored-by: tianye<tianye82@h-partners.com> # message auto-generated for no-merge-commit merge: !7166 merge br_fixissue into master docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Created-by: transformer910 Commit-by: tianye Merged-by: cann-robot Description: ## 描述 本 PR 修复 ops-math 中 Round、Log、Exp、LogicalNot 相关 aclnn 接口的头文件注释、接口文档和示例与实现不一致的问题,全部为文档/注释口径校正及示例日志修正,不改变运行时行为。 主要改动: | Issue | 问题 | 修复 | | --- | --- | --- | | #4163 | aclnnInplaceLog2 的 selfRef 注释漏列 DOUBLE/COMPLEX64/COMPLEX128 | 按资料与实现补齐 3 种 dtype | | #4142 | aclnnInplaceRoundDecimals 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRoundDecimals 的 self 注释对齐 | | #4132 | aclnnLog10 的 161002 错误码表缺「self 与 out 的 shape 不一致」 | 补充子项,rowspan 3→4 | | #4131 | aclnnLog10 的 out 数据类型列漏列 DOUBLE | 补齐 DOUBLE,与同行使用说明及实现一致 | | #4105 | test_aclnn_inplace_log10.cpp 示例输出标签误写为 acos | 改为 log10 | | #3917 | aclnnExp 的 self 注释漏列 INT64 | 按资料与实现支持列表补齐 | | #3916 | aclnnInplaceRound 错误码表缺 161002 整类说明 | 补充 dtype/format 与维数大于 8 两项 | | #3915 | aclnnInplaceRound 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRound 的 self 注释对齐 | | #3722 | logical_not/README.md 仍称“仅包含 aclnn 接口”,但已存在 op_kernel 实现 | 按实际交付件补充功能说明、实现位置、样例与文档入口 | | #4164 | aclnnRoundDecimals 参数表 decimals 使用说明为空 | 补充整数语义与大值溢出行为说明;未写死统一取值范围,避免与不同产品/计算路径的实际边界冲突 | ## 关联的Issue - https://gitcode.com/cann/ops-math/issues/4163 - https://gitcode.com/cann/ops-math/issues/4142 - https://gitcode.com/cann/ops-math/issues/4132 - https://gitcode.com/cann/ops-math/issues/4131 - https://gitcode.com/cann/ops-math/issues/4105 - https://gitcode.com/cann/ops-math/issues/3917 - https://gitcode.com/cann/ops-math/issues/3916 - https://gitcode.com/cann/ops-math/issues/3915 - https://gitcode.com/cann/ops-math/issues/3722 - https://gitcode.com/cann/ops-math/issues/4164 ## 测试 - 对照仓内实现中的 dtype 支持列表、错误码校验路径和资料参数表逐条核对,确认修改后的注释/文档与实现一致。 - 改动均为注释、Markdown 文档和示例字符串,未改接口签名、校验逻辑或 kernel 实现。 - git diff --check 通过,无空白符错误。 - 未执行 NPU 上板验证:本次仅涉及文档、注释和示例日志标签。 ## 文档更新 - math/exp/op_api/aclnn_exp.h - math/log/op_api/aclnn_log2.h - math/log/docs/aclnnLog10&aclnnInplaceLog10.md - math/log/examples/test_aclnn_inplace_log10.cpp - math/round/op_api/aclnn_round.h - math/round/docs/aclnnRound&aclnnInplaceRound.md - math/round/docs/aclnnRoundDecimals&aclnnInplaceRoundDecimals.md - math/logical_not/README.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7166 | 4 days ago | |
迁移开源TF插件--math Co-authored-by: yaochen<yaochen15@huawei.com> # message auto-generated for no-merge-commit merge: !4308 merge transfer-math into master 迁移开源TF插件--math Created-by: nextyale Commit-by: yaochen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:迁移TF插件 See merge request: cann/ops-math!4308 | 3 months ago | |
docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Co-authored-by: tianye<tianye82@h-partners.com> # message auto-generated for no-merge-commit merge: !7166 merge br_fixissue into master docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Created-by: transformer910 Commit-by: tianye Merged-by: cann-robot Description: ## 描述 本 PR 修复 ops-math 中 Round、Log、Exp、LogicalNot 相关 aclnn 接口的头文件注释、接口文档和示例与实现不一致的问题,全部为文档/注释口径校正及示例日志修正,不改变运行时行为。 主要改动: | Issue | 问题 | 修复 | | --- | --- | --- | | #4163 | aclnnInplaceLog2 的 selfRef 注释漏列 DOUBLE/COMPLEX64/COMPLEX128 | 按资料与实现补齐 3 种 dtype | | #4142 | aclnnInplaceRoundDecimals 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRoundDecimals 的 self 注释对齐 | | #4132 | aclnnLog10 的 161002 错误码表缺「self 与 out 的 shape 不一致」 | 补充子项,rowspan 3→4 | | #4131 | aclnnLog10 的 out 数据类型列漏列 DOUBLE | 补齐 DOUBLE,与同行使用说明及实现一致 | | #4105 | test_aclnn_inplace_log10.cpp 示例输出标签误写为 acos | 改为 log10 | | #3917 | aclnnExp 的 self 注释漏列 INT64 | 按资料与实现支持列表补齐 | | #3916 | aclnnInplaceRound 错误码表缺 161002 整类说明 | 补充 dtype/format 与维数大于 8 两项 | | #3915 | aclnnInplaceRound 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRound 的 self 注释对齐 | | #3722 | logical_not/README.md 仍称“仅包含 aclnn 接口”,但已存在 op_kernel 实现 | 按实际交付件补充功能说明、实现位置、样例与文档入口 | | #4164 | aclnnRoundDecimals 参数表 decimals 使用说明为空 | 补充整数语义与大值溢出行为说明;未写死统一取值范围,避免与不同产品/计算路径的实际边界冲突 | ## 关联的Issue - https://gitcode.com/cann/ops-math/issues/4163 - https://gitcode.com/cann/ops-math/issues/4142 - https://gitcode.com/cann/ops-math/issues/4132 - https://gitcode.com/cann/ops-math/issues/4131 - https://gitcode.com/cann/ops-math/issues/4105 - https://gitcode.com/cann/ops-math/issues/3917 - https://gitcode.com/cann/ops-math/issues/3916 - https://gitcode.com/cann/ops-math/issues/3915 - https://gitcode.com/cann/ops-math/issues/3722 - https://gitcode.com/cann/ops-math/issues/4164 ## 测试 - 对照仓内实现中的 dtype 支持列表、错误码校验路径和资料参数表逐条核对,确认修改后的注释/文档与实现一致。 - 改动均为注释、Markdown 文档和示例字符串,未改接口签名、校验逻辑或 kernel 实现。 - git diff --check 通过,无空白符错误。 - 未执行 NPU 上板验证:本次仅涉及文档、注释和示例日志标签。 ## 文档更新 - math/exp/op_api/aclnn_exp.h - math/log/op_api/aclnn_log2.h - math/log/docs/aclnnLog10&aclnnInplaceLog10.md - math/log/examples/test_aclnn_inplace_log10.cpp - math/round/op_api/aclnn_round.h - math/round/docs/aclnnRound&aclnnInplaceRound.md - math/round/docs/aclnnRoundDecimals&aclnnInplaceRoundDecimals.md - math/logical_not/README.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7166 | 4 days ago | |
abs等算子A5实现 Co-authored-by: ly_cann_coder<liyao152@huawei.com> # message auto-generated for no-merge-commit merge: !495 merge develop into master abs等算子A5实现 Created-by: ly_cann_coder Commit-by: ly_cann_coder Merged-by: cann-robot Description: ## 描述 新增以下算子的A5实现 |序号| 算子 | 功能 | |--|--|--| |1| abs | 为输入张量的每一个元素取绝对值 | |2| add | 对输入完成相加操作 | |3| addcdiv | 张量运算函数,用于执行乘除加组合操作,将张量除法(带缩放)+ 张量加法合并为单个操作 | |4| addcmul | 张量运算函数,用于执行乘除加组合操作,将张量乘法(带缩放)+ 张量加法合并为单个操作 | |5| axpy | 源操作数中每个元素与标量求积后和目的操作数中的对应元素相加 | |6| bincount | 计算非负整数数组中每个数的频率 | |7| ceil | 返回输入tensor中每个元素向上取整的结果 | |8| clip_by_value_v2 | 将输入的所有元素限制在一定范围内 | |9| concat | 用于沿指定维度将多个输入 Tensor 进行拼接,输出包含所有输入数据按顺序拼接后的 Tensor | |10| concat_v2 | 用于沿指定维度将多个输入 Tensor 进行拼接,输出包含所有输入数据按顺序拼接后的 Tensor | |11| equal | 计算两个Tensor是否有相同的大小和元素,返回一个Bool类型 | |12|exp|返回一个新的张量,该张量的每个元素都是输入张量对应元素的指数| |13| fill | 对张量进行填充操作,支持非连续的Tensor操作 | |14| floor | 返回输入Tensor中每个元素向下取整,并将结果回填到输入Tensor中 | |15| floor_div | 完成除法计算,对余数向下取整 | |16| floor_mod | 用于计算两个数的模 | |17| is_neg_inf | 判断输入张量的元素是否为负无穷 | |18| is_pos_inf | 判断输入张量的元素是否为正无穷 | |19| less | 判断输入self中的每个元素是否小于输入other的值,返回一个Bool类型的Tensor | |20| less_equal | 判断输入self中的元素值是否小于等于other的值,并将self的每个元素的值与other值的比较结果写入out中 | |21| logical_and | 对两个输入张量的对应元素执行「与逻辑」判断,输出布尔型张量(True/False) | |22| log | 对输入张量x的元素,逐元素进行对数计算,并将结果保存到输出张量y中 | |23| not_equal | 逐元素比较两个输入张量是否不相等 | |24| ones_like | 返回形状和类型相同的张量,所有元素都设置为1 | |25|sign|对输入的tensor逐元素进行Sign符号函数的运算并输出结果tensor| |26| sqrt | 完成非负数平方根计算,负数情况返回nan | |27| sqrt_grad | 完成梯度平方根计算 | |28| square | 为输入张量的每一个元素计算平方值 | |29| squared_difference | 为第一个输入张量减去第二个输入张量,并计算其平方值 | |30| tanh | 激活函数,返回与输入tensor shape相同的tensor,对输入tensor进行elementwise的计算 | |31| tril | 将输入的self张量的最后二维(按shape从左向右数)沿对角线的右上部分置零 | |32| triu | 将输入的self张量的最后二维(按shape从左向右数)沿对角线的左下部分置零 | |33| zeros_like | 将张量填充为全零 | ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!495 | 10 months ago | |
feat(5162):add/cast/tanh/mul/real_div 算子适配5162 Co-authored-by: pcmbyn<liuhaiyang42@huawei.com> # message auto-generated for no-merge-commit merge: !6315 merge master into master feat(5162):add/cast/tanh/mul/real_div 算子适配5162 Created-by: pcmbyn Commit-by: pcmbyn Merged-by: cann-robot Description: ## 描述 将 ops-math 仓 add、cast、tanh、mul、real_div、sub、log、pow、equal、fill 算子适配 Ascend5162A(DAV_5162/Modena 端侧芯片),复用 arch35 同源目录追加式完成,共 24 个文件(10 def + 10 CMakeLists + 4 个 kernel/tiling 文件改动)。 - **统一注册(10 算子)**: *_def.cpp 各追加 1 行 AddConfig("ascend5162a", aicoreConfig)——共享 950 的 config 对象,dtype 注册面与 950 完全一致;CMakeLists.txt 的 SUPPORT_COMPUTE_UNIT 追加 ascend5162a、SUPPORT_TILING_DIR 追加 arch35(与上游 960dt/960pr 条目共存) - **add 源码编译条目**:add_kernel_sources(KERNEL_SRC arch35/add.cpp COMPUTE_UNITS ascend5162a AUTO_SYNC false)——与 950/mc62/kirin 既有条目并列 - **cast kernel 1 处**:cast_impl.h 的 VL_BIT_SIZE 由硬编码 2048 改为 static_cast<int64_t>(AscendC::VECTOR_REG_WIDTH) * B8_BITS(编译期架构常量:950=256B→2048bit 数值不变,5162A=32B→256bit) - **mul kernel 4 处**:#if __CCE_AICORE_SUPPORT_SIMT__ 特性宏隔离 double 乘法的 SIMT 线程仿真路径(mul_dag.h 的 include/定义/调用体 3 处 + mul_apt.cpp 的 double 分支入口 1 处);complex32 与 950 统一走升精度路径(MulComplex32Op),无特殊处理 - **其余零改动**:tanh/sub/log/pow/equal/real_div/fill 的 kernel/tiling、cast 的 tiling、全部 op_api 均无修改 ## 关联的Issue [[Requirement|需求建议]:add、cast、tanh、mul、real_div、sub、log、pow、equal、fill 算子适配5162A](https://gitcode.com/cann/ops-math/issues/3552) ## 测试 ## 文档更新 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6315 | 5 days ago | |
refactor: arch35 算子 Regbase Reg 层旧接口替换为新接口 Co-authored-by: ywx1080114<yuanbin22@huawei.com> # message auto-generated for no-merge-commit merge: !4527 merge fix/api-rename-regbase into master refactor: arch35 算子 Regbase Reg 层旧接口替换为新接口 Created-by: yuanbin_22 Commit-by: ywx1080114 Merged-by: cann-robot Description: ## 描述 将 ops-math 仓库中 19 个算子的 arch35 regbase kernel 实现从 Reg 层旧接口替换为新接口,同时将地址空间限定符 __local_mem__ 统一替换为 __ubuf__,使代码与 AscendC SDK 最新命名规范保持一致。 ### 改动原因 AscendC SDK 新版本对 Reg 层 API 进行了重命名,旧 API(如 Reg::DataCopy、Reg::CompareScalar、Reg::MaskAnd、Reg::MaskOr、Reg::MaskPack、Reg::FusedAbsSub、Reg::FusedMulDstAdd 等)将逐步废弃。本 PR 同步更新仓库中 arch35 regbase 算子 kernel 的接口调用,避免使用将废弃的 API。 ### 改动方法 对 22 个 arch35 regbase kernel 头文件进行批量接口替换,涉及 19 个 math 算子: add_n(2 个文件:add_n_regbase.h、add_n_regbase_fullload.h)、assign_add、assign_sub、cast(cast_impl.h)、ceil、exp、floor(3 个文件:floor_bf16.h、floor_f16.h、floor_f32.h)、is_close(is_close_dag.h)、log、log1p、nan_to_num、neg、reciprocal、round、rsqrt、rsqrt_grad、sign(sign.h)、tanh、trunc 接口替换映射如下: | 旧接口 | 新接口 | 说明 | |--------|--------|------| | Reg::DataCopy(reg, addr) | Reg::LoadAlign(reg, addr) | UB→Reg 加载 | | Reg::DataCopy(addr, reg) | Reg::StoreAlign(addr, reg) | Reg→UB 存储 | | Reg::DataCopy<T, LoadDist/StoreDist> | Reg::LoadAlign/StoreAlign<T, Dist> | 带 Dist 模板参数 | | Reg::DataCopy<T, PostLiteral, Dist> | Reg::LoadAlign/StoreAlign<T, PostLiteral, Dist> | 带 PostLiteral | | Reg::CompareScalar | Reg::Compares | 标量比较 | | CompareScalar(无命名空间) | Compares | 标量比较 | | Reg::MaskAnd | Reg::And | 掩码与运算 | | Reg::MaskOr | Reg::Or | 掩码或运算 | | Reg::MaskPack | Reg::Pack | 掩码打包 | | Reg::FusedAbsSub | Reg::AbsSub | 融合绝对差 | | Reg::FusedMulDstAdd | Reg::MulDstAdd | 融合乘加 | | __local_mem__ | __ubuf__ | 地址空间限定符(涉及 floor、is_close 算子) | > 注:上述替换同时覆盖带 AscendC:: 前缀和不带前缀两种调用形式。替换为纯命名变更,不涉及计算逻辑修改,部分接口替换伴随行格式重排(缩进调整)。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/2585 ## 测试 接口替换为纯命名变更,不涉及计算逻辑修改,通过编译验证和已有 ST/UT 用例回归验证。 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:接口重命名,代码规范对齐 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-math!4527 | 2 months ago | |
fix(log2): preserve complex128 normalization precision Co-authored-by: zhangqijia<zhangqijia1@h-partners.com> # message auto-generated for no-merge-commit merge: !7025 merge fix/issue-4120 into master fix(log2): preserve complex128 normalization precision Created-by: gcw_SUaZx3UQ Commit-by: zhangqijia Merged-by: cann-robot Description: ## 描述 COMPLEX128 的 ln(2) 曾先按 float 求值再转 double,造成约 2.75e-9 的固定比例误差。现在先转为复数分量类型再求 ln(2),COMPLEX64 保持 float,COMPLEX128 使用 double。新增精度与复对数分支方向回归。 ## 关联的Issue Fixes #4120 https://gitcode.com/cann/ops-math/issues/4120 ## 测试 新增 COMPLEX128 回归在原始内核上失败;修复后官方 AICPU Log 单测 28/28 通过,覆盖 COMPLEX128、COMPLEX64 及既有实型路径。Host 构建使用本机 CANN 9.3.0;未完成 NPU 设备执行验证。 本 PR 改动的 C/C++ 文件已按 clang-format 18.1.8 完整格式化;完整 pre-commit(含 clang-format)及 git diff --check 通过。 ## 文档更新 无 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7025 | 7 days ago | |
fix(log2): preserve complex128 normalization precision Co-authored-by: zhangqijia<zhangqijia1@h-partners.com> # message auto-generated for no-merge-commit merge: !7025 merge fix/issue-4120 into master fix(log2): preserve complex128 normalization precision Created-by: gcw_SUaZx3UQ Commit-by: zhangqijia Merged-by: cann-robot Description: ## 描述 COMPLEX128 的 ln(2) 曾先按 float 求值再转 double,造成约 2.75e-9 的固定比例误差。现在先转为复数分量类型再求 ln(2),COMPLEX64 保持 float,COMPLEX128 使用 double。新增精度与复对数分支方向回归。 ## 关联的Issue Fixes #4120 https://gitcode.com/cann/ops-math/issues/4120 ## 测试 新增 COMPLEX128 回归在原始内核上失败;修复后官方 AICPU Log 单测 28/28 通过,覆盖 COMPLEX128、COMPLEX64 及既有实型路径。Host 构建使用本机 CANN 9.3.0;未完成 NPU 设备执行验证。 本 PR 改动的 C/C++ 文件已按 clang-format 18.1.8 完整格式化;完整 pre-commit(含 clang-format)及 git diff --check 通过。 ## 文档更新 无 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7025 | 7 days ago | |
feat(5162):add/cast/tanh/mul/real_div 算子适配5162 Co-authored-by: pcmbyn<liuhaiyang42@huawei.com> # message auto-generated for no-merge-commit merge: !6315 merge master into master feat(5162):add/cast/tanh/mul/real_div 算子适配5162 Created-by: pcmbyn Commit-by: pcmbyn Merged-by: cann-robot Description: ## 描述 将 ops-math 仓 add、cast、tanh、mul、real_div、sub、log、pow、equal、fill 算子适配 Ascend5162A(DAV_5162/Modena 端侧芯片),复用 arch35 同源目录追加式完成,共 24 个文件(10 def + 10 CMakeLists + 4 个 kernel/tiling 文件改动)。 - **统一注册(10 算子)**: *_def.cpp 各追加 1 行 AddConfig("ascend5162a", aicoreConfig)——共享 950 的 config 对象,dtype 注册面与 950 完全一致;CMakeLists.txt 的 SUPPORT_COMPUTE_UNIT 追加 ascend5162a、SUPPORT_TILING_DIR 追加 arch35(与上游 960dt/960pr 条目共存) - **add 源码编译条目**:add_kernel_sources(KERNEL_SRC arch35/add.cpp COMPUTE_UNITS ascend5162a AUTO_SYNC false)——与 950/mc62/kirin 既有条目并列 - **cast kernel 1 处**:cast_impl.h 的 VL_BIT_SIZE 由硬编码 2048 改为 static_cast<int64_t>(AscendC::VECTOR_REG_WIDTH) * B8_BITS(编译期架构常量:950=256B→2048bit 数值不变,5162A=32B→256bit) - **mul kernel 4 处**:#if __CCE_AICORE_SUPPORT_SIMT__ 特性宏隔离 double 乘法的 SIMT 线程仿真路径(mul_dag.h 的 include/定义/调用体 3 处 + mul_apt.cpp 的 double 分支入口 1 处);complex32 与 950 统一走升精度路径(MulComplex32Op),无特殊处理 - **其余零改动**:tanh/sub/log/pow/equal/real_div/fill 的 kernel/tiling、cast 的 tiling、全部 op_api 均无修改 ## 关联的Issue [[Requirement|需求建议]:add、cast、tanh、mul、real_div、sub、log、pow、equal、fill 算子适配5162A](https://gitcode.com/cann/ops-math/issues/3552) ## 测试 ## 文档更新 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6315 | 5 days 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 | |
docs: add English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !7113 merge docs/add-english-translations into master docs: add English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 新增仓库Markdown文档英文译稿(第二批,共409个文件):第一批(已合入)之外的其余全部译稿,覆盖conversion、examples、ge、math、random各类算子README译稿,以及CHANGELOG_en.md、.gitcode PR模板英文版等。 本批内全部仓内链接均指向master已有文件(含第一批已合入的21+2篇译稿),合入后本仓432篇英文文档全部就位,链接完整生效。 本批同时包含4篇基于最新源文档的增量更新(math/ada_cast、math/prod_force_se_a、math/sinkhorn、math/xlogy,对应上游近期文档变更)。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试;已通过链接有效性校验(本批全部相对链接仅指向master已有文件,无指向本PR外未提交文件的链接),并完成逐篇翻译规范自查与语义校对(含支持状态表、限定词、术语、数值符号核对)。 ## 文档更新 新增409个英文译稿文件(*_en.md / .en-US.md),不修改任何现有文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7113 | 6 days ago |
Log
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | × |
Function Description
-
Operator function: computes the logarithm of the elements in the input tensor x element-wise, and saves the result to the output tensor y. It supports input tensors of multiple types and supports the scaling (shift/scale) operation on the input tensor x.
-
Computation formula:
y=logbase(shift+scale∗x)y = log_{base}(shift + scale * x) y=logbase(shift+scale∗x)
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input tensor, which is x in the formula. | INT8, INT16, INT32, INT64, UINT8, FLOAT16, FLOAT, DOUBLE BOOL, BFLOAT16, COMPLEX64, COMPLEX128 |
ND |
| base | Optional attribute |
|
FLOAT | - |
| scale | Optional attribute |
|
FLOAT | - |
| shift | Optional attribute |
|
FLOAT | - |
| y | Output | Output tensor after the logarithm computation, which is y in the formula. | If the input type is an integer type (INT type), the output type is FLOAT; in other cases, the output type is the same as that of the input tensor x |
ND |
Constraint Description
- The parameter base must be greater than 0. The default value -1 indicates the base e.
- If the input value is in the specific range (0,0.01] or [0.95,1.05), the output precision may be unstable
- Integer inputs are automatically converted to the FLOAT type for output
Invocation Description
| Invocation Method | Sample Code | Description |
|---|---|---|
| aclnn invocation | test_aclnn_log test_aclnn_inplace_log |
Invokes the Log operator through the aclnnLog or aclnnInplaceLog API. |
| aclnn invocation | test_aclnn_log2 test_aclnn_inplace_log2 |
Invokes the Log operator through the aclnnLog2 or aclnnInplaceLog2 API. |
| aclnn invocation | test_aclnn_log10 test_aclnn_inplace_log10 |
Invokes the Log operator through the aclnnLog10 or aclnnInplaceLog10 API. |
| Graph-mode invocation | test_geir_log | Invokes the Log operator by building a graph through the operator IR. |