| Files | Last commit | Last update |
|---|---|---|
master翻译合入 Co-authored-by: caiwenwen<caiwenwen6@h-partners.com> # message auto-generated for no-merge-commit merge: !6751 merge master into master master翻译合入 Created-by: caiwenwen Commit-by: caiwenwen Merged-by: cann-robot Description: ## 描述 合入math仓翻译的内容 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4170 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 docs/context,aclnn等商发文档 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6751 | 19 days ago | |
RightShift示例改用C++ RAII资源管理,与IsFinite/IsInf示例风格对齐 Co-authored-by: zhouqilong<zhouqilong2@huawei.com> # message auto-generated for no-merge-commit merge: !4743 merge raii-right_shift into master RightShift示例改用C++ RAII资源管理,与IsFinite/IsInf示例风格对齐 Created-by: zhou-qilong Commit-by: zhouqilong Merged-by: cann-robot Description: ## 描述 将 math/right_shift/examples 下的 aclnn 示例由手动资源管理改为 C++ RAII 管理,与同仓 math/is_finite、math/is_inf 示例风格保持一致。 ## 测试 验证文件:math/right_shift/examples/test_aclnn_right_shift.cpp。 C++11 编译、链接通过。 输入为 [10,20,30,40],右移位数为 [1,2,3,4],期望输出为 [5,5,3,2],实际输出与期望一致。 ## 文档更新 无。 ## 类型标签 - [x] 其他,请描述:示例代码改造(C++ RAII资源管理) See merge request: cann/ops-math!4743 | 16 days ago | |
[LeftShift] 新增 Ascend 950 / arch35 Ascend C 实现 Co-authored-by: gl_princekin<gelei10@huawei.com> # message auto-generated for no-merge-commit merge: !6684 merge master into master [LeftShift] 新增 Ascend 950 / arch35 Ascend C 实现 Created-by: gl_princekin Commit-by: gl_princekin Merged-by: cann-robot Description: ## 描述 LeftShift(按位左移)算子此前仅包含 aclnn 接口(AICPU 实现),缺少 Ascend C 原生实现。本 PR 新增 LeftShift 的 Ascend C 实现,使其在 Ascend 950 及 Atlas A3 系列(arch35 架构)产品上获得原生执行路径。 **主要改动:** - op_kernel/arch35/:新增 Ascend C kernel(DAG 节点 + 数据结构定义) - op_host/arch35/:新增 tiling 代码 - op_host/config/ascend950/、op_host/config/ascend350/:算子配置(JSON + simplified_key.ini) - op_host/:left_shift_def.cpp(算子定义)、left_shift_infershape.cpp(shape 推导) - op_graph/:left_shift_proto.h、left_shift_graph_infer.cpp - op_kernel_aicpu/:AICPU kernel 实现 - op_api/:aclnn 接口参数校验代码更新 - examples/:图模式调用示例 test_geir_left_shift.cpp - tests/:单元测试(op_api / op_host / tiling / infershape / ST) - README.md、docs/:产品支持表、广播说明文档 - common/inc/op_graph/op_math_proto_extend.h:移除 LeftShift 注册(迁移至独立 proto 文件) - math/right_shift/framework/bitshift_onnx_plugin.cpp:修复 proto 头文件引用 ## 关联的Issue - #3978 ## 测试 - op_api 单元测试:test_aclnn_left_shift.cpp、test_aclnn_left_shift_l0.cpp、test_aclnn_left_shifts.cpp - op_host 单元测试:test_left_shift_tiling.cpp(arch35)、test_left_shift_infershape.cpp - op_kernel_aicpu 单元测试:test_left_shift.cpp - ST 测试:tests/st/arch35/ttk_kernel_left_shift_st.csv ## 文档更新 - 更新了 math/left_shift/README.md(产品支持表、功能说明、参数说明、约束说明、调用说明) - 更新了 math/left_shift/docs/aclnnLeftShift.md、aclnnLeftShifts.md(新增广播说明) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6684 | 20 days ago | |
RightShift对标torch Co-authored-by: ligen<ligen75@h-partners.com> # message auto-generated for no-merge-commit merge: !6697 merge master into master RightShift对标torch Created-by: ligen75 Commit-by: ligen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> RigtShift Aclnn通路对标torch ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3991 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 自验通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6697 | 20 days ago | |
RightShift对标torch Co-authored-by: ligen<ligen75@h-partners.com> # message auto-generated for no-merge-commit merge: !6697 merge master into master RightShift对标torch Created-by: ligen75 Commit-by: ligen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> RigtShift Aclnn通路对标torch ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3991 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 自验通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6697 | 20 days ago | |
feat: vector算子批量适配ascend960pr(DV122)平台 Co-authored-by: biabu111<hebaojing1@huawei.com> # message auto-generated for no-merge-commit merge: !6663 merge feat/dv122-ascend960pr-adaptation into master feat: vector算子批量适配ascend960pr(DV122)平台 Created-by: biabu111 Commit-by: biabu111 Merged-by: cann-robot Description: ## 描述 DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)vector 算子批量适配。参照 ascend960dt(DAV_9201) 既有适配模式,为 vector 算子清单内 66 个算子补齐 ascend960pr 支持,适配原则:9201 支持的能力 9202 均支持。 **注册级适配(66 算子):** - CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35 - op_host/*_def.cpp:AICore().AddConfig("ascend960pr", <960dt 同款配置>) - op_host/config/ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,复制自 ascend960dt,与 960dt 内容一致) - op_kernel*/CMakeLists.txt:COMPUTE_UNITS 追加 ascend960pr(arch92 kernel 入口同步生效) - scripts/kernel/binary_config/ascendc_config.json:compute_units 与 compile_options 补齐 **代码级补齐(9201 → 9201||9202):** - tiling/aclnn/infershape/fusion_pass/kernel 中 NpuArch::DAV_9201、__NPU_ARCH__ == 9201、"Ascend960DT" 等 960 平台门禁补齐 DAV_9202 / 9202 / "Ascend960PR" - 覆盖 concat/tanh_grad/slice/strided_slice/expand/tensor_equal/lin_space/range 等的 tiling/aclnn/graph_infer/fusion_pass 平台门禁(家族特性判定依据:gather_v2 适配提交中 isAscend96_ = DAV_9201||DAV_9202、unsorted_segment_sum 注释"ascend960dt/ascend960pr(DAV_9201/DAV_9202) 平台判定,用于 960 专属特性(ScatterDataCopy 等)的运行时开关") ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4682 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 冒烟、ut、st已通过 <!--描述进行了哪些测试来验证你的改动。--> - CANN 9.3.0 工具链 --soc=ascend960pr 构建 19 个抽样算子(覆盖全部修改类型):宿主侧(def/tiling/infershape/aclnn)100% 编译通过,0 错误 - 构建日志确认正确消费新增的 config/ascend960pr/*_binary.json - --soc=ascend960dt 同算子集构建行为一致,无回归 - 一致性审计:范围内 960dt-without-960pr 注册缺口 0;修改过的 CMakeLists SUPPORT_COMPUTE_UNIT/TILING_DIR 位置对齐 0 问题;ascendc_config.json 语法有效 - 注:opc 二进制生成阶段因当前工具链缺 Ascend960PR_969A1 平台数据无法本地执行,需在 CI(含 960PR 平台数据的工具链)完成二进制编译与上板验证 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-math!6663 | 5 days ago | |
RightShift对标torch Co-authored-by: ligen<ligen75@h-partners.com> # message auto-generated for no-merge-commit merge: !6697 merge master into master RightShift对标torch Created-by: ligen75 Commit-by: ligen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> RigtShift Aclnn通路对标torch ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3991 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 自验通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6697 | 20 days ago | |
fix(aicpu): resolve code quality warnings Co-authored-by: pan-tong<pantong@huawei.com> # message auto-generated for no-merge-commit merge: !5876 merge fix/warning-handling into master fix(aicpu): resolve code quality warnings Created-by: pan-tong Commit-by: pan-tong Merged-by: cann-robot Description: ## 描述 修复 RightShift、SearchSorted、SelectV2、SquaredDifference 和 Tile AICPU 代码规范告警: - 为无状态成员函数补充 const,为重写析构函数补充 override。 - 补充显式类型转换,使用强类型枚举并显式传递宏依赖参数。 - 移除未使用头文件,不改变算子计算逻辑。 ## 关联的Issue 无 ## 测试 - bash build.sh -u --opkernel_aicpu --ops=right_shift,search_sorted,select_v2,squared_difference,tile - 91/91 PASSED ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:代码规范告警整改 See merge request: cann/ops-math!5876 | 1 month ago | |
test: 同步 Math BRC 零 workspace 的 Host UT 期望值 Co-authored-by: zhang-song-rui<zhangsongrui@h-partners.com> # message auto-generated for no-merge-commit merge: !6242 merge fix/ascend950-vector-workspace into master test: 同步 Math BRC 零 workspace 的 Host UT 期望值 Created-by: zhang-song-rui Commit-by: zhang-song-rui Merged-by: cann-robot Description: ## 修改内容 仅同步公共 BroadcastBaseTiling(BRC)workspace 清零所影响的 Host UT:把成功 BRC 用例的 workspace 期望由 16777216(16 MiB)改为 0。 共修改 38 个已有 UT 文件,228 行增加、228 行删除,全部为上述 workspace 字面值替换。无生产代码、kernel、CMake、公共 UT 框架、依赖版本或失败用例修改;分支保持一次提交。 ## Major 意见核对与处理 opbase #1007 在 BroadcastBaseTiling::DoTiling 公共成功出口写入 DEFAULT_TILING_WORKSPACE_SIZE=0,默认 kernel type 同样受影响,并非可排除条件。结合本地 opbase 与当前 ops-math 源码,逐项处理如下: | 算子 | 本 PR 处理 | 保留原期望的依据 | | --- | --- | --- | | AddV2 | 生产文件及 UT 均保持主线原样 | BRC 返回后 SetWorkspace 显式按 CompileInfo/平台信息重新申请 workspace,最终结果仍为 16 MiB;不能仅改 UT 为 0。 | | LeftShift | 8 个成功用例改为 0 | 另 1 个失败用例的占位期望不参与 workspace 检查,保持原样。 | | RightShift | 10 个成功用例改为 0 | 另 2 个失败用例同上,保持原样。 | | MaximumGrad | 7 个成功 BRC 用例改为 0 | 另 4 个空张量用例走 HandleEmptyTensor 独立分支,仍显式申请系统 workspace,保留 16 MiB。 | | MinimumGrad | 7 个成功 BRC 用例改为 0 | 同上,另 4 个空张量独立分支保留 16 MiB。 | | MaskedFill | 7 个成功 BRC 用例改为 0 | 无遗漏。 | | TruncateDiv | 6 个成功 BRC 用例改为 0 | 原有两个 0 是失败用例,不是非 BRC 成功路径;保持原样。 | 全仓扫描发现的另外三组遗漏也已补齐:FusedMulAdd(10 处)、FusedMulAddAdd(10 处)、MulNoNan(11 处)。上述新增补齐共 9 个文件、76 处。其余原有 UT 中仅属于失败用例的 8 处占位值修改也已撤回,避免无关修改。 ## 本地验证(2026-11-05) 最终提交: ae55efaba。 环境:aarch64、GNU 9.4.0、CANN 9.2.0(用户目录安装)、目标 ascend950。使用仓库默认固定 opbase 8e8cf1b60b28bc1f8aaa1652fe054ac7e35d5852,未叠加本地 opbase 补丁。 - 最终 UT-only 版本已重新编译、最终链接并运行 math_op_host_ut:**548/548 测试通过,78 个测试套件,构建退出码 0**。范围包括全部 38 个变更算子,以及保持原样的 AddV2,共 39 个算子;保留 16 MiB 的 AddV2/梯度空张量用例也实际通过。 - 逐字节检查全部 38 个变更文件,仅存在 {16777216} → {0} 的替换;失败用例无差异,AddV2 无差异。 - 按原有 CRLF 换行格式执行差异空白检查,通过。 - 扫描仓库 50 个直接 BRC Host 消费算子,核对剩余 16 MiB 用例及上述独立分支。 最终复测日志:/tmp/pr6242-ut-only-final.log。日志含复用构建目录产生的 gcov profile 时间戳提示;测试和构建均成功,本次不提供覆盖率结论。Host UT 不替代设备 kernel 精度、性能或越界验证;本轮未执行设备测试。 ## 关联 PR - [opbase #1007](https://gitcode.com/cann/opbase/pull/1007):已合入的公共 BRC workspace 清理。 - [ops-math #6711](https://gitcode.com/cann/ops-math/pull/6711):已合入独立实现路径清理及其 4 个 UT 文件。已同步包含该修改的主线,上述 10 个文件不在本 PR 差异中。 See merge request: cann/ops-math!6242 | 11 days ago | |
feat: vector算子批量适配ascend960pr(DV122)平台 Co-authored-by: biabu111<hebaojing1@huawei.com> # message auto-generated for no-merge-commit merge: !6663 merge feat/dv122-ascend960pr-adaptation into master feat: vector算子批量适配ascend960pr(DV122)平台 Created-by: biabu111 Commit-by: biabu111 Merged-by: cann-robot Description: ## 描述 DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)vector 算子批量适配。参照 ascend960dt(DAV_9201) 既有适配模式,为 vector 算子清单内 66 个算子补齐 ascend960pr 支持,适配原则:9201 支持的能力 9202 均支持。 **注册级适配(66 算子):** - CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35 - op_host/*_def.cpp:AICore().AddConfig("ascend960pr", <960dt 同款配置>) - op_host/config/ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,复制自 ascend960dt,与 960dt 内容一致) - op_kernel*/CMakeLists.txt:COMPUTE_UNITS 追加 ascend960pr(arch92 kernel 入口同步生效) - scripts/kernel/binary_config/ascendc_config.json:compute_units 与 compile_options 补齐 **代码级补齐(9201 → 9201||9202):** - tiling/aclnn/infershape/fusion_pass/kernel 中 NpuArch::DAV_9201、__NPU_ARCH__ == 9201、"Ascend960DT" 等 960 平台门禁补齐 DAV_9202 / 9202 / "Ascend960PR" - 覆盖 concat/tanh_grad/slice/strided_slice/expand/tensor_equal/lin_space/range 等的 tiling/aclnn/graph_infer/fusion_pass 平台门禁(家族特性判定依据:gather_v2 适配提交中 isAscend96_ = DAV_9201||DAV_9202、unsorted_segment_sum 注释"ascend960dt/ascend960pr(DAV_9201/DAV_9202) 平台判定,用于 960 专属特性(ScatterDataCopy 等)的运行时开关") ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4682 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 冒烟、ut、st已通过 <!--描述进行了哪些测试来验证你的改动。--> - CANN 9.3.0 工具链 --soc=ascend960pr 构建 19 个抽样算子(覆盖全部修改类型):宿主侧(def/tiling/infershape/aclnn)100% 编译通过,0 错误 - 构建日志确认正确消费新增的 config/ascend960pr/*_binary.json - --soc=ascend960dt 同算子集构建行为一致,无回归 - 一致性审计:范围内 960dt-without-960pr 注册缺口 0;修改过的 CMakeLists SUPPORT_COMPUTE_UNIT/TILING_DIR 位置对齐 0 问题;ascendc_config.json 语法有效 - 注:opc 二进制生成阶段因当前工具链缺 Ascend960PR_969A1 平台数据无法本地执行,需在 CI(含 960PR 平台数据的工具链)完成二进制编译与上板验证 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-math!6663 | 5 days ago | |
RightShift对标torch Co-authored-by: ligen<ligen75@h-partners.com> # message auto-generated for no-merge-commit merge: !6697 merge master into master RightShift对标torch Created-by: ligen75 Commit-by: ligen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> RigtShift Aclnn通路对标torch ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3991 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 自验通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6697 | 20 days 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 | 11 days ago |
RightShift
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 bitwise right shift of the input tensors x and y element-wise.
-
Computation formula:
zi=xi>>yiz_i = x_i >> y_i zi=xi>>yi
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | The input x is a k-dimensional tensor. It is the input parameter for the right_shift computation, which is x_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| y | Input | Input parameter for the right_shift computation, which is y_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| negMode | Attribute | An optional integer attribute. The value is 0 or 1, and the default value is 0. If the value is 0 and y is negative, the computation is performed as a shift of 0 bits. If the value is 1 and y is negative, the computation is performed as a shift of the maximum number of bits. | INT | - |
| z | Output | Output parameter for the right_shift computation, which is z_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
Constraint Description
None
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_rightshift | Invokes the rightshift operator through the aclnnRightshift API. |
| Graph-mode invocation | test_geir_right_shift | Invokes the RightShift operator by building a graph through the operator IR. |