| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(aicpu): AICPU built-in整包准入manifest机制 Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !5693 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: ## 描述 新增aicpu_builtin_package_manifest.cmake策略文件,控制哪些AICPU算子在整包编译(--pkg)时打包device侧.so和json配置。 ### 设计要点 - 默认所有AICPU算子不进入built-in整包(manifest为空=OFF) - 新增算子想进入built-in整包时,在manifest中添加ON条目即可 - 想快速全量放开,把AICPU_BUILTIN_PACKAGE_FORCE_ALL改为ON - 不影响自定义包模式(--ops --vendor_name)行为 - host常量折叠(libopconstant_folding_math.so)不受manifest控制,保持已有行为 - 不新增任何编译选项或命令参数 ### 改动文件 - cmake/config/aicpu_builtin_package_manifest.cmake(新增):manifest策略文件 - CMakeLists.txt:在add_subdirectory之前include manifest文件 - cmake/func.cmake:add_all_modules_sources中增加manifest准入判断,统一控制AICPU的OpDef/JSON/cust_obj三条路径 - cmake/symbol.cmake:gen_norm_symbol中在ENABLE_PACKAGE且非DISABLE_AICPU时调用gen_aicpu_json_symbol和gen_aicpu_kernel_symbol(无准入算子时自动跳过) - 4个算子(topk/tan/lin_space/identity)的op_kernel_aicpu/CMakeLists.txt:统一加manifest准入检查,OpDef/JSON收集和cust_obj编译受同一条件控制 ### manifest使用方式 cmake # cmake/config/aicpu_builtin_package_manifest.cmake set(AICPU_BUILTIN_PACKAGE_FORCE_ALL OFF) set(AICPU_BUILTIN_PACKAGE_MANIFEST # 新增算子想进入built-in整包时在此添加 # "new_op=ON" ) # 全量放开: set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) ## 关联的Issue https://gitcode.com/cann/ops-math/issues/3194 ## 测试 ### 一、已有功能回归测试(manifest为空,验证不影响已有功能) TC-01: 整包编译(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功;libopconstant_folding_math.so 生成;libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成;AI Core 产物不变 TC-02: 自定义算子包编译(--ops=cumsum) 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 编译成功;libmath_aicpu_kernels.so 生成(含cumsum + identity等);cust_aicpu_kernel.json 生成;与改动前行为一致 TC-03: AI Core 算子不受影响 命令: bash build.sh --pkg --soc=ascend910_93 --ops=add -j16 预期: AI Core kernel binary 正常编译,不涉及 aicpu 逻辑 TC-04: UT 编译不受影响 命令: bash build.sh -u --noexec --soc=ascend910_93 -j16 预期: UT 编译成功,aicpu kernel UT 可执行文件生成 TC-05: host常量折叠库不受manifest影响 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libopconstant_folding_math.so 生成且包含全部已有aicpu算子,manifest为空不影响host_const_obj收集 TC-06: 静态库编译不受影响 命令: bash build.sh --pkg --static --soc=ascend910_93 -j16 预期: 静态库编译成功,产物与改动前一致 ### 二、manifest准入功能测试 TC-07: manifest为空时整包不产出device aicpu产物 前置: manifest中 AICPU_BUILTIN_PACKAGE_MANIFEST 为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-08: manifest指定单个算子ON(cumsum) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含cumsum);aicpu_math.json 生成(仅含cumsum);libopconstant_folding_math.so 照常生成(含全部算子) TC-09: manifest指定多个算子ON 前置: manifest中 "cumsum=ON" 和 "log=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含cumsum和log);aicpu_math.json 生成(含cumsum和log) TC-10: AICPU_BUILTIN_PACKAGE_FORCE_ALL=ON全量放开 前置: manifest中 set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含全部aicpu算子);aicpu_math.json 生成(含全部aicpu算子) TC-11: manifest中写ON但算子不存在 前置: manifest中 "nonexistent_op=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功(不报错);libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-12: --noaicpu仍然完全关闭aicpu 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 --noaicpu -j16 预期: DISABLE_AICPU=TRUE;不编译任何aicpu .o;不生成libmath_aicpu_kernels.so;不生成aicpu_math.json;不生成libopconstant_folding_math.so ### 三、manifest匹配准确性测试 TC-13: manifest key使用算子名 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 匹配成功,cumsum进入整包 TC-14: manifest key写错不匹配(大小写敏感) 前置: manifest中 "Cumsum=ON"(大写C) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL大小写敏感),cumsum不进入整包 TC-15: manifest value非ON不匹配 前置: manifest中 "cumsum=OFF" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL要求精确"=ON"),cumsum不进入整包 ### 四、安装卸载测试 TC-16: 整包安装(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功无ERROR;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在;opp/built-in/op_impl/aicpu/ 下无 aicpu_math.json 和 libmath_aicpu_kernels.so TC-17: 整包安装(manifest指定ON) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功;opp/built-in/op_impl/aicpu/config/aicpu_math.json 存在;opp/built-in/op_impl/aicpu/kernel/libmath_aicpu_kernels.so 存在;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在 TC-18: 整包卸载 命令: bash build_out/*.run --quiet --uninstall 预期: 卸载成功,所有aicpu相关文件被清理 ### 五、4个特殊算子回归测试(topk/tan/lin_space/identity) TC-19: 自定义包模式下4个算子行为不变 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 4个算子在自定义包模式下仍被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 包含 identity;cust_aicpu_kernel.json 包含 identity;与改动前行为一致 TC-20: 整包模式下4个算子受manifest控制 前置: manifest为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 4个算子不被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 不生成;identity 不出现在任何产物中 TC-21: 整包模式下manifest指定topk=ON 前置: manifest中 "topk=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含topk);aicpu_math.json 生成(含topk);identity 不在产物中 TC-22: 整包模式下manifest指定identity=ON 前置: manifest中 "identity=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含identity);aicpu_math.json 生成(含identity,JSON文件正确收集);topk 不在产物中 ### 六、pre-commit检查 TC-23: pre-commit通过 命令: pre-commit run --files <所有修改的文件> 预期: 全部 Passed ## 文档更新 无 ## 类型标签 - [ ] 🐛 Bug修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-math!5693 | 16 天前 | |
feat(cmake): prebed include/aicpu path in Findaicpu.cmake Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !5411 merge feat/prebed-include-aicpu-path into master feat(cmake): prebed include/aicpu path in Findaicpu.cmake Created-by: liu-wei Commit-by: liu-wei Merged-by: cann-robot Description: ## 描述 在 Findaicpu.cmake 中为已安装依赖包构建场景补充 include/aicpu 头文件搜索路径,预埋后续opbase中pkg_inc/aicpu头文件给include/aicpu/路径切换平稳过渡。 ### 变更 cmake if(BUILD_WITH_INSTALLED_DEPENDENCY_CANN_PKG) set(AICPU_INC_DIRS ... ${ASCEND_DIR}/${SYSTEM_PREFIX}/include/experiment/datagw/aicpu/common ${ASCEND_DIR}/${SYSTEM_PREFIX}/pkg_inc ${ASCEND_DIR}/${SYSTEM_PREFIX}/pkg_inc/aicpu ${ASCEND_DIR}/${SYSTEM_PREFIX}/include/aicpu ← 新增 ) ### 涉及文件 | 文件 | 变更 | 说明 | |------|------|------| | cmake/modules/Findaicpu.cmake | +1 | AICPU_INC_DIRS 追加 include/aicpu 路径 | ## 关联的Issue include path增加一个路径,逻辑简单,不用创建issue了。 ## 测试 相关用例测试通过。 ## 文档更新 NA ## 类型标签 - [ ] 🐛 Bug修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [x] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-math!5411 | 24 天前 | |
feat: 抽取 broadcast_util 统一非连续广播门限,div/realdiv/greater/greater_equal 接入并扩大非连续支持 Co-authored-by: zzz2048<zhuhanhan@huawei.com> # message auto-generated for no-merge-commit merge: !4935 merge nc-2803 into master feat: 抽取 broadcast_util 统一非连续广播门限,div/realdiv/greater/greater_equal 接入并扩大非连续支持 Created-by: zzz2048 Commit-by: zzz2048 Merged-by: cann-robot Description: ## 描述 新增共享工具 math/common/op_api/broadcast_util(namespace op),集中实现广播类算子的非连续支持门限判定 IsBroadcastTemplateNonContiguousSupport,div / realdiv / greater / greater_equal 四个算子的 op_api 层 统一接入,替换原先各自分散的 IsRegBase + IsAiCoreSupport 简单组合判定。 ### 改动内容 1. **新增 broadcast_util.cpp/.h** - 对外接口:IsBroadcastTemplateNonContiguousSupport(inputs, outputShape) - 维度折叠:PadSingleInput 补维、ComputeBroadcastFlags 广播标记、 ComputeBroadcastCollapsePlan 合轴决策(KEEP/MERGE/ABSORB,含 IsAxesPairJointContiguous 相邻轴联合连续性校验)、CollapseSingleTensor 折叠执行 - 门限判定 CheckNonContiguousSupport:对齐 opbase broadcast_tiling 的 schMode 301-305 模板选择逻辑——广播轴 / 合轴后超 4D → NonContiguousBase(304/305);末两轴转置且 ≤3D → LastTranspose(303);末轴大且连续 / 小末轴大步幅 / 单核小数据三场景 → NLast(301/302); dimLimit 按各输入自身 dtype 计算(cache_line / dtype_size),与 opbase 决策树逐输入 判定一致;304 与 305 的细分选择交由 opbase tiling 按切分自定,host 侧不模拟 UB 容量切分;输出末轴 > 8192 时 NDDMA 效率下降,回退 Contiguous 转换路径(LastTranspose 与 NonContiguousBase 场景共用该门限,8192 为当前调优值) - 全连续输入短路跳过折叠分析;各判定分支注释标注最终 schMode 2. **realdiv.cpp/.h**:IsRealDivSupportNonContiguous 签名从 (self) 扩展为 (self, other, outputShape);other==nullptr(divs 标量路径)过 IsRegBase/IsAiCoreSupport 门限后直接放行;双 tensor 路径走广播模板门限。 3. **aclnn_div.cpp**: - HandleMixDataTypeDiv:mix-dtype 路径仅在 910B/910_93 使能,与 RegBase 非连续门限 芯片互斥,保持原有 Contiguous 处理不变 - HandleNotMixDataTypeDiv:拆分 CastDivInput / SelectDivInputByNC 辅助函数消除 self/other 重复处理;需 Cast 输入沿用 Cast 产物,不需 Cast 输入按门限结果选择 非连续直通(CreateView)或转连续(Contiguous) - divs 标量路径 other 传 nullptr 4. **greater.cpp / greater_equal.cpp/.h**:IsGreaterSupportNonContiguous / IsGreaterEqualSupportNonContiguous 委托 IsBroadcastTemplateNonContiguousSupport (greater 单输入;greater_equal 双输入且 other 可为 nullptr,新增 other dtype 联合检查)。 5. **aclnn_ge_tensor.cpp**:抽取 CastInput / SelectByNC / PrepareBinaryOpInputs 辅助函数, 消除 self/other 处理重复代码。 6. **构建接入**:新增 math/common/CMakeLists.txt(GLOB 编入 opapi obj); cmake/func.cmake 的 check_compiled_ops 增加 COMMON_DIRS="common" 白名单过滤公共目录; opbase.cmake 的 OPBASE_TAG_ID 更新至 opbase master 最新(f09beaf7,含 303 并行度门限)。 7. **UT**:test_aclnn_real_div.cpp 适配 IsRealDivSupportNonContiguous 新签名。 ### 改动原因 - 各算子非连续判定逻辑分散重复(IsRegBase + IsAiCoreSupport 简单组合),无法区分 广播/转置等细分场景,与 opbase 广播模板实际能力不匹配 - 收敛到统一门限后降低维护成本,同时使非连续放行条件与 opbase 广播模板能力精确对齐 ## 关联的Issue #2866 ## 测试 - 精度:二级冒烟 + 算子泛化通过 - 批量测试性能效果: | 接口 | 用例数 | 平均性能提升 | |------|--------|--------------| | aclnnAdds | 484 | 9.4% | | aclnnGeTensor | 656 | 21.5% | | aclnnGtScalar | 856 | 29% | | aclnnDiv | 601 | 54.5% | > **表注**: 批量测试统计口径为各接口非连续形态用例合入前后的平均性能提升比例。 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4935 | 28 天前 | |
update license Co-authored-by: zhaozi3<zhaozi3@h-partners.com> # message auto-generated for no-merge-commit merge: !417 merge master into master update license Created-by: zhaozi3 Commit-by: zhaozi3 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!417 | 9 个月前 | |
feat: 编译时SOC版本支持前缀模糊匹配,新增-Wno-error=deprecated-declarations选项 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !4176 merge master into master feat: 编译时SOC版本支持前缀模糊匹配,新增-Wno-error=deprecated-declarations选项 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 优化编译构建流程,支持 SOC 版本前缀模糊匹配并放宽废弃声明警告处理。 ### 改动内容 **build.sh — SOC 版本模糊匹配** - 精确匹配失败时,启用前缀模糊匹配(双向前缀比较) - 多个候选时选取最长前缀匹配项 - 仅在无任何前缀匹配时才报错退出 **cmake/dependencies.cmake — 编译选项** - 新增 -Wno-error=deprecated-declarations,将废弃声明警告降级为非错误 ## 测试 - 非精确 SOC 版本名编译验证 - 无匹配 SOC 版本时正确报错 ## 类型标签 - [x] 新特性 - [x] 构建/CI ## 关联的Issue - #2279 See merge request: cann/ops-math!4176 | 2 个月前 | |
统一配置ops-math安装目录及文件权限 Co-authored-by: q00889097<qinhan10@huawei.com> # message auto-generated for no-merge-commit merge: !5338 merge master into master 统一配置ops-math安装目录及文件权限 Created-by: qinhan123 Commit-by: q00889097 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 本 PR 主要围绕 ops-math 打包脚本中安装目录及文件权限的统一配置进行清理与收敛:移除 install.sh 与 opp_install.sh 中分散在各阶段(读取安装信息前、安装完成后、root/非 root 分支内)且彼此重复/易冲突的 chmod 调用,并将安装信息相关文件的权限统一配置为 640,使文件权限由统一的配置项控制,减少安装过程中对目录和文件的反复授权操作。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3058 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5338 | 24 天前 | |
feat(aicpu): AICPU built-in整包准入manifest机制 Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !5693 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: ## 描述 新增aicpu_builtin_package_manifest.cmake策略文件,控制哪些AICPU算子在整包编译(--pkg)时打包device侧.so和json配置。 ### 设计要点 - 默认所有AICPU算子不进入built-in整包(manifest为空=OFF) - 新增算子想进入built-in整包时,在manifest中添加ON条目即可 - 想快速全量放开,把AICPU_BUILTIN_PACKAGE_FORCE_ALL改为ON - 不影响自定义包模式(--ops --vendor_name)行为 - host常量折叠(libopconstant_folding_math.so)不受manifest控制,保持已有行为 - 不新增任何编译选项或命令参数 ### 改动文件 - cmake/config/aicpu_builtin_package_manifest.cmake(新增):manifest策略文件 - CMakeLists.txt:在add_subdirectory之前include manifest文件 - cmake/func.cmake:add_all_modules_sources中增加manifest准入判断,统一控制AICPU的OpDef/JSON/cust_obj三条路径 - cmake/symbol.cmake:gen_norm_symbol中在ENABLE_PACKAGE且非DISABLE_AICPU时调用gen_aicpu_json_symbol和gen_aicpu_kernel_symbol(无准入算子时自动跳过) - 4个算子(topk/tan/lin_space/identity)的op_kernel_aicpu/CMakeLists.txt:统一加manifest准入检查,OpDef/JSON收集和cust_obj编译受同一条件控制 ### manifest使用方式 cmake # cmake/config/aicpu_builtin_package_manifest.cmake set(AICPU_BUILTIN_PACKAGE_FORCE_ALL OFF) set(AICPU_BUILTIN_PACKAGE_MANIFEST # 新增算子想进入built-in整包时在此添加 # "new_op=ON" ) # 全量放开: set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) ## 关联的Issue https://gitcode.com/cann/ops-math/issues/3194 ## 测试 ### 一、已有功能回归测试(manifest为空,验证不影响已有功能) TC-01: 整包编译(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功;libopconstant_folding_math.so 生成;libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成;AI Core 产物不变 TC-02: 自定义算子包编译(--ops=cumsum) 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 编译成功;libmath_aicpu_kernels.so 生成(含cumsum + identity等);cust_aicpu_kernel.json 生成;与改动前行为一致 TC-03: AI Core 算子不受影响 命令: bash build.sh --pkg --soc=ascend910_93 --ops=add -j16 预期: AI Core kernel binary 正常编译,不涉及 aicpu 逻辑 TC-04: UT 编译不受影响 命令: bash build.sh -u --noexec --soc=ascend910_93 -j16 预期: UT 编译成功,aicpu kernel UT 可执行文件生成 TC-05: host常量折叠库不受manifest影响 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libopconstant_folding_math.so 生成且包含全部已有aicpu算子,manifest为空不影响host_const_obj收集 TC-06: 静态库编译不受影响 命令: bash build.sh --pkg --static --soc=ascend910_93 -j16 预期: 静态库编译成功,产物与改动前一致 ### 二、manifest准入功能测试 TC-07: manifest为空时整包不产出device aicpu产物 前置: manifest中 AICPU_BUILTIN_PACKAGE_MANIFEST 为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-08: manifest指定单个算子ON(cumsum) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含cumsum);aicpu_math.json 生成(仅含cumsum);libopconstant_folding_math.so 照常生成(含全部算子) TC-09: manifest指定多个算子ON 前置: manifest中 "cumsum=ON" 和 "log=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含cumsum和log);aicpu_math.json 生成(含cumsum和log) TC-10: AICPU_BUILTIN_PACKAGE_FORCE_ALL=ON全量放开 前置: manifest中 set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含全部aicpu算子);aicpu_math.json 生成(含全部aicpu算子) TC-11: manifest中写ON但算子不存在 前置: manifest中 "nonexistent_op=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功(不报错);libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-12: --noaicpu仍然完全关闭aicpu 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 --noaicpu -j16 预期: DISABLE_AICPU=TRUE;不编译任何aicpu .o;不生成libmath_aicpu_kernels.so;不生成aicpu_math.json;不生成libopconstant_folding_math.so ### 三、manifest匹配准确性测试 TC-13: manifest key使用算子名 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 匹配成功,cumsum进入整包 TC-14: manifest key写错不匹配(大小写敏感) 前置: manifest中 "Cumsum=ON"(大写C) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL大小写敏感),cumsum不进入整包 TC-15: manifest value非ON不匹配 前置: manifest中 "cumsum=OFF" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL要求精确"=ON"),cumsum不进入整包 ### 四、安装卸载测试 TC-16: 整包安装(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功无ERROR;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在;opp/built-in/op_impl/aicpu/ 下无 aicpu_math.json 和 libmath_aicpu_kernels.so TC-17: 整包安装(manifest指定ON) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功;opp/built-in/op_impl/aicpu/config/aicpu_math.json 存在;opp/built-in/op_impl/aicpu/kernel/libmath_aicpu_kernels.so 存在;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在 TC-18: 整包卸载 命令: bash build_out/*.run --quiet --uninstall 预期: 卸载成功,所有aicpu相关文件被清理 ### 五、4个特殊算子回归测试(topk/tan/lin_space/identity) TC-19: 自定义包模式下4个算子行为不变 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 4个算子在自定义包模式下仍被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 包含 identity;cust_aicpu_kernel.json 包含 identity;与改动前行为一致 TC-20: 整包模式下4个算子受manifest控制 前置: manifest为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 4个算子不被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 不生成;identity 不出现在任何产物中 TC-21: 整包模式下manifest指定topk=ON 前置: manifest中 "topk=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含topk);aicpu_math.json 生成(含topk);identity 不在产物中 TC-22: 整包模式下manifest指定identity=ON 前置: manifest中 "identity=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含identity);aicpu_math.json 生成(含identity,JSON文件正确收集);topk 不在产物中 ### 六、pre-commit检查 TC-23: pre-commit通过 命令: pre-commit run --files <所有修改的文件> 预期: 全部 Passed ## 文档更新 无 ## 类型标签 - [ ] 🐛 Bug修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-math!5693 | 16 天前 | |
support compile pypto-pro op in ops-math Co-authored-by: sunhaoxuan2024<sunhaoxuan3@h-partners.com> # message auto-generated for no-merge-commit merge: !5276 merge pr-pypto-math into master support compile pypto-pro op in ops-math Created-by: h9718w Commit-by: sunhaoxuan2024 Merged-by: cann-robot Description: 移植 PyPTO 支持到 ops-math,包括 cmake/func.cmake、cmake/gen_ops_info.cmake、scripts/util/ascendc_impl_build.py、scripts/util/pypto_codegen.py 及示例算子 examples/pypto_add_example See merge request: cann/ops-math!5276 | 27 天前 | |
工程能力升级,增加aicpu算子genop、二进制多并发编译能力 Co-authored-by: songkai111<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !779 merge master into master 工程能力升级,增加aicpu算子genop、二进制多并发编译能力 Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!779 | 8 个月前 | |
update license Co-authored-by: zhaozi3<zhaozi3@h-partners.com> # message auto-generated for no-merge-commit merge: !417 merge master into master update license Created-by: zhaozi3 Commit-by: zhaozi3 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!417 | 9 个月前 | |
feat: 提取公共头文件 math_def_util.h Co-authored-by: zhanw_coding<zhanwang@huawei.com> # message auto-generated for no-merge-commit merge: !4869 merge ft-def-util into master feat: 提取公共头文件 math_def_util.h Created-by: zhanw_coding Commit-by: zhanw_coding Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> feat: 提取公共头文件 math_def_util.h op_def 使用的公共工具,提供多输入 data type 两两组合的编译期常量生成方法 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/2748 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4869 | 1 个月前 | |
feat: 支持 deb/rpm 包构建 Co-authored-by: songkai111<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !4178 merge master into master feat: 支持 deb/rpm 包构建 Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 为 ops-math 构建系统新增 deb/rpm 包构建能力,支持通过 --pkg-type 参数选择构建 run / rpm / deb / all 四种包类型。 ### 改动原因 当前 ops-math 仅支持生成 .run 自解压安装包,无法满足 Linux 发行版原生包管理的需求。 ### 改动方法 1. CMake 层面:新增 PACKAGE_TYPE 缓存变量(run/rpm/deb/all),升级 cann-cmake 依赖到 master-045 2. 构建脚本:build.sh 新增 --pkg-type=<TYPE> 参数,build_lib.sh 实现 rpm/deb 构建/清理/收集逻辑 3. CI 重新打包:ops_run_repackage.sh 支持 --pkg-type,在生成 .run 包后调用 ops_generate_rpm_deb.sh 4. 包管理钩子:新增 custom_postinst.sh 和 custom_prerm.sh 用于安装后/卸载前的 pip wheel 管理 5. 包配置更新:ops_math.xml 移除 EngineeringFiles,调整目录权限,添加版权头 ## 关联的Issue - #2460 ## 测试 - 本地验证 --pkg-type 参数校验逻辑 - CI 流水线已通过 ## 文档更新 - 更新 docs/zh/install/compile.md 中 cann-cmake 版本信息 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 See merge request: cann/ops-math!4178 | 2 个月前 | |
sync(static): 静态库编译优化——添加 target 存在性检查,新增多包合并脚本 Co-authored-by: songkai111<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !4355 merge master into master sync(static): 静态库编译优化——添加 target 存在性检查,新增多包合并脚本 Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 静态库编译流程优化,添加 target 存在性检查避免构建失败,并新增多包合并 CI 脚本。 ### 改动原因 1. 静态库构建时部分 target(ophost_math_static / opapi_math_static / cann_math_static)并非在所有编译场景下都存在,无条件构建会导致失败 2. CI 中需要将多个算子仓独立编译的静态库包合并为一个统一交付包 ### 改动方法 1. cmake/static.cmake: 增加 if (TARGET ...) 守卫,仅在相关 target 存在时才执行静态库打包 2. scripts/build_lib.sh: 获取 all_targets 后用 grep -wq 检查 target 是否存在再执行构建,static_files_dir 不存在时优雅跳过 3. scripts/ci/merge_static_packages.sh: 新增 CI 脚本,多个包解压后合并 .o 和头文件,重新打包 ## 关联的Issue - #2461 ## 测试 - CI 流水线验证通过 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 See merge request: cann/ops-math!4355 | 2 个月前 | |
feat(aicpu): AICPU built-in整包准入manifest机制 Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !5693 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: ## 描述 新增aicpu_builtin_package_manifest.cmake策略文件,控制哪些AICPU算子在整包编译(--pkg)时打包device侧.so和json配置。 ### 设计要点 - 默认所有AICPU算子不进入built-in整包(manifest为空=OFF) - 新增算子想进入built-in整包时,在manifest中添加ON条目即可 - 想快速全量放开,把AICPU_BUILTIN_PACKAGE_FORCE_ALL改为ON - 不影响自定义包模式(--ops --vendor_name)行为 - host常量折叠(libopconstant_folding_math.so)不受manifest控制,保持已有行为 - 不新增任何编译选项或命令参数 ### 改动文件 - cmake/config/aicpu_builtin_package_manifest.cmake(新增):manifest策略文件 - CMakeLists.txt:在add_subdirectory之前include manifest文件 - cmake/func.cmake:add_all_modules_sources中增加manifest准入判断,统一控制AICPU的OpDef/JSON/cust_obj三条路径 - cmake/symbol.cmake:gen_norm_symbol中在ENABLE_PACKAGE且非DISABLE_AICPU时调用gen_aicpu_json_symbol和gen_aicpu_kernel_symbol(无准入算子时自动跳过) - 4个算子(topk/tan/lin_space/identity)的op_kernel_aicpu/CMakeLists.txt:统一加manifest准入检查,OpDef/JSON收集和cust_obj编译受同一条件控制 ### manifest使用方式 cmake # cmake/config/aicpu_builtin_package_manifest.cmake set(AICPU_BUILTIN_PACKAGE_FORCE_ALL OFF) set(AICPU_BUILTIN_PACKAGE_MANIFEST # 新增算子想进入built-in整包时在此添加 # "new_op=ON" ) # 全量放开: set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) ## 关联的Issue https://gitcode.com/cann/ops-math/issues/3194 ## 测试 ### 一、已有功能回归测试(manifest为空,验证不影响已有功能) TC-01: 整包编译(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功;libopconstant_folding_math.so 生成;libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成;AI Core 产物不变 TC-02: 自定义算子包编译(--ops=cumsum) 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 编译成功;libmath_aicpu_kernels.so 生成(含cumsum + identity等);cust_aicpu_kernel.json 生成;与改动前行为一致 TC-03: AI Core 算子不受影响 命令: bash build.sh --pkg --soc=ascend910_93 --ops=add -j16 预期: AI Core kernel binary 正常编译,不涉及 aicpu 逻辑 TC-04: UT 编译不受影响 命令: bash build.sh -u --noexec --soc=ascend910_93 -j16 预期: UT 编译成功,aicpu kernel UT 可执行文件生成 TC-05: host常量折叠库不受manifest影响 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libopconstant_folding_math.so 生成且包含全部已有aicpu算子,manifest为空不影响host_const_obj收集 TC-06: 静态库编译不受影响 命令: bash build.sh --pkg --static --soc=ascend910_93 -j16 预期: 静态库编译成功,产物与改动前一致 ### 二、manifest准入功能测试 TC-07: manifest为空时整包不产出device aicpu产物 前置: manifest中 AICPU_BUILTIN_PACKAGE_MANIFEST 为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-08: manifest指定单个算子ON(cumsum) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含cumsum);aicpu_math.json 生成(仅含cumsum);libopconstant_folding_math.so 照常生成(含全部算子) TC-09: manifest指定多个算子ON 前置: manifest中 "cumsum=ON" 和 "log=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含cumsum和log);aicpu_math.json 生成(含cumsum和log) TC-10: AICPU_BUILTIN_PACKAGE_FORCE_ALL=ON全量放开 前置: manifest中 set(AICPU_BUILTIN_PACKAGE_FORCE_ALL ON) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含全部aicpu算子);aicpu_math.json 生成(含全部aicpu算子) TC-11: manifest中写ON但算子不存在 前置: manifest中 "nonexistent_op=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 编译成功(不报错);libmath_aicpu_kernels.so 不生成;aicpu_math.json 不生成 TC-12: --noaicpu仍然完全关闭aicpu 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 --noaicpu -j16 预期: DISABLE_AICPU=TRUE;不编译任何aicpu .o;不生成libmath_aicpu_kernels.so;不生成aicpu_math.json;不生成libopconstant_folding_math.so ### 三、manifest匹配准确性测试 TC-13: manifest key使用算子名 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 匹配成功,cumsum进入整包 TC-14: manifest key写错不匹配(大小写敏感) 前置: manifest中 "Cumsum=ON"(大写C) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL大小写敏感),cumsum不进入整包 TC-15: manifest value非ON不匹配 前置: manifest中 "cumsum=OFF" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 不匹配(STREQUAL要求精确"=ON"),cumsum不进入整包 ### 四、安装卸载测试 TC-16: 整包安装(manifest为空) 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功无ERROR;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在;opp/built-in/op_impl/aicpu/ 下无 aicpu_math.json 和 libmath_aicpu_kernels.so TC-17: 整包安装(manifest指定ON) 前置: manifest中 "cumsum=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 && bash build_out/*.run --quiet --full 预期: 安装成功;opp/built-in/op_impl/aicpu/config/aicpu_math.json 存在;opp/built-in/op_impl/aicpu/kernel/libmath_aicpu_kernels.so 存在;opp/built-in/op_impl/host_cpu/libopconstant_folding_math.so 存在 TC-18: 整包卸载 命令: bash build_out/*.run --quiet --uninstall 预期: 卸载成功,所有aicpu相关文件被清理 ### 五、4个特殊算子回归测试(topk/tan/lin_space/identity) TC-19: 自定义包模式下4个算子行为不变 命令: bash build.sh --pkg --soc=ascend910_93 --ops=cumsum --vendor_name=custom -j16 预期: 4个算子在自定义包模式下仍被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 包含 identity;cust_aicpu_kernel.json 包含 identity;与改动前行为一致 TC-20: 整包模式下4个算子受manifest控制 前置: manifest为空 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: 4个算子不被收入AICPU_CUST_OBJ_TARGETS;libmath_aicpu_kernels.so 不生成;identity 不出现在任何产物中 TC-21: 整包模式下manifest指定topk=ON 前置: manifest中 "topk=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(仅含topk);aicpu_math.json 生成(含topk);identity 不在产物中 TC-22: 整包模式下manifest指定identity=ON 前置: manifest中 "identity=ON" 命令: bash build.sh --pkg --soc=ascend910_93 -j16 预期: libmath_aicpu_kernels.so 生成(含identity);aicpu_math.json 生成(含identity,JSON文件正确收集);topk 不在产物中 ### 六、pre-commit检查 TC-23: pre-commit通过 命令: pre-commit run --files <所有修改的文件> 预期: 全部 Passed ## 文档更新 无 ## 类型标签 - [ ] 🐛 Bug修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-math!5693 | 16 天前 | |
TORCH EXTENSION算子工程 Co-authored-by: zhangzijie<zhangzijie11@hisilicon.com> # message auto-generated for no-merge-commit merge: !277 merge master into master TORCH EXTENSION算子工程 Created-by: zhangzijie Commit-by: zhangzijie Merged-by: turing_project1 Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> TORCH EXTENSION算子工程 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #123--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!277 | 10 个月前 | |
refactor: npu_indexing/correlation/one_hot_d onnx 插件迁移至 ParseParamsByOperatorFn 接口 Co-authored-by: clinglai0517<laichangling@huawei.com> # message auto-generated for no-merge-commit merge: !5325 merge fix-onnx-partitionedcall into master refactor: npu_indexing/correlation/one_hot_d onnx 插件迁移至 ParseParamsByOperatorFn 接口 Created-by: clinglai0517 Commit-by: clinglai0517 Merged-by: cann-robot Description: ## 描述 将 npu_indexing、correlation、one_hot_d 三个 ONNX 插件从旧 ParseParamsFn(const Message*, ge::Operator&) 接口迁移至 ParseParamsByOperatorFn,去除onnx_common.h / ge::onnx:: / NodeProto 依赖(强依赖 ge_onnx.pb.h),插件与 framework UT 编译均脱离 protobuf。 ### 迁移内容 - conversion/strided_slice/framework/npu_indexing_onnx_plugin.cpp + 7 UT :begins/ends/strides 与五个 mask 经 json 解析。 - common/src/framework/correlation_onnx_plugin.cpp + 5 UT :groups 属性经 json 解析,保留默认值。 - math/one_hot/framework/one_hot_d_onnx_plugin.cpp + 7 UT :depth(必需)/ num_classes / on_value / off_value 经 json 解析。 ### 公共工具下沉 onnx_common.h 中所有无 protobuf 依赖的 helper 全部下沉至common/inc/framework/math_onnx_plugin_util.h(protobuf-free):Vec2Tensor、CreateScalar、DataTypeOnnx、onnx2om_dtype_map、GetOmDtypeFromOnnxDtype、ChangeFormatFromOnnx。onnx_common.h 现仅保留ge_onnx.pb.h 等 include 链供未迁移插件使用,经包含 util 仍提供这些 helper,无破坏。 ### CI 修复 1. scripts/ci/gen_ci_cmd.py:get_op_ut_types 识别 <op>/framework/ 与 <op>/tests/ut/framework/ 变更为 ophost,修复仅改 framework/onnx 插件的 PR 生成 0 条命令、UT 未运行的问题。 2. cmake/ut.cmake:framework 分支 --ops 过滤区分 common 集中目录(按文件名) 与独立算子目录(按目录算子名),修复 test_*_onnx_plugin.cpp 因文件名算子名与目录算子名不一致被 continue 跳过、framework_ut_cases 仅剩 empty.cpp 占位的问题。 ## 关联的Issue Issue #2892 ## 测试 - 容器 CANN 9.0.0 / Ascend 910B3:Onnx*PluginTest 共 19 用例全 [ PASSED ]。 - CI 增量 --ops=correlation,one_hot,strided_slice --ophost:46 用例(含 19 个 onnx framework 用例)全过。 - pre-commit(clang-format / end-of-file / OAT)全绿。 ## 文档更新 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5325 | 24 天前 | |
feat: 支持 kernel_src 机制,允许算子通过 CMake 指定自定义 kernel 入口文件 Co-authored-by: songkai111<songkai111@noreply.gitcode.com> # message auto-generated for no-merge-commit merge: !3141 merge revert-mr-3138-1780580007491-auto into master feat: 支持 kernel_src 机制,允许算子通过 CMake 指定自定义 kernel 入口文件 Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 支持 kernel_src 机制,允许算子通过 CMake 的 add_kernel_sources() 函数指定自定义 kernel 入口文件,而非默认使用算子名.cpp。同步自 ops-nn PR#3936 的 cmake/scripts 改动。 ### 改动内容 **CMake 构建系统(4个文件)**: - cmake/func.cmake:add_kernel_sources() 函数新增 KERNEL_SRC 单值参数,支持指定算子入口文件名(不含.cpp后缀),缺省使用算子名;将 KERNEL_SRC 信息收集到 KERNEL_SRC_LIST 缓存变量中 - cmake/opbuild.cmake:在 gen_aclnn_with_opdef() 构建目标中新增构建后调用 insert_kernel_src.py 脚本的步骤,分别处理 ASCEND_AUTOGEN_PATH、inner、exc 三个目录下的 ini 文件 - cmake/ut.cmake:AddOpsTestCase() 中根据 KERNEL_SRC_LIST 查找自定义 kernel 入口文件对应的源文件路径 - cmake/variables.cmake:新增 KERNEL_SRC_LIST 缓存变量,用于存储 kernel 源文件信息 **Python 脚本(4个文件)**: - scripts/util/insert_kernel_src.py:新增脚本,解析 KERNEL_SRC_LIST 并在 aic-{compute_unit}-ops-info.ini 文件中插入或更新 kernelSrc.value 字段 - scripts/util/opdesc_parser.py:OpDesc 类新增 kernel_src 属性和 parse_kernel_src() 方法,解析 ini 文件中的 kernelSrc.value 配置 - scripts/util/ascendc_impl_build.py:在 write_adapt() 和 write_impl() 中使用 kernel_src 替代 op_file 作为源文件名,未指定时回退到 op_file - scripts/util/parse_ini_to_json.py:解析 ini 时跳过 kernelSrc 键,避免写入 JSON - scripts/kernel/binary_script/gen_ops_compile_ini.py:参数校验从 5 个调整为 6 个,适配新增参数 **算子示例(2个文件)**: - math/add/op_kernel/CMakeLists.txt:为 add 算子的 ascend950 和 mc62 两个 COMPUTE_UNITS 配置 KERNEL_SRC 为 arch35/add.cpp - math/add/op_kernel/add_apt.cpp → math/add/op_kernel/arch35/add.cpp:将 add_apt.cpp 重命名为 arch35/add.cpp,更新文件内引用路径(arch35/add_dag.h → add_dag.h,arch35/add_struct.h → add_struct.h) ## 关联的Issue - #1859 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3141 | 3 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 16 天前 | ||
| 24 天前 | ||
| 28 天前 | ||
| 9 个月前 | ||
| 2 个月前 | ||
| 24 天前 | ||
| 16 天前 | ||
| 27 天前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 16 天前 | ||
| 10 个月前 | ||
| 24 天前 | ||
| 3 个月前 |