Pull Request已成功合入, 合并人@CANN-robot
(感谢 Leechi666 的贡献)变更摘要
本 PR 为 Issue #210 的第三批交付,属于 test: 类型变更,为 autofuse/ascir 目录补充 generator codegen 元数据与 meta 公共工具相关单元测试:新增两个测试文件,分别覆盖 v1_ascir_codegen_impl.h 中 53 个算子 CodegenImpl 类的元数据契约,以及 ascir_utils / ascendc_graph_txt_dumper 中的标识符渲染、dtype/轴类型解析等工具函数,以弥补此前大量从未被实例化的 Impl 类元数据方法与静态工具函数的测试空白。通过 CMakeLists 接线将新用例纳入 test_ascir_ut 构建(本地 lcov 实测将 v1_ascir_codegen_impl.h 行覆盖率由约 25% 提升至 64.2%,全量 781 用例 0 失败)。
主要改动
- 新增 codegen 元数据契约测试(
test_ascir_codegen_impl.cpp):新增AscIrCodegenImplMetaTest,通过EXPECT_CODEGEN_META宏遍历Abs、MatMul、Conv2D等 53 个算子,断言各 Impl 类的GetApiCallName()、GetApiName()非空,且IncludeApiHeaderFiles()(必要时含LoadApiHeaderFiles(false))头文件数量不超过 32 个,防止算子 API 名/头文件列表回归。 - 新增 meta 工具函数直测(
test_ascir_meta.cpp):新增AscirMetaUtilsTest,覆盖ascir::utils::IdentifierToStr(标识符渲染稳定非空)、GetDumpFilePrefix(确定性)以及ascir::dumper的GetDtypeInfo、GetAxisTypePriority/GetAxisTypeSuffix、ExtractDtypeFromTensorType/ExtractAxisListFromTensorType、BuildAxisIdToNameMap/BuildAxisIdToTypeMap等查找与解析逻辑,包含ge::DT_FLOAT等常见 dtype 解析及AscGraph轴映射用例。 - 构建接线调整:
test_ascir_ut新增上述 2 个测试文件,并为测试目标增加${CODE_ROOT_DIR}/ascir/generatorinclude 路径(依据 PR 描述,该文件无内嵌补丁),使新用例可随test_ascir_ut一起编译运行。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/graph-autofusion | ✅ yangyongqiang0606, liyuewei, xchu42 (3/2) | ✅ yangyongqiang0606 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


/lgtm


/approve


Pull Request
描述
补充 autofuse/ascir 目录单元测试(Issue #210 第三批交付,generator codegen 元数据 + meta 公共工具):
变更含 CMakeLists 接线:test_ascir_ut 新增 2 个测试文件与 ${CODE_ROOT_DIR}/ascir/generator include 路径。
变更类型
关联的Issue
#210
如何测试
sh build.sh -u --module=autofuse_framework -j 8AscIrCodegenImplMetaTest与AscirMetaUtilsTest全部通过(本地全量 781 用例 0 失败)核对清单
其他信息
与 PR #1953(reg_func)、#1985(generator 前哨)同属 Issue #210 分批交付。剩余缺口(codegen_impl 的 Calc/IsNodeValid 构图链路、txt_dumper/ascir_utils 的静态深链函数)将在后续批次补充。