| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs目录基本概念md文件名改为英文 Co-authored-by: chenjiao<chenjiao31@huawei.com> # message auto-generated for no-merge-commit merge: !4182 merge master into master docs目录基本概念md文件名改为英文 Created-by: gitcode-chenjiao Commit-by: chenjiao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> docs目录基本概念md文件名改为英文: 避免link中的中文字符引发的跳转异常,例如两段式接口.md变成%E4%B8%A4%E6%AE%B5%E5%BC%8F%E6%8E%A5%E5%8F%A3.md,不易于维护,可能导致其他平台跳转有问题。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#2283](https://gitcode.com/cann/ops-math/issues/2283) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ok ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/zh/context所有md和对应的link ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4182 | 1 个月前 | |
Support Acos op with AscendC Co-authored-by: zyf0712<zhangyufei63@huawei.com> # message auto-generated for no-merge-commit merge: !1033 merge master into master Support Acos op with AscendC Created-by: luomin2005 Commit-by: luomin2005;zyf0712 Merged-by: cann-robot Description: ## 描述 使用AscendC实现acos算子 1.按照泰勒公式计算arcsin(x) = Cx + Cx^3 + Cx^5 + Cx^7 + Cx^9 + Cx^11 + Cx^13 + Cx^15 ..... 其中C为泰勒系数,参考常量taylorCoefficients,参考精度要求泰勒系数计算到第8项 T taylorCoefficients[] = {1.0, 1.0 / 6, 3.0 / 40, 5.0 / 112, 35.0 / 1152, 63.0 / 2816, 231.0 / 13312, 143.0 / 10240}; 2.将x取绝对值,并将正负号保存到xSignMask掩码中; 3.当x < Boudry = 0.70710678118654752440084436210485 时计算 arcsin(x), 当x >Boudry计算arcsin(x) = halfPi - 1/2 sqrt(1-x^2) 4.利用arcsin(-x) = -arcsin(x), 根据符号标记合并还原计算负值情况 3.arccos(x) = halfPi - arcsin(x) ## 关联的Issue https://gitcode.com/cann/ops-math/issues/581 ## 测试 [2026-01-30 15:09:13] Start to run examples,name:acos mode:eager [2026-01-30 15:09:13] Start compile and run examples file: ../math/acos/examples/test_aclnn_acos.cpp [2026-01-30 15:09:13] pkg_mode:cust vendor_name:custom [2026-01-30 15:09:19] [Warning]: tiling struct [ReduceOpTilingDataV2] is conflict with one in file kl_div_v2.cc, line 41 [2026-01-30 15:09:19] [Warning]: tiling struct [RepeatInterleaveGradTilingData] is conflict with one in file repeat_interleave_grad_tiling.h, line 21 [2026-01-30 15:09:19] [Warning]: tiling struct [IndexFillTilingData] is conflict with one in file index_fill_tiling.h, line 21 [2026-01-30 15:09:19] [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [2026-01-30 15:09:19] [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [2026-01-30 15:09:19] [Warning]: tiling struct [TopKTopPSampleTilingData] is conflict with one in file top_k_top_p_sample_tiling.h, line 26 [2026-01-30 15:09:19] [Warning]: tiling struct [AvgPool3dGradTilingBlockParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 99 [2026-01-30 15:09:19] [Warning]: tiling struct [AvgPool3dGradTilingParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 125 [2026-01-30 15:09:19] [Warning]: tiling struct [FusedCrossEntropyLossWithMaxSumTilingData] is conflict with one in file fused_cross_entropy_loss_with_max_sum_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [TilingDataBackgroundReplace] is conflict with one in file background_replace_tiling.h, line 22 [2026-01-30 15:09:19] [Warning]: tiling struct [TilingDataBlendImages] is conflict with one in file blend_images_custom_tiling.h, line 24 [2026-01-30 15:09:19] 0 acos(-inf) = nan [2026-01-30 15:09:19] 1 acos(-12.000000) = nan [2026-01-30 15:09:19] 2 acos(-1.000001) = nan [2026-01-30 15:09:19] 3 acos(-1.000010) = nan [2026-01-30 15:09:19] 4 acos(-1.000100) = nan [2026-01-30 15:09:19] 5 acos(-1.001000) = nan [2026-01-30 15:09:19] 6 acos(-1.010000) = nan [2026-01-30 15:09:19] 7 acos(-1.000000) = 3.141593 [2026-01-30 15:09:19] 8 acos(-0.999990) = 3.137117 [2026-01-30 15:09:19] 9 acos(-0.999900) = 3.127449 [2026-01-30 15:09:19] 10 acos(-0.999000) = 3.096868 [2026-01-30 15:09:19] 11 acos(-0.990000) = 3.000053 [2026-01-30 15:09:19] 12 acos(-0.900000) = 2.690566 [2026-01-30 15:09:19] 13 acos(-0.800000) = 2.498095 [2026-01-30 15:09:19] 14 acos(-0.710000) = 2.360346 [2026-01-30 15:09:19] 15 acos(-0.705000) = 2.353167 [2026-01-30 15:09:19] 16 acos(-0.700000) = 2.346148 [2026-01-30 15:09:19] 17 acos(-0.650000) = 2.278369 [2026-01-30 15:09:19] 18 acos(-0.600000) = 2.214295 [2026-01-30 15:09:19] 19 acos(-0.500000) = 2.094395 [2026-01-30 15:09:19] 20 acos(-0.400000) = 1.982313 [2026-01-30 15:09:19] 21 acos(-0.300000) = 1.875489 [2026-01-30 15:09:19] 22 acos(-0.200000) = 1.772154 [2026-01-30 15:09:19] 23 acos(-0.100000) = 1.670964 [2026-01-30 15:09:19] 24 acos(-0.010000) = 1.580796 [2026-01-30 15:09:19] 25 acos(-0.001000) = 1.571796 [2026-01-30 15:09:19] 26 acos(-0.000100) = 1.570896 [2026-01-30 15:09:19] 27 acos(-0.000010) = 1.570806 [2026-01-30 15:09:19] 28 acos(-0.000001) = 1.570797 [2026-01-30 15:09:19] 29 acos(-0.000000) = 1.570796 [2026-01-30 15:09:19] 30 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 31 acos(nan) = nan [2026-01-30 15:09:19] 32 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 33 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 34 acos(0.000001) = 1.570795 [2026-01-30 15:09:19] 35 acos(0.000010) = 1.570786 [2026-01-30 15:09:19] 36 acos(0.000100) = 1.570696 [2026-01-30 15:09:19] 37 acos(0.010000) = 1.560796 [2026-01-30 15:09:19] 38 acos(0.100000) = 1.470629 [2026-01-30 15:09:19] 39 acos(0.200000) = 1.369438 [2026-01-30 15:09:19] 40 acos(0.200000) = 1.369438 [2026-01-30 15:09:19] 41 acos(0.300000) = 1.266104 [2026-01-30 15:09:19] 42 acos(0.400000) = 1.159280 [2026-01-30 15:09:19] 43 acos(0.500000) = 1.047198 [2026-01-30 15:09:19] 44 acos(0.500000) = 1.047198 [2026-01-30 15:09:19] 45 acos(0.600000) = 0.927298 [2026-01-30 15:09:19] 46 acos(0.650000) = 0.863224 [2026-01-30 15:09:19] 47 acos(0.700000) = 0.795445 [2026-01-30 15:09:19] 48 acos(0.705000) = 0.788426 [2026-01-30 15:09:19] 49 acos(0.710000) = 0.781247 [2026-01-30 15:09:19] 50 acos(0.800000) = 0.643498 [2026-01-30 15:09:19] 51 acos(0.900000) = 0.451027 [2026-01-30 15:09:19] 52 acos(0.990000) = 0.141539 [2026-01-30 15:09:19] 53 acos(0.999000) = 0.044725 [2026-01-30 15:09:19] 54 acos(0.999900) = 0.014144 [2026-01-30 15:09:19] 55 acos(0.999990) = 0.004475 [2026-01-30 15:09:19] 56 acos(1.000000) = 0.000000 [2026-01-30 15:09:19] 57 acos(1.010000) = nan [2026-01-30 15:09:19] 58 acos(1.001000) = nan [2026-01-30 15:09:19] 59 acos(1.000100) = nan [2026-01-30 15:09:19] 60 acos(1.000010) = nan [2026-01-30 15:09:19] 61 acos(1.000001) = nan [2026-01-30 15:09:19] 62 acos(12.000000) = nan [2026-01-30 15:09:19] 63 acos(inf) = nan [2026-01-30 15:09:19] run test_aclnn_acos, execute samples success Kernel UT测试结果如下:测试数据形状(32, 8, 7, 7) tmp_input = np.random.choice([1.0, 0.8, 0.7, 0.5, -1, 0.1, 0.0, np.nan, np.inf], size=size)随机选择,精度误差绝对误差和相对误差10的负4次方 diff_res = np.isclose(tmp_out, tmp_gold, rtol=1e-4, atol=1e-4, equal_nan=True) [2026-01-30 15:13:38] Run fast op utest [2026-01-30 15:13:38] [==========] Running 1 test from 1 test suite. [2026-01-30 15:13:38] [----------] Global test environment set-up. [2026-01-30 15:13:38] Global Environment SetpUp. [2026-01-30 15:13:38] [----------] 1 test from AcosTest [2026-01-30 15:13:38] AcosTest SetUp [2026-01-30 15:13:38] [2026-01-30 15:13:38] [ RUN ] AcosTest.test_case_0 [2026-01-30 15:13:38] /home/l00614971/op-math/build/tests/ut/op_kernel/acos_data/gen_data.py:36: RuntimeWarning: invalid value encountered in arccos [2026-01-30 15:13:38] tmp_golden = np.arccos(tmp_input) [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/math/acos/CMakeFiles/ophost_math_tiling_obj.dir/op_host/acos_tiling.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_ascend910B1.dir/test_op_kernel_main.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/math/acos/tests/ut/op_kernel/CMakeFiles/acos_Ascend910B1_cases_obj.dir/test_acos.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_common_obj.dir/__/common/tiling_context_faker.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_common_obj.dir/__/common/tiling_case_executor.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [SUCCESS][CORE_0][pid 1618408] exit success! [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [SUCCESS][CORE_1][pid 1618409] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_2][pid 1618410] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_3][pid 1618411] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_4][pid 1618412] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_5][pid 1618413] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_6][pid 1618414] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_7][pid 1618415] exit success! [2026-01-30 15:13:46] PASSED! [2026-01-30 15:13:46] compare result: True [2026-01-30 15:13:46] [ OK ] AcosTest.test_case_0 (7926 ms) [2026-01-30 15:13:46] AcosTest TearDown [2026-01-30 15:13:46] [2026-01-30 15:13:46] [----------] 1 test from AcosTest (7926 ms total) [2026-01-30 15:13:46] [2026-01-30 15:13:46] [----------] Global test environment tear-down [2026-01-30 15:13:46] Global Environment TearDown [2026-01-30 15:13:46] [==========] 1 test from 1 test suite ran. (7960 ms total) [2026-01-30 15:13:46] [ PASSED ] 1 test. [2026-01-30 15:13:46] [100%] Built target math_op_kernel_ut_ascend910B1 [2026-01-30 15:13:46] [100%] Built target math_op_kernel_ut (ws) [root@shlqh-cann-cluster8-141-61-33-172 op-math]# ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!1033 | 6 个月前 | |
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 | 2 个月前 | |
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 | 2 个月前 | |
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 | 2 个月前 | |
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 | 2 个月前 | |
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 | 2 个月前 | |
Support Acos op with AscendC Co-authored-by: zyf0712<zhangyufei63@huawei.com> # message auto-generated for no-merge-commit merge: !1033 merge master into master Support Acos op with AscendC Created-by: luomin2005 Commit-by: luomin2005;zyf0712 Merged-by: cann-robot Description: ## 描述 使用AscendC实现acos算子 1.按照泰勒公式计算arcsin(x) = Cx + Cx^3 + Cx^5 + Cx^7 + Cx^9 + Cx^11 + Cx^13 + Cx^15 ..... 其中C为泰勒系数,参考常量taylorCoefficients,参考精度要求泰勒系数计算到第8项 T taylorCoefficients[] = {1.0, 1.0 / 6, 3.0 / 40, 5.0 / 112, 35.0 / 1152, 63.0 / 2816, 231.0 / 13312, 143.0 / 10240}; 2.将x取绝对值,并将正负号保存到xSignMask掩码中; 3.当x < Boudry = 0.70710678118654752440084436210485 时计算 arcsin(x), 当x >Boudry计算arcsin(x) = halfPi - 1/2 sqrt(1-x^2) 4.利用arcsin(-x) = -arcsin(x), 根据符号标记合并还原计算负值情况 3.arccos(x) = halfPi - arcsin(x) ## 关联的Issue https://gitcode.com/cann/ops-math/issues/581 ## 测试 [2026-01-30 15:09:13] Start to run examples,name:acos mode:eager [2026-01-30 15:09:13] Start compile and run examples file: ../math/acos/examples/test_aclnn_acos.cpp [2026-01-30 15:09:13] pkg_mode:cust vendor_name:custom [2026-01-30 15:09:19] [Warning]: tiling struct [ReduceOpTilingDataV2] is conflict with one in file kl_div_v2.cc, line 41 [2026-01-30 15:09:19] [Warning]: tiling struct [RepeatInterleaveGradTilingData] is conflict with one in file repeat_interleave_grad_tiling.h, line 21 [2026-01-30 15:09:19] [Warning]: tiling struct [IndexFillTilingData] is conflict with one in file index_fill_tiling.h, line 21 [2026-01-30 15:09:19] [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [2026-01-30 15:09:19] [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [2026-01-30 15:09:19] [Warning]: tiling struct [TopKTopPSampleTilingData] is conflict with one in file top_k_top_p_sample_tiling.h, line 26 [2026-01-30 15:09:19] [Warning]: tiling struct [AvgPool3dGradTilingBlockParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 99 [2026-01-30 15:09:19] [Warning]: tiling struct [AvgPool3dGradTilingParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 125 [2026-01-30 15:09:19] [Warning]: tiling struct [FusedCrossEntropyLossWithMaxSumTilingData] is conflict with one in file fused_cross_entropy_loss_with_max_sum_tiling.h, line 27 [2026-01-30 15:09:19] [Warning]: tiling struct [TilingDataBackgroundReplace] is conflict with one in file background_replace_tiling.h, line 22 [2026-01-30 15:09:19] [Warning]: tiling struct [TilingDataBlendImages] is conflict with one in file blend_images_custom_tiling.h, line 24 [2026-01-30 15:09:19] 0 acos(-inf) = nan [2026-01-30 15:09:19] 1 acos(-12.000000) = nan [2026-01-30 15:09:19] 2 acos(-1.000001) = nan [2026-01-30 15:09:19] 3 acos(-1.000010) = nan [2026-01-30 15:09:19] 4 acos(-1.000100) = nan [2026-01-30 15:09:19] 5 acos(-1.001000) = nan [2026-01-30 15:09:19] 6 acos(-1.010000) = nan [2026-01-30 15:09:19] 7 acos(-1.000000) = 3.141593 [2026-01-30 15:09:19] 8 acos(-0.999990) = 3.137117 [2026-01-30 15:09:19] 9 acos(-0.999900) = 3.127449 [2026-01-30 15:09:19] 10 acos(-0.999000) = 3.096868 [2026-01-30 15:09:19] 11 acos(-0.990000) = 3.000053 [2026-01-30 15:09:19] 12 acos(-0.900000) = 2.690566 [2026-01-30 15:09:19] 13 acos(-0.800000) = 2.498095 [2026-01-30 15:09:19] 14 acos(-0.710000) = 2.360346 [2026-01-30 15:09:19] 15 acos(-0.705000) = 2.353167 [2026-01-30 15:09:19] 16 acos(-0.700000) = 2.346148 [2026-01-30 15:09:19] 17 acos(-0.650000) = 2.278369 [2026-01-30 15:09:19] 18 acos(-0.600000) = 2.214295 [2026-01-30 15:09:19] 19 acos(-0.500000) = 2.094395 [2026-01-30 15:09:19] 20 acos(-0.400000) = 1.982313 [2026-01-30 15:09:19] 21 acos(-0.300000) = 1.875489 [2026-01-30 15:09:19] 22 acos(-0.200000) = 1.772154 [2026-01-30 15:09:19] 23 acos(-0.100000) = 1.670964 [2026-01-30 15:09:19] 24 acos(-0.010000) = 1.580796 [2026-01-30 15:09:19] 25 acos(-0.001000) = 1.571796 [2026-01-30 15:09:19] 26 acos(-0.000100) = 1.570896 [2026-01-30 15:09:19] 27 acos(-0.000010) = 1.570806 [2026-01-30 15:09:19] 28 acos(-0.000001) = 1.570797 [2026-01-30 15:09:19] 29 acos(-0.000000) = 1.570796 [2026-01-30 15:09:19] 30 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 31 acos(nan) = nan [2026-01-30 15:09:19] 32 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 33 acos(0.000000) = 1.570796 [2026-01-30 15:09:19] 34 acos(0.000001) = 1.570795 [2026-01-30 15:09:19] 35 acos(0.000010) = 1.570786 [2026-01-30 15:09:19] 36 acos(0.000100) = 1.570696 [2026-01-30 15:09:19] 37 acos(0.010000) = 1.560796 [2026-01-30 15:09:19] 38 acos(0.100000) = 1.470629 [2026-01-30 15:09:19] 39 acos(0.200000) = 1.369438 [2026-01-30 15:09:19] 40 acos(0.200000) = 1.369438 [2026-01-30 15:09:19] 41 acos(0.300000) = 1.266104 [2026-01-30 15:09:19] 42 acos(0.400000) = 1.159280 [2026-01-30 15:09:19] 43 acos(0.500000) = 1.047198 [2026-01-30 15:09:19] 44 acos(0.500000) = 1.047198 [2026-01-30 15:09:19] 45 acos(0.600000) = 0.927298 [2026-01-30 15:09:19] 46 acos(0.650000) = 0.863224 [2026-01-30 15:09:19] 47 acos(0.700000) = 0.795445 [2026-01-30 15:09:19] 48 acos(0.705000) = 0.788426 [2026-01-30 15:09:19] 49 acos(0.710000) = 0.781247 [2026-01-30 15:09:19] 50 acos(0.800000) = 0.643498 [2026-01-30 15:09:19] 51 acos(0.900000) = 0.451027 [2026-01-30 15:09:19] 52 acos(0.990000) = 0.141539 [2026-01-30 15:09:19] 53 acos(0.999000) = 0.044725 [2026-01-30 15:09:19] 54 acos(0.999900) = 0.014144 [2026-01-30 15:09:19] 55 acos(0.999990) = 0.004475 [2026-01-30 15:09:19] 56 acos(1.000000) = 0.000000 [2026-01-30 15:09:19] 57 acos(1.010000) = nan [2026-01-30 15:09:19] 58 acos(1.001000) = nan [2026-01-30 15:09:19] 59 acos(1.000100) = nan [2026-01-30 15:09:19] 60 acos(1.000010) = nan [2026-01-30 15:09:19] 61 acos(1.000001) = nan [2026-01-30 15:09:19] 62 acos(12.000000) = nan [2026-01-30 15:09:19] 63 acos(inf) = nan [2026-01-30 15:09:19] run test_aclnn_acos, execute samples success Kernel UT测试结果如下:测试数据形状(32, 8, 7, 7) tmp_input = np.random.choice([1.0, 0.8, 0.7, 0.5, -1, 0.1, 0.0, np.nan, np.inf], size=size)随机选择,精度误差绝对误差和相对误差10的负4次方 diff_res = np.isclose(tmp_out, tmp_gold, rtol=1e-4, atol=1e-4, equal_nan=True) [2026-01-30 15:13:38] Run fast op utest [2026-01-30 15:13:38] [==========] Running 1 test from 1 test suite. [2026-01-30 15:13:38] [----------] Global test environment set-up. [2026-01-30 15:13:38] Global Environment SetpUp. [2026-01-30 15:13:38] [----------] 1 test from AcosTest [2026-01-30 15:13:38] AcosTest SetUp [2026-01-30 15:13:38] [2026-01-30 15:13:38] [ RUN ] AcosTest.test_case_0 [2026-01-30 15:13:38] /home/l00614971/op-math/build/tests/ut/op_kernel/acos_data/gen_data.py:36: RuntimeWarning: invalid value encountered in arccos [2026-01-30 15:13:38] tmp_golden = np.arccos(tmp_input) [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/math/acos/CMakeFiles/ophost_math_tiling_obj.dir/op_host/acos_tiling.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_ascend910B1.dir/test_op_kernel_main.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/math/acos/tests/ut/op_kernel/CMakeFiles/acos_Ascend910B1_cases_obj.dir/test_acos.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_common_obj.dir/__/common/tiling_context_faker.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:39] libgcov profiling error:/home/l00614971/op-math/build/tests/ut/op_kernel/CMakeFiles/math_op_kernel_ut_common_obj.dir/__/common/tiling_case_executor.cpp.gcda:overwriting an existing profile data with a different timestamp [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [SUCCESS][CORE_0][pid 1618408] exit success! [2026-01-30 15:13:46] [TmSim]: Run in serial mode. [2026-01-30 15:13:46] [SUCCESS][CORE_1][pid 1618409] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_2][pid 1618410] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_3][pid 1618411] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_4][pid 1618412] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_5][pid 1618413] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_6][pid 1618414] exit success! [2026-01-30 15:13:46] [SUCCESS][CORE_7][pid 1618415] exit success! [2026-01-30 15:13:46] PASSED! [2026-01-30 15:13:46] compare result: True [2026-01-30 15:13:46] [ OK ] AcosTest.test_case_0 (7926 ms) [2026-01-30 15:13:46] AcosTest TearDown [2026-01-30 15:13:46] [2026-01-30 15:13:46] [----------] 1 test from AcosTest (7926 ms total) [2026-01-30 15:13:46] [2026-01-30 15:13:46] [----------] Global test environment tear-down [2026-01-30 15:13:46] Global Environment TearDown [2026-01-30 15:13:46] [==========] 1 test from 1 test suite ran. (7960 ms total) [2026-01-30 15:13:46] [ PASSED ] 1 test. [2026-01-30 15:13:46] [100%] Built target math_op_kernel_ut_ascend910B1 [2026-01-30 15:13:46] [100%] Built target math_op_kernel_ut (ws) [root@shlqh-cann-cluster8-141-61-33-172 op-math]# ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!1033 | 6 个月前 | |
docs目录基本概念md文件名改为英文 Co-authored-by: chenjiao<chenjiao31@huawei.com> # message auto-generated for no-merge-commit merge: !4182 merge master into master docs目录基本概念md文件名改为英文 Created-by: gitcode-chenjiao Commit-by: chenjiao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> docs目录基本概念md文件名改为英文: 避免link中的中文字符引发的跳转异常,例如两段式接口.md变成%E4%B8%A4%E6%AE%B5%E5%BC%8F%E6%8E%A5%E5%8F%A3.md,不易于维护,可能导致其他平台跳转有问题。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#2283](https://gitcode.com/cann/ops-math/issues/2283) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ok ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/zh/context所有md和对应的link ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4182 | 1 个月前 |
Acos
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
功能说明
-
算子功能:对输入的每个元素进行反余弦操作后输出。
-
计算公式:
yi=cos−1(xi)y_{i}=cos^{-1}(x_{i}) yi=cos−1(xi)
参数说明
| 参数名 | 输入/输出/属性 | 描述 | 数据类型 | 数据格式 |
|---|---|---|---|---|
| x | 输入 | 公式中的输入张量x。 | INT8、INT16、INT32、INT64、UINT8、BOOL、FLOAT、BFLOAT16、FLOAT16、DOUBLE | ND |
| y | 输出 | 公式中的输出张量y。 | FLOAT、BFLOAT16、FLOAT16、DOUBLE | ND |
约束说明
- 输入类型为INT8、INT16、INT32、INT64、UINT8、BOOL时,转化为FLOAT32进行运算,输出FLOAT32类型。支持非连续的Tensor,数据格式支持ND,非连续的Tensor维度不大于8,且输入与输出的shape需要一致。
调用说明
| 调用方式 | 调用样例 | 说明 |
|---|---|---|
| aclnn调用 | test_aclnn_acos | 通过aclnnAcos接口方式调用Acos算子。 |
| 图模式调用 | test_geir_acos | 通过算子IR构图方式调用Acos算子。 |