| Files | Last commit | Last update |
|---|---|---|
docs: 修正文档并补充 CdistGrad、Lerp、Pow2 Host UT Co-authored-by: chensi79<chensi79@huawei.com> # message auto-generated for no-merge-commit merge: !7248 merge docs/issue-4535-rowspan-20261109-issue4535 into master docs: 修正文档并补充 CdistGrad、Lerp、Pow2 Host UT Created-by: chensi79 Commit-by: chensi79 Merged-by: cann-robot Description: ## 描述 错误码表中的 rowspan 大于对应错误码实际占用的表格行数,导致表格结构不匹配。按现有 tr 结构修正 44 个文档中的 46 处错误码分组、92 个单元格跨度,保留现有报错描述及列表内容。 同时修复 Lerps 标量接口的维度约束披露缺口:同步更新正式目录中英文及 experimental 中文文档,分别说明普通和原地接口的连续性条件与非连续路径 8 维上限,补充对应 161002 场景,并保持表格跨度与新增描述行一致。全部连续时仅说明第一段接口跳过此项上限检查,不承诺任意维度均可执行。 精简中英文广播规则3:说明广播轴不明确或对齐后维度不兼容时的报错条件,补充 (2,2,2) 与 (2,2) 的轴选择及 (2,3) 的不兼容示例。规则1、2及其余内容保持原文。 为 experimental/math/cdist_grad、lerp、pow2 补充 Host 形状推导 UT,共22个用例,覆盖正常及批量形状、空张量、动态维度、广播、维度不兼容和缺失输入。仅新增3个测试源文件,通过现有 CMake 自动收集,不修改门禁脚本或算子实现。 ## 关联的Issue Closes #4535 Closes #4580 Closes #3986 ## 测试 - 使用独立 HTMLParser 检查所改 44 个文档的 98 个错误码分组:修改前 92 个单元格跨度不符,修改后为 0。 - 按字节比较确认仅 rowspan 数值发生变化,保留原有换行及所有描述内容。 - git -c core.whitespace=cr-at-eol diff --check 通过(保留三个原有 CRLF 文档的换行格式)。 - 对照正式及 experimental 的 CheckShape、MAX_SUPPORT_DIMS_NUMS=8 和原地接口复用 CalculateResult(selfRef, end, weight, selfRef) 的调用,核对维度条件和 161002 返回路径。 - Lerps 三份资料共 12 个错误码分组通过 HTML 表格检查;函数原型和示例代码保持不变。此前 #4535 的 44 份资料保持不变。 - pre-commit 检查命令通过;OAT 钩子对含 & 的路径跳过扫描,不将其视为 Markdown 内容扫描覆盖。 - 原有文档内容不变,未运行设备 Kernel 数值测试。 - 新增22项 Host InferShape UT,使用真实算子推导源码、仓库 context helper/GTest 入口及 CANN 9.3.0 库定向编译运行,22/22通过;标准 CMake 的 math_op_infershape_ut_cases 目标编译通过,Check_Example 不再报告缺 UT。 - 完整 Host UT 构建在公共 opbase 依赖处因 DAV_5162/CANN 头文件版本不匹配中断;上述22项定向测试不依赖该 tiling 公共模块,不将定向通过描述为完整 Host 构建通过。 - 逐字核对确认广播文档仅规则3及其例子与修改前不同,规则1、2和其他内容一致;中英文两份文档通过 pre-commit(含 OAT)及 diff --check。 ## 文档更新 覆盖正式目录中英文及 experimental 文档;修正表格跨行布局,不将跨度差解释为 API 报错场景缺失。另补充 aclnnLerps/aclnnInplaceLerps 条件化维度约束及相应错误码说明,保留标量 weight、类型与广播约束。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他 See merge request: cann/ops-math!7248 | 7 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 | |
feat: 添加LeftShift算子TensorFlow框架插件 Co-authored-by: songkai16<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !3957 merge master into master feat: 添加LeftShift算子TensorFlow框架插件 Created-by: songkai111 Commit-by: songkai16 Merged-by: cann-robot Description: ## 描述 将 LeftShift 算子的 TensorFlow 插件迁移到 ops-math 仓库。新增 math/left_shift/framework/left_shift_tf_plugin.cpp 文件,通过 REGISTER_CUSTOM_OP 宏注册 LeftShift 算子的 TensorFlow 框架适配插件。 该插件主要完成以下配置: - **框架类型**:TensorFlow(FrameworkType(TENSORFLOW)) - **原始算子类型**:LeftShift(OriginOpType("LeftShift")) - **参数解析方式**:自动映射(ParseParamsByOperatorFn(AutoMappingByOpFn)) - **执行类型**:AI_CPU(ImplyType(ImplyType::AI_CPU)) ## 关联的Issue - #2202 ## 测试 待补充:二级冒烟测试、算子泛化测试等。 ## 文档更新 无需文档更新。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3957 | 4 months ago | |
fix(left_shift): 修复只读参数const规范问题 Co-authored-by: xiafengkou<luojiangtao4@huawei.com> # message auto-generated for no-merge-commit merge: !6768 merge fix/left-shift-codecheck into master fix(left_shift): 修复只读参数const规范问题 Created-by: xiafengkou Commit-by: xiafengkou Merged-by: cann-robot Description: ## 描述 修复 left_shift 算子 op_api 代码中的两条 G.CNS.04-CPP 只读参数规范问题。 将 CheckPromoteType 和 CheckPromoteTypeScalar 函数中仅用于读取数据类型的 out 参数由 aclTensor* 修改为 const aclTensor*,明确参数的只读语义。本次仅增加 const 限定,不涉及计算逻辑、数据处理流程及接口功能变更。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4171 ## 测试 1. 执行 pre-commit 检查,全部通过。 2. 编译 ophost_math_opapi_obj 目标,编译通过。 3. 构建 math_op_api_ut 测试目标,构建通过。 4. 执行 left_shift、left_shifts 相关 op_api UT,共 56 个用例,全部通过。 5. 执行 git diff --check,检查通过。 ## 文档更新 无,本次修改不涉及文档更新。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6768 | 19 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 | |
[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 | |
[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 | |
[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 | |
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 | 12 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 | |
[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 | |
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 | 12 days ago |
LeftShift
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: performs the bitwise left shift operation on 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 and is the input parameter for the left_shift computation, which is x_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| y | Input | Input parameter for the left_shift computation, which is y_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| z | Output | Output parameter for the left_shift computation, which is z_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
Constraint Description
If shiftBits is negative or is not less than the bit width of the x data type, the output is 0, which is consistent with torch.bitwise_left_shift of PyTorch.
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_left_shift | Invokes the left_shift operator through the aclnnLeftShift API. |
| aclnn invocation | test_aclnn_left_shifts | Invokes the left_shift operator through the aclnnLeftShifts API (shiftBits is a scalar). |
| Graph-mode invocation | test_geir_left_shift | Invokes the LeftShift operator by building a graph through the operator IR. |