本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。
| Files | Last commit | Last update |
|---|---|---|
fix(ci): A5 冒烟镜像改用 image-conf 的 PreSmoke_A5 输出 Co-authored-by: he_kan<hekan4@huawei.com> # message auto-generated for no-merge-commit merge: !14630 merge feat/sync-master-20261116 into master fix(ci): A5 冒烟镜像改用 image-conf 的 PreSmoke_A5 输出 Created-by: he_kan Commit-by: he_kan Merged-by: cann-robot Description: ## 描述 A5 冒烟任务此前在 st_test_action.yml 中硬编码镜像 tag ubuntu24.04_x86:pre_mindspore_A5_conda_v1.1001,镜像升级需要修改工作流。本 PR 改为使用 revise-img action 依据 image-conf/master/images.yaml 解析出的 PreSmoke_A5 输出(当前配置为 ubuntu24.04_x86:pre_mindspore_A5_conda_v1.1007),与 ops-math 仓已适配的写法保持一致。后续 A5 镜像 tag 由 CI 镜像配置统一管理,无需再改工作流。 ## 关联的Issue 不涉及 ## 测试 CI 镜像配置侧已包含 ops-nn 的 PreSmoke_A5 输出。合入后需观察 PreSmoke_A5 job 的容器镜像是否为 swr.cn-north-4.myhuaweicloud.com/pre_smoke/ubuntu24.04_x86:pre_mindspore_A5_conda_v1.1007。 ## 文档更新 不涉及 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:CI 镜像配置适配 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14630 | 4 days ago | |
fix(activation): softmax_grad_ext等3算子错误码上报整改并补充UT Co-authored-by: qq_41311449<baihao29@huawei.com> # message auto-generated for no-merge-commit merge: !15044 merge activation into master fix(activation): softmax_grad_ext等3算子错误码上报整改并补充UT Created-by: qq_41311449 Commit-by: qq_41311449 Merged-by: cann-robot Description: ## 描述 - softmax_grad_ext:5 处 - 多路 dtype 一致性 → EZ0021 - dtype 白名单 → EZ0020 - rank > 6 → EZ0012 - 多 Tensor shape 不一致 → EZ0010 - axes 越界 → EZ0026 - 保留:L131 rank==0(EnsureNotScalar 后不可达) - hard_shrink:1 处 - dtype 白名单 → EZ0020 - relu6:2 处 - 输入输出元素数不一致 → EZ0016 - dtype 白名单 → EZ0020 - 保留:memset、typeSize、ubFactor 三处内部/派生失败 - threshold_grad_v2_d:复核后判定为非问题,已全部回退,无改动。 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/9120 ## 测试 - 新增/扩展负向用例,断言 EZ0021/EZ0020/EZ0012/EZ0010/EZ0026/EZ0016。 - tiling 48/48、全部 70/70 通过;clang-format 通过。 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!15044 | 1 day ago | |
fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !14940 merge pr-pypto-arch into master fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: ### 关联的Issue Fixes #9467 ### 业务背景 add_example_pypto 代码评审问题整改:README 中英文缺少独立「运行验证」章节;「芯片与 arch」章节描述的 PYPTO_JIT_ARCH(a2/a3/a5)机制与 pypto-pro 实际行为不符。 ### 目的 1. 修复 PyPTO codegen arch 导出机制:pypto-pro 仅读取 PYPTOPRO_JIT_ARCH 且只支持 dav-3510(canonical token 为 3510)。原实现导出 PYPTO_JIT_ARCH=a3/a5 为无效 no-op:该变量不被 pypto-pro 消费,a5 为废弃别名(DeprecationWarning 后解析为 3510),a3 在 pypto-pro 中非法(normalize_arch 直接报错)。对齐 ops-math:_ARCH_MAP 改为 ascend950 -> 3510,cmake 导出改名。 2. README 中英文补充独立「运行验证 / Running and Verification」章节(参考 fused_matmul_silu 目录)。 ### 方案 - scripts/util/pypto_codegen.py:_ARCH_MAP 改为 {"ascend950": "3510"},环境变量改设 PYPTOPRO_JIT_ARCH - cmake/func.cmake:pypto_jit_arch_env 导出 PYPTOPRO_JIT_ARCH,注释同步 - cmake/gen_ops_info.cmake:注释 defaults to a5 更正为 defaults to 3510 - examples/add_example_pypto/README.md、README_en.md:重写「芯片与 arch」章节;新增「运行验证」章节 ### 验证 - ascend950 编译打包通过(build_out/cann-ops-nn-custom_linux-x86_64.run) - 构建规则实际导出 export PYPTOPRO_JIT_ARCH=3510(修复前为无人读取的 PYPTO_JIT_ARCH=a5) - ruff、clang-format 18.1.8、git diff --check、pre-commit 门禁(OAT 合规等)全部通过 See merge request: cann/ops-nn!14940 | 2 days ago | |
einsum infershape2.0 Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14984 merge kernel into master einsum inferdtype2.0 Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 本次变更围绕 Einsum 算子的 v2.0 图模式能力建设:将 Einsum 原型从 common/inc/op_graph/op_nn_proto_extend.h 中移出,改为在 matmul/einsum/op_graph/einsum_proto.h 中通过 OPS_PROTO_DEF_EINSUM 独立注册,并新增算子信息库定义、InferShape 与 InferDataType 实现,同时补充 GE IR 示例和 InferDataType 单元测试。核心是使 Einsum 的方程(equation)解析、省略号广播、未知维传播以及输出 dtype 跟随输入 x0 的能力在新框架下可用。 主要改动 Einsum 原型迁移与独立注册:删除 op_nn_proto_extend.h 中的 REG_OP(Einsum) 定义,改为在新文件 einsum_proto.h 中以 OPS_PROTO_DEF_EINSUM 宏保护重新注册,输入 x 为动态输入、输出 y 保持 float16/float32/int32 类型集合及 equation、N 两个必选属性。 新增算子信息库定义 einsum_def.cpp:通过 OpDef 声明 x 为 DYNAMIC、y 为 REQUIRED,统一 ND 格式与 UnknownShapeFormat,注册 ascend310p、ascend910b、ascend910_93、ascend950 的 AICore 配置并开启 DynamicShapeSupportFlag(true)。 新增 einsum_infershape.cpp 实现 v2.0 形状推导:以 InferShapeForEinsum 完成方程校验(-> 分隔、空项、重复标签、... 数量、N 与输入项数一致)、标签维度映射(InsertLabelToMap 支持 -1 未知维相容)、省略号维广播(GetEllipsisRes 取最大维)以及输出形状拼接(OutputWithEllipsis/OutputWithoutEllipsis),输入数量限制在 [1, 2]。 新增 einsum_graph_infer.cpp 的 dtype 推导:InferDataTypeEinsum 将输出 y 的 dtype 设为与首个输入 x 一致,并对空 context 返回 GRAPH_FAILED,通过 IMPL_OP(Einsum).InferDataType(...) 注册。 新增 GE IR 示例与单元测试:test_geir_einsum.cpp 以 abc,cd->abd、fp16 动态输入构建图并校验输出为 128.0,验证图模式经分解后的执行链路;test_einsum_graph_infer_pass.cpp 覆盖 fp32/fp16/int32、双输入跟随首个输入及空 context 共 5 个 InferDataTypeEinsum 用例。 ## 关联的Issue [#7634](https://gitcode.com/cann/ops-nn/issues/7634) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!14984 | 1 day ago | |
refactor(assert_async): AssertAsync 算子注册与构建配置按 NpuArch 整改 Co-authored-by: ASCEND222<dongfei16@h-partners.com> # message auto-generated for no-merge-commit merge: !15121 merge master into master refactor(assert_async): AssertAsync 算子注册与构建配置按 NpuArch 整改 Created-by: ASCEND222 Commit-by: ASCEND222 Merged-by: cann-robot Description: ## 描述 将 AssertAsync 算子的注册与构建配置从 SoC 维度迁移到 NpuArch 维度: - control/assert_async/op_host/assert_async_def.cpp:新增 op_common/op_host/util/op_arch_helper.h,将 AICore().AddConfig("ascend950"/"ascend350"/"ascend960dt"/"ascend960pr", cfg) 改为 opbase::ArchConfigHelper::AddConfigByArch(..., Ops::Base::DAV_3510 / DAV_9201 / DAV_9202, cfg)。ascend950/ascend350 同属 DAV_3510,合并为一条注册,350 平台随 950 共用同一份配置。 - control/assert_async/CMakeLists.txt:COMPUTE_UNIT 由 ascend950 ascend350 ascend960dt ascend960pr 折叠为 dav_3510 dav_9201 dav_9202,TILING_DIR 同步为 3 项。 - control/assert_async/op_kernel/CMakeLists.txt:add_kernel_sources 的 COMPUTE_UNITS 同步为 dav_3510 dav_9201 dav_9202。 注册与编译语义等价,无接口、功能与精度变化。 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/9450 ## 测试 - bash build.sh --pkg --soc=ascend950 --ops=assert_async -j16 构建通过,成功生成 cann-ops-nn-custom_linux-aarch64.run。 - pre-commit 钩子(clang-format、codespell、OAT 合规检查等)全部通过。 - 未进行上板 ST 验证。 ## 文档更新 无 ## 类型标签 - [x] 其他,请描述:重构(注册面与构建配置统一为 NpuArch) ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!15121 | 2 days ago | |
fix(conv3d_v2):BBmode kL0 决策改用 Gcd 保证整除 K 边界,修复尾块 L0 迭代回绕导致的精度问题 Co-authored-by: gcw_kjYrp3js<yaocan1@huawei.com> # message auto-generated for no-merge-commit merge: !14731 merge fix_precision_fail into master fix(conv3d_v2):BBmode kL0 决策改用 Gcd 保证整除 K 边界,修复尾块 L0 迭代回绕导致的精度问题 Created-by: gcw_kjYrp3js Commit-by: gcw_kjYrp3js Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ‘conv3dv2’当 K 方向的 k0-block 总数不能被 ‘kL0 / k0’整除时,kernel 计算最后一个 L0 迭代的权重时会回绕到 L1 权重首块,导致精度失败 1. 精度修复:BB 模式 GetKL0 候选基数由 min(kAL1,kBL1)/k0 改为 Gcd(kAL1,kBL1)/k0, 保证 kL0 同时整除 kAL1/kBL1,修复 L0 迭代回绕导致的精度失败 2. 合并 Gcd:删除 conv_ops_tiling::Gcd(uint32,uint32) 重复实现,统一到 conv_tiling::Gcd, 补 a==0 边界防除零,UT 同步迁移 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/9166 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> 修复后算子精度通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14731 | 1 day ago | |
feat(optim): ApplyAdagrad的GEIR原型并经DecomposePass改写至InplaceApplyAdagrad执行 Co-authored-by: tianyu52<tianyu52@huawei.com> # message auto-generated for no-merge-commit merge: !14835 merge master into master feat(optim): ApplyAdagrad的GEIR原型并经DecomposePass改写至InplaceApplyAdagrad执行 Created-by: tianyu52 Commit-by: tianyu52 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ApplyAdagrad算子从950开始已被InplaceApplyAdagrad收编,后续逐步弃用,牵引使用InplaceApplyAdagrad原型,但当前已存在ApplyAdagrad原型,考虑到兼容性问题, A5上需要支持ApplyAdagradGEIR通路,图中的 ApplyAdagrad 节点由本仓 ApplyAdagradToInplaceFusionPass 在图编译期改写为 InplaceApplyAdagrad 执行:输入与属性原样透传,输出var映射回本算子,accum原地更新。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 <!--描述进行了哪些测试来验证你的改动。--> Ut/ST GEIR通路 PASS ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!14835 | 2 days ago | |
fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !14940 merge pr-pypto-arch into master fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: ### 关联的Issue Fixes #9467 ### 业务背景 add_example_pypto 代码评审问题整改:README 中英文缺少独立「运行验证」章节;「芯片与 arch」章节描述的 PYPTO_JIT_ARCH(a2/a3/a5)机制与 pypto-pro 实际行为不符。 ### 目的 1. 修复 PyPTO codegen arch 导出机制:pypto-pro 仅读取 PYPTOPRO_JIT_ARCH 且只支持 dav-3510(canonical token 为 3510)。原实现导出 PYPTO_JIT_ARCH=a3/a5 为无效 no-op:该变量不被 pypto-pro 消费,a5 为废弃别名(DeprecationWarning 后解析为 3510),a3 在 pypto-pro 中非法(normalize_arch 直接报错)。对齐 ops-math:_ARCH_MAP 改为 ascend950 -> 3510,cmake 导出改名。 2. README 中英文补充独立「运行验证 / Running and Verification」章节(参考 fused_matmul_silu 目录)。 ### 方案 - scripts/util/pypto_codegen.py:_ARCH_MAP 改为 {"ascend950": "3510"},环境变量改设 PYPTOPRO_JIT_ARCH - cmake/func.cmake:pypto_jit_arch_env 导出 PYPTOPRO_JIT_ARCH,注释同步 - cmake/gen_ops_info.cmake:注释 defaults to a5 更正为 defaults to 3510 - examples/add_example_pypto/README.md、README_en.md:重写「芯片与 arch」章节;新增「运行验证」章节 ### 验证 - ascend950 编译打包通过(build_out/cann-ops-nn-custom_linux-x86_64.run) - 构建规则实际导出 export PYPTOPRO_JIT_ARCH=3510(修复前为无人读取的 PYPTO_JIT_ARCH=a5) - ruff、clang-format 18.1.8、git diff --check、pre-commit 门禁(OAT 合规等)全部通过 See merge request: cann/ops-nn!14940 | 2 days ago | |
修改错误码表 rowspan 声明行数 Co-authored-by: y60124828<yanglou1@h-partners.com> # message auto-generated for no-merge-commit merge: !14982 merge master into master 修改错误码表 rowspan 声明行数 Created-by: yanglu-1 Commit-by: y60124828 Merged-by: cann-robot Description: ## 描述 修改错误码表 rowspan 声明行数 ## 关联的Issue 关联Issue [#8190](https://gitcode.com/cann/ops-nn/issues/8190) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14982 | 2 days ago | |
fix(error_code): 整改9个算子143个参数校验检查点错误码 Co-authored-by: wychencc_<wangyuchen53@huawei.com> # message auto-generated for no-merge-commit merge: !14804 merge errorCode into master fix(error_code): 整改9个算子143个参数校验检查点错误码 Created-by: wychencc_ Commit-by: wychencc_ Merged-by: cann-robot Description: ## 描述 按 CANN 错误码规范与 issue #9113 附件,对最终修改范围内的 9 个算子、143 个参数校验检查点进行整改,消除 EZ9999 / E*9*** 参数校验首报: - 根因层使用 OP_LOGE_FOR_* 语义宏,消息包含稳定参数名、实际值与期望值/原因; - 拆分 dim 数/取值、多参数关系等复合校验,一个检查只表达一个根因; - 外层聚合日志(InputParams is invalid.、infer shape check params failed. 等)改为 OP_LOGE_WITHOUT_REPORT,保证同一根因只正式首报一次; - 平台/UB tiling 失败(core num、ubSize、blockSize、vectorLength 等)使用 REPORT_PREDEFINED_ERR_MSG("EZ1008", {opName, reason}); - 公开返回值(aclnnStatus / graphStatus / errno)保持不变。 涉及算子与检查点数:embedding_hash_table_apply_adam_w(10)、embedding_hash_table_import(5)、foreach_non_finite_check_and_unscale(4)、group_norm(11)、group_norm_silu(13)、init_embedding_hash_table(1)、sparse_tensor_dense_mat_mul(9)、swiglu_group(17)、swiglu_group_quant(73),共 143 个检查点、15 个文件。其中 OP_CHECK_NULL_WITH_CONTEXT / 可选参数校验按 EZ0037 语义落地。 与 Excel 初选(AC 列)的差异: - 3 处外层聚合日志(group_norm / group_norm_silu 的 InputParams is invalid.,embedding_hash_table_apply_adam_w 的 infer shape check params failed.)按 PR #16138 与规范“首错唯一”改为 OP_LOGE_WITHOUT_REPORT,不重复上报(Excel 初选分别为 EZ0026/EZ0015); - EZ0108 未在目标版本注册,改用已注册的 EZ1009(Execution_Error:当前 SoC/kernel/组合不支持)上报 swiglu_group_quant 的 3 处 route 校验;Arglist 为 {opName, reason},参数名并入 reason; - 平台/tiling 失败按 EZ1008 上报,未机械套用 EZ0026; - rank/dim 类检查统一 EZ0012,单参数 dtype 统一 EZ0020,与 G2 选码规则一致。 ## 关联的Issue 关联 issue #9113 ## 测试 本地为 Windows 环境,无 CANN toolkit,未执行 build.sh --ophost 编译与 UT;已完成静态自查: - 本次改动文件括号/注释/字符串平衡检查通过; - 全部 OP_LOGE_FOR_* 调用参数个数与仓库既有用法一致; - git diff --check 通过; - 范围内文件不再出现 OP_LOGE / EZ9999 参数校验首报(foreach op_api 的“当前平台不支持”分支除外)。 请 CI 执行编译与 UT 验证。 ## 文档更新 未更新文档。各算子 docs/*.md 中的错误码表为 aclnn 返回码(161001/161002),本次仅改变 host 侧上报的语义化错误码,公开返回码与失败场景描述未变化。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14804 | 2 days ago | |
fix(error_code): 整改9个算子143个参数校验检查点错误码 Co-authored-by: wychencc_<wangyuchen53@huawei.com> # message auto-generated for no-merge-commit merge: !14804 merge errorCode into master fix(error_code): 整改9个算子143个参数校验检查点错误码 Created-by: wychencc_ Commit-by: wychencc_ Merged-by: cann-robot Description: ## 描述 按 CANN 错误码规范与 issue #9113 附件,对最终修改范围内的 9 个算子、143 个参数校验检查点进行整改,消除 EZ9999 / E*9*** 参数校验首报: - 根因层使用 OP_LOGE_FOR_* 语义宏,消息包含稳定参数名、实际值与期望值/原因; - 拆分 dim 数/取值、多参数关系等复合校验,一个检查只表达一个根因; - 外层聚合日志(InputParams is invalid.、infer shape check params failed. 等)改为 OP_LOGE_WITHOUT_REPORT,保证同一根因只正式首报一次; - 平台/UB tiling 失败(core num、ubSize、blockSize、vectorLength 等)使用 REPORT_PREDEFINED_ERR_MSG("EZ1008", {opName, reason}); - 公开返回值(aclnnStatus / graphStatus / errno)保持不变。 涉及算子与检查点数:embedding_hash_table_apply_adam_w(10)、embedding_hash_table_import(5)、foreach_non_finite_check_and_unscale(4)、group_norm(11)、group_norm_silu(13)、init_embedding_hash_table(1)、sparse_tensor_dense_mat_mul(9)、swiglu_group(17)、swiglu_group_quant(73),共 143 个检查点、15 个文件。其中 OP_CHECK_NULL_WITH_CONTEXT / 可选参数校验按 EZ0037 语义落地。 与 Excel 初选(AC 列)的差异: - 3 处外层聚合日志(group_norm / group_norm_silu 的 InputParams is invalid.,embedding_hash_table_apply_adam_w 的 infer shape check params failed.)按 PR #16138 与规范“首错唯一”改为 OP_LOGE_WITHOUT_REPORT,不重复上报(Excel 初选分别为 EZ0026/EZ0015); - EZ0108 未在目标版本注册,改用已注册的 EZ1009(Execution_Error:当前 SoC/kernel/组合不支持)上报 swiglu_group_quant 的 3 处 route 校验;Arglist 为 {opName, reason},参数名并入 reason; - 平台/tiling 失败按 EZ1008 上报,未机械套用 EZ0026; - rank/dim 类检查统一 EZ0012,单参数 dtype 统一 EZ0020,与 G2 选码规则一致。 ## 关联的Issue 关联 issue #9113 ## 测试 本地为 Windows 环境,无 CANN toolkit,未执行 build.sh --ophost 编译与 UT;已完成静态自查: - 本次改动文件括号/注释/字符串平衡检查通过; - 全部 OP_LOGE_FOR_* 调用参数个数与仓库既有用法一致; - git diff --check 通过; - 范围内文件不再出现 OP_LOGE / EZ9999 参数校验首报(foreach op_api 的“当前平台不支持”分支除外)。 请 CI 执行编译与 UT 验证。 ## 文档更新 未更新文档。各算子 docs/*.md 中的错误码表为 aclnn 返回码(161001/161002),本次仅改变 host 侧上报的语义化错误码,公开返回码与失败场景描述未变化。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14804 | 2 days ago | |
fix(index): 整改 add_row_ranges 的错误码上报 Co-authored-by: qq_41311449<baihao29@huawei.com> # message auto-generated for no-merge-commit merge: !14953 merge fix/index-error-code-remediation into master fix(index): 整改 add_row_ranges 的错误码上报 Created-by: qq_41311449 Commit-by: qq_41311449 Merged-by: cann-robot Description: ## 描述 整改 add_row_ranges infershape / arch35 tiling 的错误码上报,将隐式 EZ9999 替换为正式语义码: - rank 约束 → EZ0011;多 Tensor shape 关系 → EZ0010;单 Tensor shape 约束 → EZ0009 - 单 dtype → EZ0020;多 dtype 关系 → EZ0021 - 外层包装改为 OP_LOGE_WITHOUT_REPORT,避免重复首报 - EZ0009 的 shape 参数去方括号,兼容目标版本注册模板;dtype 沿用 DT_ 约定 - 判定条件、控制流与公开返回值不变 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/9119 ## 测试 bash build.sh -u --ophost --ops=add_row_ranges --soc=ascend950 -j 96 host UT 29/29 通过(新增 18 个负向用例,断言错误码、完整 shape/dtype 字段及首错唯一性)。 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!14953 | 1 day ago | |
test(mse_loss_grad_v2): golden 判据统一为 cross_check L1 并共用一份 tolerance Co-authored-by: qq_37917228<yanmingkui@huawei.com> # message auto-generated for no-merge-commit merge: !15204 merge refactor/mse_loss_grad_v2_share_tol into master test(mse_loss_grad_v2): golden 判据统一为 cross_check L1 并共用一份 tolerance Created-by: qq_37917228 Commit-by: qq_37917228 Merged-by: cann-robot Description: ## 描述 - golden 判据从 mix_tolerance(CLI 专用别名)改为 cross_check L1(Spec.tolerance 官方四标准之一),对齐 mse_loss / mse_loss_v2 等同族算子 golden 的写法 - 删除与 _TOL 内容完全重复的 _TOL_LOCAL,kernel/GEIR、aclnn、e2e 三个 Spec 统一引用一份 _TOL,消除冗余维护点 ## 关联的Issue 关联Issue #9512 ## 测试 - pre-commit(ruff check/format、codespell、OAT 合规扫描)全部通过 ## 文档更新 无需更新文档 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:测试判据整改 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!15204 | 2 days ago | |
einsum infershape2.0 Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14984 merge kernel into master einsum inferdtype2.0 Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 本次变更围绕 Einsum 算子的 v2.0 图模式能力建设:将 Einsum 原型从 common/inc/op_graph/op_nn_proto_extend.h 中移出,改为在 matmul/einsum/op_graph/einsum_proto.h 中通过 OPS_PROTO_DEF_EINSUM 独立注册,并新增算子信息库定义、InferShape 与 InferDataType 实现,同时补充 GE IR 示例和 InferDataType 单元测试。核心是使 Einsum 的方程(equation)解析、省略号广播、未知维传播以及输出 dtype 跟随输入 x0 的能力在新框架下可用。 主要改动 Einsum 原型迁移与独立注册:删除 op_nn_proto_extend.h 中的 REG_OP(Einsum) 定义,改为在新文件 einsum_proto.h 中以 OPS_PROTO_DEF_EINSUM 宏保护重新注册,输入 x 为动态输入、输出 y 保持 float16/float32/int32 类型集合及 equation、N 两个必选属性。 新增算子信息库定义 einsum_def.cpp:通过 OpDef 声明 x 为 DYNAMIC、y 为 REQUIRED,统一 ND 格式与 UnknownShapeFormat,注册 ascend310p、ascend910b、ascend910_93、ascend950 的 AICore 配置并开启 DynamicShapeSupportFlag(true)。 新增 einsum_infershape.cpp 实现 v2.0 形状推导:以 InferShapeForEinsum 完成方程校验(-> 分隔、空项、重复标签、... 数量、N 与输入项数一致)、标签维度映射(InsertLabelToMap 支持 -1 未知维相容)、省略号维广播(GetEllipsisRes 取最大维)以及输出形状拼接(OutputWithEllipsis/OutputWithoutEllipsis),输入数量限制在 [1, 2]。 新增 einsum_graph_infer.cpp 的 dtype 推导:InferDataTypeEinsum 将输出 y 的 dtype 设为与首个输入 x 一致,并对空 context 返回 GRAPH_FAILED,通过 IMPL_OP(Einsum).InferDataType(...) 注册。 新增 GE IR 示例与单元测试:test_geir_einsum.cpp 以 abc,cd->abd、fp16 动态输入构建图并校验输出为 128.0,验证图模式经分解后的执行链路;test_einsum_graph_infer_pass.cpp 覆盖 fp32/fp16/int32、双输入跟随首个输入及空 context 共 5 个 InferDataTypeEinsum 用例。 ## 关联的Issue [#7634](https://gitcode.com/cann/ops-nn/issues/7634) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!14984 | 1 day ago | |
fix(error_code): 整改9个算子143个参数校验检查点错误码 Co-authored-by: wychencc_<wangyuchen53@huawei.com> # message auto-generated for no-merge-commit merge: !14804 merge errorCode into master fix(error_code): 整改9个算子143个参数校验检查点错误码 Created-by: wychencc_ Commit-by: wychencc_ Merged-by: cann-robot Description: ## 描述 按 CANN 错误码规范与 issue #9113 附件,对最终修改范围内的 9 个算子、143 个参数校验检查点进行整改,消除 EZ9999 / E*9*** 参数校验首报: - 根因层使用 OP_LOGE_FOR_* 语义宏,消息包含稳定参数名、实际值与期望值/原因; - 拆分 dim 数/取值、多参数关系等复合校验,一个检查只表达一个根因; - 外层聚合日志(InputParams is invalid.、infer shape check params failed. 等)改为 OP_LOGE_WITHOUT_REPORT,保证同一根因只正式首报一次; - 平台/UB tiling 失败(core num、ubSize、blockSize、vectorLength 等)使用 REPORT_PREDEFINED_ERR_MSG("EZ1008", {opName, reason}); - 公开返回值(aclnnStatus / graphStatus / errno)保持不变。 涉及算子与检查点数:embedding_hash_table_apply_adam_w(10)、embedding_hash_table_import(5)、foreach_non_finite_check_and_unscale(4)、group_norm(11)、group_norm_silu(13)、init_embedding_hash_table(1)、sparse_tensor_dense_mat_mul(9)、swiglu_group(17)、swiglu_group_quant(73),共 143 个检查点、15 个文件。其中 OP_CHECK_NULL_WITH_CONTEXT / 可选参数校验按 EZ0037 语义落地。 与 Excel 初选(AC 列)的差异: - 3 处外层聚合日志(group_norm / group_norm_silu 的 InputParams is invalid.,embedding_hash_table_apply_adam_w 的 infer shape check params failed.)按 PR #16138 与规范“首错唯一”改为 OP_LOGE_WITHOUT_REPORT,不重复上报(Excel 初选分别为 EZ0026/EZ0015); - EZ0108 未在目标版本注册,改用已注册的 EZ1009(Execution_Error:当前 SoC/kernel/组合不支持)上报 swiglu_group_quant 的 3 处 route 校验;Arglist 为 {opName, reason},参数名并入 reason; - 平台/tiling 失败按 EZ1008 上报,未机械套用 EZ0026; - rank/dim 类检查统一 EZ0012,单参数 dtype 统一 EZ0020,与 G2 选码规则一致。 ## 关联的Issue 关联 issue #9113 ## 测试 本地为 Windows 环境,无 CANN toolkit,未执行 build.sh --ophost 编译与 UT;已完成静态自查: - 本次改动文件括号/注释/字符串平衡检查通过; - 全部 OP_LOGE_FOR_* 调用参数个数与仓库既有用法一致; - git diff --check 通过; - 范围内文件不再出现 OP_LOGE / EZ9999 参数校验首报(foreach op_api 的“当前平台不支持”分支除外)。 请 CI 执行编译与 UT 验证。 ## 文档更新 未更新文档。各算子 docs/*.md 中的错误码表为 aclnn 返回码(161001/161002),本次仅改变 host 侧上报的语义化错误码,公开返回码与失败场景描述未变化。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14804 | 2 days ago | |
add_mode_check | 1 day ago | |
fix(pooling/vfusion): 修复 pool 反向空输入与 MSDA 反向越界等 6 条 issue Co-authored-by: yuhao_<yuhao93@huawei.com> # message auto-generated for no-merge-commit merge: !14721 merge fix/pool-backward-and-msda-issues into master fix(pooling/vfusion): 修复 pool 反向空输入与 MSDA 反向越界等 6 条 issue Created-by: yuhao_ Commit-by: yuhao_ Merged-by: cann-robot Description: ## 修复内容 - #8939 aclnnAdaptiveAvgPool2dBackward:空 gradOutput 入参拦截,返回 161002(ACLNN_ERR_PARAM_INVALID) - #8940 aclnnAdaptiveMaxPool2dBackward:空输入早退;gradInput 非空时用 l0op::Fill 显式写 0,保证输出确定性 - #8941 aclnnAdaptiveMaxPool3dBackward:同上 - #8429 MultiScaleDeformableAttentionGrad kernel:增加 spatialShape 边界 ascendc_assert,非法输入(H*W>numKeys)trap 并报明确错误信息,而非越界访问 - #8660 修正 aclnnMaxPool / aclnnMaxPool2dWithIndicesBackward 文档描述 - #8465 修正 AdaptiveMaxPool3dBackward README 描述 ## 验证 910B3 环境(CANN 9.2.1)编写 C++ 测试程序直调 aclnn 接口,7 个用例全部 PASS: - 8939 baseline / 空 gradOutput 返回 161002 - 8940 baseline / 空 gradOutput 成功 / gradInput 全部写 0 - 8941 baseline / 空 gradOutput 成功 / gradInput 全部写 0 - 8429 baseline / 非法 spatialShape 触发 kernel assert trap(status 507035) See merge request: cann/ops-nn!14721 | 2 days ago | |
fix(quant): 整改三个 quant 算子的错误码上报 Co-authored-by: qq_41311449<baihao29@huawei.com> # message auto-generated for no-merge-commit merge: !15141 merge fix/quant-error-code-remediation into master fix(quant): 整改三个 quant 算子的错误码上报 Created-by: qq_41311449 Commit-by: qq_41311449 Merged-by: cann-robot Description: ## 描述 整改 quant 下三个算子的错误码上报:ascend_anti_quant_v2、fake_quant_with_min_max_vars_per_channel、act_ulq_clamp_max_grad。 - 37 条隐式 EZ9999 替换为正式语义码:shape/rank → EZ0009/0010/0011/0012/0013;dtype → EZ0020/0021;属性值 → EZ0026;空 Tensor → EZ0016 - 外层重复上报改为 OP_LOGE_WITHOUT_REPORT,保证一次故障只有一个正式首错 - 4 条平台契约/内部不变量/不可达候选保留 EZ9999(1763/10/26/27) - 不改变判定条件、控制流与公开返回值 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/9123 ## 测试 - bash build.sh -u --ophost --ops=ascend_anti_quant_v2,fake_quant_with_min_max_vars_per_channel,act_ulq_clamp_max_grad --soc=ascend950 -j 96 - host UT 84/84 通过;clang-format 18.1.8 检查通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!15141 | 1 day ago | |
nn仓长尾算子的npuarch整改 Co-authored-by: xufeng12121<1074805447@qq.com> # message auto-generated for no-merge-commit merge: !14537 merge arch_35 into master nn仓长尾算子的npuarch整改 Created-by: xufeng12121 Commit-by: xufeng12121 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 长尾算子 NpuArch 整改,: - 1. 注册面迁移( _def.cpp): 算子注册从 this->AICore().AddConfig("ascend950"/"ascend350"/"ascend960dt"/"ascend960pr", aicoreConfig) 迁移为 opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510/DAV_9201/DAV_9202, aicoreConfig)(include op_common/op_host/util/op_arch_helper.h); AddConfig 收敛为 AddConfigByArch:Ascend950/Ascend350 折叠到 DAV_3510(同 arch 共享一份注册),960dt=DAV_9201、960pr=DAV_9202 保留显式注册; - 2. CMake arch 折叠同步: SUPPORT_COMPUTE_UNIT 由 soc 名折叠为 arch 名(ascend950/ascend350 → dav_3510,ascend960dt → dav_9201,ascend960pr → dav_9202),保留各算子原有其他 soc;SUPPORT_TILING_DIR 相应调整。 - 3. op_api / op_host tiling 枚举统一: 运行时 NpuArch::DAV_* 判断统一替换为 Ops::Base::DAV_*(约 38 处,include op_common/op_host/util/op_const_def.h,枚举同值纯改名),分支逻辑与 dtype 支持列表不变; ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/9456 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> 1.二进制比对一致 2.david冒烟通过100% ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14537 | 2 days ago | |
fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !14940 merge pr-pypto-arch into master fix(pypto): 导出规范arch token的PYPTOPRO_JIT_ARCH并补充add_example_pypto运行验证文档 Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: ### 关联的Issue Fixes #9467 ### 业务背景 add_example_pypto 代码评审问题整改:README 中英文缺少独立「运行验证」章节;「芯片与 arch」章节描述的 PYPTO_JIT_ARCH(a2/a3/a5)机制与 pypto-pro 实际行为不符。 ### 目的 1. 修复 PyPTO codegen arch 导出机制:pypto-pro 仅读取 PYPTOPRO_JIT_ARCH 且只支持 dav-3510(canonical token 为 3510)。原实现导出 PYPTO_JIT_ARCH=a3/a5 为无效 no-op:该变量不被 pypto-pro 消费,a5 为废弃别名(DeprecationWarning 后解析为 3510),a3 在 pypto-pro 中非法(normalize_arch 直接报错)。对齐 ops-math:_ARCH_MAP 改为 ascend950 -> 3510,cmake 导出改名。 2. README 中英文补充独立「运行验证 / Running and Verification」章节(参考 fused_matmul_silu 目录)。 ### 方案 - scripts/util/pypto_codegen.py:_ARCH_MAP 改为 {"ascend950": "3510"},环境变量改设 PYPTOPRO_JIT_ARCH - cmake/func.cmake:pypto_jit_arch_env 导出 PYPTOPRO_JIT_ARCH,注释同步 - cmake/gen_ops_info.cmake:注释 defaults to a5 更正为 defaults to 3510 - examples/add_example_pypto/README.md、README_en.md:重写「芯片与 arch」章节;新增「运行验证」章节 ### 验证 - ascend950 编译打包通过(build_out/cann-ops-nn-custom_linux-x86_64.run) - 构建规则实际导出 export PYPTOPRO_JIT_ARCH=3510(修复前为无人读取的 PYPTO_JIT_ARCH=a5) - ruff、clang-format 18.1.8、git diff --check、pre-commit 门禁(OAT 合规等)全部通过 See merge request: cann/ops-nn!14940 | 2 days ago | |
kernel ut校验 Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14507 merge fix into master kernel ut校验 Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 当kernel ut执行时,部分算子可能没有对应soc的实现,当前没有日志提示,难以定位,需要解决。 ## 关联的Issue [#7232](https://gitcode.com/cann/ops-nn/issues/7232) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!14507 | 5 days ago | |
A5新增算子quant_max_v2支持动静态分组量化 Co-authored-by: lingdong0725<lingdong1@huawei.com> # message auto-generated for no-merge-commit merge: !13696 merge grouped_quant_max_v2 into master A5新增算子quant_max_v2支持动静态分组量化 Created-by: lingdong0725 Commit-by: lingdong0725 Merged-by: cann-robot Description: ## 描述 接口功能:按 group_list 将输入 x 分组(不传 group_list 时整个 tensor 视为单组),对每组求 |x| 的最大值、并按该组唯一的标量系数完成量化,输出 y;逐组最大值 amax 为受属性门控的可选输出;动态量化下额外输出 y 的量化系数 y_scale(仅动态量化输出)。传入 x_scale_inv 时执行静态量化,不输入时执行动态量化。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!13696 | 8 days ago | |
fix(pooling/vfusion): 修复 pool 反向空输入与 MSDA 反向越界等 6 条 issue Co-authored-by: yuhao_<yuhao93@huawei.com> # message auto-generated for no-merge-commit merge: !14721 merge fix/pool-backward-and-msda-issues into master fix(pooling/vfusion): 修复 pool 反向空输入与 MSDA 反向越界等 6 条 issue Created-by: yuhao_ Commit-by: yuhao_ Merged-by: cann-robot Description: ## 修复内容 - #8939 aclnnAdaptiveAvgPool2dBackward:空 gradOutput 入参拦截,返回 161002(ACLNN_ERR_PARAM_INVALID) - #8940 aclnnAdaptiveMaxPool2dBackward:空输入早退;gradInput 非空时用 l0op::Fill 显式写 0,保证输出确定性 - #8941 aclnnAdaptiveMaxPool3dBackward:同上 - #8429 MultiScaleDeformableAttentionGrad kernel:增加 spatialShape 边界 ascendc_assert,非法输入(H*W>numKeys)trap 并报明确错误信息,而非越界访问 - #8660 修正 aclnnMaxPool / aclnnMaxPool2dWithIndicesBackward 文档描述 - #8465 修正 AdaptiveMaxPool3dBackward README 描述 ## 验证 910B3 环境(CANN 9.2.1)编写 C++ 测试程序直调 aclnn 接口,7 个用例全部 PASS: - 8939 baseline / 空 gradOutput 返回 161002 - 8940 baseline / 空 gradOutput 成功 / gradInput 全部写 0 - 8941 baseline / 空 gradOutput 成功 / gradInput 全部写 0 - 8429 baseline / 非法 spatialShape 触发 kernel assert trap(status 507035) See merge request: cann/ops-nn!14721 | 2 days ago | |
修改matmul 算子atoll 异常反馈判断 Co-authored-by: chenqi317<chenqi317@huawei.com> # message auto-generated for no-merge-commit merge: !7083 merge master into master 修改matmul 算子atoll 异常反馈判断 Created-by: chenqi317 Commit-by: chenqi317 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 修改matmul 算子atoll 异常反馈判断,异常时返回默认值 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/3882 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!7083 | 4 months ago | |
docs: 新增图融合规则说明文档 Co-authored-by: linzehui2058<2602241040@qq.com> # message auto-generated for no-merge-commit merge: !9676 merge fusion_pass_doc into master docs: 新增图融合规则说明文档 Created-by: linzehui2058 Commit-by: linzehui2058 Merged-by: cann-robot Description: ## 描述 对于已开源的图融合算子,进行对应的资料开源,包含MatmulToGemmOpFusionPass、MatmulReshapeTransposeFusionPass、GemmToMatmulFusionPass、BatchMatMul2MulFusionPass 其中的png图片格式,使用lfs进行托管 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/5541 ## 文档更新 matmul\batch_mat_mul_v3\docs\BatchMatMul2MulFusionPass.md matmul\mat_mul_v3\docs\MatmulToGemmOpFusionPass.md matmul\mat_mul_v3\docs\MatmulReshapeTransposeFusionPass.md matmul\mat_mul_v3\docs\GemmToMatmulFusionPass.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!9676 | 2 months ago | |
动态库解耦 Co-authored-by: 18811725231<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !8927 merge master into master 动态库解耦 Created-by: yang-di52 Commit-by: 18811725231 Merged-by: cann-robot Description: ## 描述 本 PR 旨在将算子侧代码与 legacy 动态库(libophost_comm_legacy.so)解耦:LegacyCommonMgr 新增 isSupported_ 支持位与 IsSupport() 接口,依据编译宏 ASCEND_COMPUTE_UNIT 判断当前 SoC 版本是否属于受支持集合 SUPPORTED_VERS(ascend910b、ascend910_93、ascend310p、ascend310b、ascend910),仅受支持时才 dlopen 加载 legacy 库;各 legacy 封装接口在不受支持时提前短路返回,matmul 系列算子的 tiling 流程同步改为容忍 legacy 能力缺失而不再硬失败,并配套调整 CMake 编译宏与 UT 测试。 ## 关联的Issue [5093](https://gitcode.com/cann/ops-nn/issues/5093) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!8927 | 2 months ago | |
fix: 特殊编译选项改用完整标志/精确 --tiling_key= 前缀识别,避免普通参数中的子串触发调试路由 Co-authored-by: Ethan_Zou<tianjun.zou@foxmail.com> # message auto-generated for no-merge-commit merge: !11855 merge fix/b6-nn-compiler-option-substring-routing-20261013 into master fix: 特殊编译选项改用完整标志/精确 --tiling_key= 前缀识别,避免普通参数中的子串触发调试路由 Created-by: Ethan_Zou Commit-by: Ethan_Zou Merged-by: cann-robot Description: ## 描述 将普通选项、精确debug标志及tiling key解析分离,删除不可达重复分支;文件写入使用O_APPEND,保留原有权限与输出协议。 本轮直接修改并验证实际生产实现,保留仓库原有Huawei版权与CANN许可。没有替换许可证、移除来源信息、屏蔽SCA或降低门禁阈值。SCA以新源流水线实际结果为准。 ## 关联的Issue Fixes [#6591](https://gitcode.com/cann/ops-nn/issues/6591). ## 测试 实际环境:远端Ubuntu22.04.5 x86_64、Python3.12.15、Host回归pytest8.3.2及原生隔离hook固定pytest8.3.5;安装CANN9.1.0。本轮没有执行NPU算子。 - 当前实际生产模块及tests/host完整回归:5项通过,无跳过。新增用例在完整未修改的旧公开生产源上复现失败,修复后通过。 - tiling相关PR对实际生成的完整Host struct/Init进行C++17编译并执行逐字节比较,包括1/4/8/12/13字节尺寸;不代表整个SDK/NPU头编译或设备运行通过。 - Host测试已接入仓库原生pre-commit的隔离Python环境,匹配scripts及tests/host变更;并非仅作者手工执行。 - 最终修改通过正常pre-commit(含ruff/codespell/OAT及Host回归)、正常amend、干净提交树相同回归、diff检查、LFS检查及恢复bundle验证。 当前唯一源提交 60be4500a7581598175c087bd688f0b7c0972374,推送后通过/compile回查当前源CodeCheck、SCA与完整CI。旧源扫描结论不代替新源结果。 ## 文档更新 无文档接口变更;实际修复范围、Host与NPU验证边界如上。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:生产结构改进、真实回归与原生门禁注册 <!-- maintenance-20261027a --> See merge request: cann/ops-nn!11855 | 13 days ago | |
fix: Modify the AIDD docs issue Co-authored-by: zwj223<zhangwenjing55@h-partners.com> # message auto-generated for no-merge-commit merge: !8149 merge master into master fix: Modify the AIDD docs issue Created-by: zwj223 Commit-by: zwj223 Merged-by: cann-robot Description: ## 描述 修改AIDD扫描的核心资料问题 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> [#3939](https://gitcode.com/cann/ops-nn/issues/3939) ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!8149 | 3 months ago | |
docs: update English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !13600 merge docs/update-english-translations into master docs: update English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 英文译稿合入后的增量同步与链接更新,共39个文件(37改2删): 1. 增量翻译(8篇):hard_shrink、squared_relu、foreach_lerp_list、foreach_maximum_scalar_list、quant_matmul_reduce_sum、deep_norm、apply_centered_rms_prop、torch_extension,同步最新中文源文档的变更内容。 2. 删除2篇译稿:rotate_quant/tests/st/arch35、grouped(上游已删除对应中文源文件)。 3. 链接改写(31篇):指向本仓已有英文版文档的链接统一改写为 _en 版本(含CONTRIBUTING/SECURITY/README、24处贡献流程链接、fast_kernel_launch_example等),并将残留的中文链接文字(贡献流程/贡献指南/安全声明等)译为英文。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试。已通过:全量1135篇译稿链接有效性校验(全部指向master已有文件);残留中文/全角标点扫描(仅存数学公式内源文件原文、无英文版目标文档的中文锚点等允许例外)。 ## 文档更新 更新37个英文译稿文件、删除2个(对应源文件已上游删除),不修改任何中文源文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!13600 | 18 days ago | |
feat(aicpu): AICPU built-in整包准入manifest机制 Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !11655 merge feat/aicpu-builtin-package-manifest into master feat(aicpu): AICPU built-in整包准入manifest机制 Created-by: liu-wei Commit-by: liu-wei Merged-by: cann-robot Description: ## 描述 为 ops-nn 移植 AICPU built-in 整包准入 manifest 机制: 通过白名单控制 AICPU 算子是否准入 built-in 整包,默认全 OFF(与 ops-math 上线口径一致,算子准入由后续 PR 按需登记 xxx=ON),将"隐式排除"显式化为白名单机制。 **主要改动:** - 新增 cmake/config/aicpu_builtin_package_manifest.cmake:准入清单(AICPU_BUILTIN_PACKAGE_FORCE_ALL 默认 OFF + 空 manifest),在进入算子子目录前 include - cmake/func.cmake 新增 check_aicpu_builtin_pkg_allowed() 门控 helper - 23 个 AICPU 算子 op_kernel_aicpu/CMakeLists.txt 的 op_def 收集与 cust obj 编译包进 if (ENABLE_CUSTOM OR _AICPU_BUILTIN_PKG_ALLOWED) 门控 - gen_norm_symbol() 补 built-in 产出接线:NO_AICPU=OFF && ENABLE_PACKAGE=ON 时生成 aicpu_nn.json + libnn_aicpu_kernels.so(安装至 opp/built-in/op_impl/aicpu/{config,kernel}) - 顺手规范化 elu、adaptive_max_pool2d 的变体版权头(master 遗留问题,OAT 合规要求) **不受 manifest 控制(行为不变):** ENABLE_CUSTOM(custom 包直通)、UT(AddAicpuOpTestCase 与收集逻辑解耦)、host 常量折叠(libopconstant_folding_nn.so) **默认行为无回退:** master 上 gen_norm_symbol() 本无 AICPU 产出调用(收集物无消费者),空 manifest 下整包产物与 master 完全一致 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/6515 ## 测试 本地 5 组 configure/build 验证: | 场景 | 结果 | |---|---| | 空 manifest 整包(ENABLE_PACKAGE=ON) | 干净跳过,无 aicpu 产物,与 master 一致 | | elu=ON | aicpu_nn.json 仅含 Elu;libnn_aicpu_kernels.so 仅链接 elu_cust_obj;安装路径正确 | | FORCE_ALL=ON | 23 算子全准入,json 含全部 23 个算子定义 | | ENABLE_CUSTOM=ON | 23 算子全收集,产出 cust_aicpu_kernel.json(→ vendors/custom_nn),与 master 无差异 | | UT(UT_TEST_ALL=ON) | 23 个算子 UT 用例正常创建 | pre-commit 全部通过(codespell、OAT 合规等)。 ## 文档更新 无需文档更新(纯构建配置改动) ## 类型标签 - 🐛 Bug修复 - ✅ ✨ 新特性 - ⚡ 性能优化 - ♻️ 重构 - 🧪 测试 - ✅ 📦 构建/CI - 🔧 配置变更 - 📝 文档更新 - ⬆️ 依赖升级 - 🔒 安全修复 - 🧹 代码清理 - ❓ 其他,请描述: See merge request: cann/ops-nn!11655 | 1 month ago | |
docs: 修复注释与文档不一致(贡献指南与fast kernel launch示例) Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !12380 merge docs/comment-cleanup-20261019-04 into master docs: 修复注释与文档不一致(贡献指南与fast kernel launch示例) Created-by: pingchuantang Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 修正文档中与实际内容/上下文不一致的表述: - CONTRIBUTING.md:将“确保您的贡献符合项目标准,签署 CLA”中的半角逗号 , 改为全角逗号 ,,统一中文标点规范。 - examples/fast_kernel_launch_example/README.md:删除“Ascend 950PR&950DT系列产品产品使用”中的重复“产品”,共两处(第 33 行、第 83 行)。 ## 关联的Issue 关联 Issue #6948 https://gitcode.com/cann/ops-nn/issues/6948 ## 测试 仅文档变更,不涉及代码逻辑;已人工核对修改后语句与上下文一致,无功能影响。 ## 文档更新 - 更新 CONTRIBUTING.md - 更新 examples/fast_kernel_launch_example/README.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!12380 | 1 month ago | |
docs: update English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !13600 merge docs/update-english-translations into master docs: update English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 英文译稿合入后的增量同步与链接更新,共39个文件(37改2删): 1. 增量翻译(8篇):hard_shrink、squared_relu、foreach_lerp_list、foreach_maximum_scalar_list、quant_matmul_reduce_sum、deep_norm、apply_centered_rms_prop、torch_extension,同步最新中文源文档的变更内容。 2. 删除2篇译稿:rotate_quant/tests/st/arch35、grouped(上游已删除对应中文源文件)。 3. 链接改写(31篇):指向本仓已有英文版文档的链接统一改写为 _en 版本(含CONTRIBUTING/SECURITY/README、24处贡献流程链接、fast_kernel_launch_example等),并将残留的中文链接文字(贡献流程/贡献指南/安全声明等)译为英文。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试。已通过:全量1135篇译稿链接有效性校验(全部指向master已有文件);残留中文/全角标点扫描(仅存数学公式内源文件原文、无英文版目标文档的中文锚点等允许例外)。 ## 文档更新 更新37个英文译稿文件、删除2个(对应源文件已上游删除),不修改任何中文源文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!13600 | 18 days ago | |
init | 1 year ago | |
docs: add LayerNormRemoveBroadcastFusionPass doc Co-authored-by: rk<wangpengbo26@huawei.com> # message auto-generated for no-merge-commit merge: !9631 merge ln_pass_doc into master docs: add LayerNormRemoveBroadcastFusionPass doc Created-by: wangpengbo26 Commit-by: rk Merged-by: cann-robot Description: ## 描述 为现有LayerNormRemoveBroadcastFusionPass融合规则补充独立资料页。该规则在Ascend 950PR/Ascend 950DT场景下,将LayerNorm算子gamma和beta输入前的BroadcastTo从图中删除,使gamma和beta直接作为LayerNorm算子的输入,并将begin_norm_axis和begin_params_axis统一设置为归一化维度的起始轴。 资料同步说明规则的使用约束: - LayerNorm算子的gamma和beta输入前均为BroadcastTo,且两个BroadcastTo的shape输入相同。 - 输入x、gamma和beta均为静态shape。 - gamma和beta不为标量,二者的shape和数据类型相同。 - gamma的维数不大于x的维数,且gamma的shape与x从归一化轴开始的后缀shape相同。 - LayerNorm算子的begin_norm_axis换算为非负轴后,指向归一化维度的起始轴。 同时新增融合前后拓扑对比图,展示两个BroadcastTo节点被移除前后的图结构。 ## 关联的Issue - https://gitcode.com/cann/ops-nn/issues/5430 ## 测试 - 本次仅新增文档和配图,不涉及代码逻辑变更,未执行代码测试。 - 已检查Markdown格式、图片文件格式及图片引用路径。 ## 文档更新 - 新增 norm/layer_norm/docs/LayerNormRemoveBroadcastFusionPass.md,说明融合模式和使用约束。 - 新增docs/zh/figures/LayerNormRemoveBroadcastFusionPass_1.png,展示融合前后的图结构。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!9631 | 2 months ago | |
update readme Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14732 merge patch into master update readme Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 update readme ## 关联的Issue [#9067](https://gitcode.com/cann/ops-nn/issues/9067) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14732 | 4 days ago | |
update readme Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14732 merge patch into master update readme Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 update readme ## 关联的Issue [#9067](https://gitcode.com/cann/ops-nn/issues/9067) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14732 | 4 days ago | |
[Docs] 修正文档中指向旧平台 gitee.com 的链接 Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !12487 merge docs/fix-stale-platform-link into master [Docs] 修正文档中指向旧平台 gitee.com 的链接 Created-by: gxhgxh2475698 Commit-by: aodebiao;gxhgxh2475698 Merged-by: cann-robot Description: ## 描述 文档中仍有指向旧平台 gitee.com 的链接,共 3 处(SECURITY.md 2 处指向 gitee.com/ascend/pytorch,docs/zh/develop/aicore_develop_guide.md 1 处指向 gitee.com/ascend/samples)。项目源码与社区已迁至 GitCode,旧地址不再是本项目的可用入口。本次更新为对应的 GitCode 地址,链接文字与其余内容不变。 ## 改动内容 1. SECURITY.md:2 处 gitee.com/ascend/pytorch → gitcode.com/Ascend/pytorch 2. docs/zh/develop/aicore_develop_guide.md:1 处 gitee.com/ascend/samples → gitcode.com/cann/cann-samples 共 2 个文件、2 行变更(同一行内的链接替换)。 ## 关联的Issue 修复 #7127([Documentation|文档反馈]: 文档中仍指向旧平台 gitee.com/ascend 的链接(3 处)) ## 测试 纯文档改动,不涉及代码,未运行编译与 UT。 验证方式: - 修改前 grep -rn "gitee.com" --include=*.md SECURITY.md docs/zh/develop/aicore_develop_guide.md 命中 3 处,修改后为 0 处; - 仅替换链接地址,链接文字、章节结构与其余内容未变;改动前后断链数一致。 ## 文档更新 - SECURITY.md - docs/zh/develop/aicore_develop_guide.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!12487 | 13 days ago | |
[Docs] 修正文档中指向旧平台 gitee.com 的链接 Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !12487 merge docs/fix-stale-platform-link into master [Docs] 修正文档中指向旧平台 gitee.com 的链接 Created-by: gxhgxh2475698 Commit-by: aodebiao;gxhgxh2475698 Merged-by: cann-robot Description: ## 描述 文档中仍有指向旧平台 gitee.com 的链接,共 3 处(SECURITY.md 2 处指向 gitee.com/ascend/pytorch,docs/zh/develop/aicore_develop_guide.md 1 处指向 gitee.com/ascend/samples)。项目源码与社区已迁至 GitCode,旧地址不再是本项目的可用入口。本次更新为对应的 GitCode 地址,链接文字与其余内容不变。 ## 改动内容 1. SECURITY.md:2 处 gitee.com/ascend/pytorch → gitcode.com/Ascend/pytorch 2. docs/zh/develop/aicore_develop_guide.md:1 处 gitee.com/ascend/samples → gitcode.com/cann/cann-samples 共 2 个文件、2 行变更(同一行内的链接替换)。 ## 关联的Issue 修复 #7127([Documentation|文档反馈]: 文档中仍指向旧平台 gitee.com/ascend 的链接(3 处)) ## 测试 纯文档改动,不涉及代码,未运行编译与 UT。 验证方式: - 修改前 grep -rn "gitee.com" --include=*.md SECURITY.md docs/zh/develop/aicore_develop_guide.md 命中 3 处,修改后为 0 处; - 仅替换链接地址,链接文字、章节结构与其余内容未变;改动前后断链数一致。 ## 文档更新 - SECURITY.md - docs/zh/develop/aicore_develop_guide.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!12487 | 13 days ago | |
fix Third_Party_Open_Source_Software_List.yaml Co-authored-by: liuyufan0725<liuyufan9@huawei.com> # message auto-generated for no-merge-commit merge: !1879 merge fix_yaml into master fix Third_Party_Open_Source_Software_List.yaml Created-by: liuyufan0725 Commit-by: liuyufan0725 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 更新三方依赖清单Third_Party_Open_Source_Software_List.yaml 1、增加protobuf 2、将nlohmann/json修改为json ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> 关联Issue [#1042](https://gitcode.com/cann/ops-nn/issues/1042) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> 不涉及 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 更新了Third_Party_Open_Source_Software_List.yaml ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!1879 | 9 months ago | |
【描 述】 eigen update to 5.0.0 Co-authored-by: j00427146<jialimin1@huawei.com> # message auto-generated for no-merge-commit merge: !1152 merge master into master 【描 述】 eigen update to 5.0.0 Created-by: jialimin1 Commit-by: j00427146 Merged-by: cann-robot Description: ## 描述 现开源软件eigen 3.4.0 EOM,Eigen 从3.4.0版本升级到5.0.0,解决生命周期问题。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-nn/issues/975 https://gitcode.com/cann/ops-nn/issues/389 ## 测试   ## 文档更新 SECURITY.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:Update Eigen to 5.0.0 See merge request: cann/ops-nn!1152 | 9 months ago | |
[feat] 补充valgrind Co-authored-by: cong-jiyu<congjiyu@h-partners.com> # message auto-generated for no-merge-commit merge: !14047 merge valgrind into master [feat] 补充valgrind Created-by: cong-jiyu Commit-by: cong-jiyu Merged-by: cann-robot Description: ## 描述 本次改动主要为构建脚本补齐 valgrind 相关支持:在 build.sh 中新增 --valgrind 长选项,使 UT 可在 valgrind 下运行,同时处理该选项与 --asan 的互斥关系,并更新帮助说明。 新增 --valgrind 命令行选项: 在 SUPPORTED_LONG_OPTS 数组中增加 "valgrind",使构建脚本能够识别该长选项。 选项解析逻辑: 在 checkopts() 中新增 valgrind 分支,将其置为 ENABLE_VALGRIND=TRUE,并同时设置 ENABLE_UT_EXEC=FALSE,从而关闭直接执行 UT 的行为。 帮助信息更新: 在 usage() 中补充 --valgrind 的说明,提示其用于以 valgrind 运行 UT,且会禁用 asan 并启用 noexec。 ## 关联的Issue [#6536](https://gitcode.com/cann/ops-nn/issues/6536) ## 测试 本地编译成功 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!14047 | 10 days ago | |
fused_mat_mul ascend910b/910_93 change classify rule Co-authored-by: zhangtianrong<zhangtianrong@h-partners.com> # message auto-generated for no-merge-commit merge: !15199 merge fmm_classify_change into master fused_mat_mul ascend910b/910_93 change classify rule Created-by: zhangtianrong Commit-by: zhangtianrong Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 修改fused_mat_mul classify_rule责任田看护,将ascend910b/910_93代码归入正确责任田 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/9508 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:责任田看护 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!15199 | 2 days ago | |
docs:修改代码块缺闭合围栏问题 Co-authored-by: zwj223<zhangwenjing55@h-partners.com> # message auto-generated for no-merge-commit merge: !11686 merge master into master docs:修改代码块缺闭合围栏问题 Created-by: zwj223 Commit-by: zwj223 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> [#6434](https://gitcode.com/cann/ops-nn/issues/6434) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> codearts_check_rule_config.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!11686 | 1 month ago | |
docs: add English translations for operator READMEs and repo docs Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !13351 merge docs/add-english-docs into master docs: add English translations for operator READMEs and repo docs Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## Description Add English translations for 652 markdown documents: - Repo-level guides: README_en.md, CONTRIBUTING_en.md, SECURITY_en.md, CHANGELOG_en.md, codearts_check_rule_config_en.md - Operator READMEs under activation/, conv/, control/, foreach/, hash/, index/, loss/, matmul/, norm/, optim/, pooling/, quant/, rnn/, vfusion/, etc. - API and design docs under docs/ (aclnn_*, ascendir_*, fusion pass docs) - examples/ and torch_extension/ guides Note: a few cross-reference links whose English targets are not published yet temporarily point to their Chinese counterparts to keep links valid; they will be switched back to the English docs in a follow-up PR after this one is merged. ## Related Issue N/A ## Test - Verified all 1,344 intra-repo markdown links in the added files resolve against master: 0 broken links, 0 missing targets. ## Documentation Update - This PR only adds English documentation files (*_en.md); no existing Chinese documents are modified. ## Type Labels - [ ] Bug fix - [ ] New feature - [ ] Performance optimization - [x] Documentation update - [ ] Other, please describe: ## AI/Agent-Generated Declaration - [x] AI-assisted authoring See merge request: cann/ops-nn!13351 | 18 days ago | |
调整nn仓第三方依赖 Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !7845 merge pr_6933 into master 调整nn仓第三方依赖 Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 1. 文档声称 install_deps.sh 可一键安装所有列出的基础依赖("上述依赖可通过项目脚本一键安装"),但实际脚本仅安装了 GCC、CMake、pigz、dos2unix、patch,未安装 googletest(文档明确列为基础依赖项之一),开发者需手动下载源码、编译并安装 googletest,与文档"一键安装"的描述不符 2. python requirements多两个不需要的依赖 ### 主要修改 为install_deps.sh 增加了安装gtest的功能 删除requirements中多余的两个依赖 ## 关联的Issue [#4256](https://gitcode.com/cann/ops-nn/issues/4256) [#4154](https://gitcode.com/cann/ops-nn/issues/4154) ## 测试  ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!7845 | 3 months ago | |
revert//fix(opgraph): 支持旧版本 CANN 运行时加载融合 pass 库 Co-authored-by: cann-robot<cann@cann.team> # message auto-generated for no-merge-commit merge: !11095 merge revert-mr-9924-1790130631176-auto into master revert//fix(opgraph): 支持旧版本 CANN 运行时加载融合 pass 库 Created-by: cann-robot Commit-by: cann-robot Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!11095 | 1 month ago | |
bugfix: 运行依赖包名统一为连字符(ops_legacy→ops-legacy,ops_math→ops-math) Co-authored-by: gao19871128<1897001@qq.com> # message auto-generated for no-merge-commit merge: !13020 merge master into master bugfix: 运行依赖包名统一为连字符(ops_legacy→ops-legacy,ops_math→ops-math) Created-by: gao19871128 Commit-by: gao19871128 Merged-by: cann-robot Description: ## 描述 运行依赖包名统一为连字符(ops_legacy→ops-legacy,ops_math→ops-math) ## 关联的Issue [#7675](https://gitcode.com/cann/ops-nn/issues/7675) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!13020 | 22 days ago |
🔥Latest News
- [2026/08] Introduced the torch_extension framework, which bridges PyTorch interfaces with the ACLNN operator library through JIT compilation and supports standalone single-operator compilation and packaging (!5910).
- [2026/08] Added new operators SituGlu, SituGluGrad, and SituMxQuant.
- [2026/05] Optimized the kernel compilation configuration items and reduced the simplified_key and ascendc_config configuration files (!3330).
- [2026/05] Introduced ops-tensor, optimized Cube-class operators based on a layered structure, reduced offset computation, and simplified instruction parameters (!5036).
- [2026/05] Released the accuracy acceptance criteria for ecosystem operators (!4572).
- [2026/03] Open-source operators support the next-generation chip: Ascend950PR (!450).
- [2026/03] Added operator development samples for <<<>>> (!620).
- [2026/03] Low-bit operators and fused operators support more data types, such as fp8/mxfp8/hifp8/mxfp4, and support different quantization modes and combinations, including pertensor/perchannel/pertoken/pergroup/perblock: full quantization fused operator: quant_batch_matmul_v4, pseudo-quantization fused operator: weight_quant_batch_matmul_v2.
- [2026/03] Supported the new homogeneous programming operator implementation for SIMD/SIMT: [MapIndex] (#660), [ScatterSub] (#710).
- [2026/01] Added QuickStart, which guides beginners to get started with operator project deployment from scratch (Docker environment supported) and with the operator development and contribution workflows.
- [2025/12] Open-source operators support the Ascend 950PR&950DT products/KirinX90, and you can develop and debug them with the NPU Simulator simulation tool. Optimization guide documents are improved, focusing on the operator development guide, clarifying the minimum deliverables and key sample code, and providing guidance for migrating operators from the Ascend/samples repository to this project. The newly supported sparse 4:2 quantization matmul operator enables hardware acceleration for sparse matrices.
- [2025/11] Newly supported operators: index_fill, masked_scatter, scatter, tf_scatter_add, fused_cross_entropy_loss_with_max_sum.
- [2025/10] Added the experimental directory and improved the contribution guide, so that developers can debug and contribute custom operators.
- [2025/09] The ops-nn project went online for the first time, with open-source operators supporting the Atlas A2/A3 products.
🚀Overview
ops-nn is a high-level operator library in the CANN (Compute Architecture for Neural Networks) operator library that provides neural network computation capabilities. It includes matmul-class, activation-class, and other operators. The architecture of the operator library is as follows:

📌Version Compatibility
The source code of this project is released together with CANN software versions. For the mapping between CANN software versions and the tags of this project, refer to the corresponding version notes in the release repository. Note that to ensure smooth custom development based on the source code, select a compatible CANN version and GitCode tag source code. Using the master branch may cause version mismatch risks.
🛠️Environment Preparation
Environment deployment is a prerequisite for experiencing the capabilities of this project. Install the NPU driver and CANN package first, and ensure the environment works properly.
⬇️Source Code Download
After the environment is ready, download the branch source code that matches the CANN version. The general command is as follows, where ${tag_version} is replaced with the branch tag name. The following uses the download of the 9.0.0 branch source code as an example:
# General command: git clone -b ${tag_version} https://gitcode.com/cann/ops-nn.git
git clone -b 9.0.0 https://gitcode.com/cann/ops-nn.git
Note: If the matching branch source code already exists in the environment, you can skip this step. For example, CANNLab provides the source code corresponding to the latest CANN version by default.
📖Learning Tutorials
- Quick start: Quickly experience the core basic capabilities of the project from scratch, covering source code compilation, operator invocation, development, debugging, and other operations.
- Advanced tutorials: If you need to deeply understand project compilation and deployment, operator invocation, development, debugging and tuning, and other capabilities, go to the documentation center for detailed guidance.
💬Related Information
PS: The features and documentation of this project are continuously updated and improved. Stay tuned for the latest version.
- Issue feedback: Submit issues through GitCode Issues.
- Community interaction: Join discussions through GitCode Discussions.
- Technical column: Read technical articles, such as serial tutorials and best practices, through GitCode Wiki.