| feat: 支持八个迁移算子的常量折叠(#2551) Co-authored-by: pan-tong<pantong@huawei.com> # message auto-generated for no-merge-commit merge: !4511 merge feat/constant-folding-infershape into master feat: 支持八个迁移算子的常量折叠(#2551) Created-by: pan-tong Commit-by: pan-tong Merged-by: cann-robot Description: ## 描述 为 Ceil、ConcatV2、Expand、GreaterEqual、InvertPermutation、StridedSlice、StridedSliceV2、TransData 接入 HOSTCPU 常量折叠。 - 为尚未接线的 7 个算子在 CMake 中启用 HOSTCPU TRUE,将现有 AICPU kernel 编入 libopconstant_folding_math.so。 - 8 个算子的 AICPU kernel 使用 OPS_MATH_REGISTER_CPU_KERNELV2,兼容 device 注册和 host CPU Kernel V2 注册。 - 为 GreaterEqual 补齐 OPS_FLAG_OPEN;其余算子沿用已有 OPEN 配置。 - TransData 沿用已有 HOSTCPU 配置,并复用已接入 host object 的 format_transfer 辅助源。 - 增强 Ceil AICPU UT 的输出校验,新增 Ceil 全 Const GE 图常量折叠用例。 本 PR 不修改算子的 infershape 实现。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/2551 ## 测试 - AICPU UT:8 个算子共 156 个用例全部通过。 - HOSTCPU 构建:libopconstant_folding_math.so 构建成功,包含 8 个算子的 host 注册。 - 安装级 GE 常量折叠:8 个算子的全 Const 图输出均校验通过。 - 逐算子日志确认对应 host kernel 执行,ConstantFoldingPass 返回码均为 0。 - pre-commit:clang-format、codespell、OAT 等检查全部通过。 - GitCode 服务端 Hooks:通过。 ## 文档更新 无。该改动不改变算子接口和使用方式。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4511 | 3 months ago |