Pull Request已成功合入, 合并人@CANN-robot
(感谢 Leechi666 的贡献)变更摘要
本 PR 是 Issue #210 的收官批次,核心包含两部分:为 generator/meta 目录补充大批量单元测试(新增 test_ascir_codegen_calc.cpp、test_ascir_codegen_impl.cpp、test_ascir_meta.cpp 三个测试文件,并大幅扩展 test_ascir_att_impl.cpp 的契约断言),同时清理 reg_func 目录中全仓库无调用方的迁移遗留死代码(删除 argmax.cpp、argmax_with_value.cpp、zerosLike.cpp 及 defalut_reg_func.h 中的对应声明)。整体以提升 v1_ascir_codegen_impl.h、v1_ascir_att_impl.h、ascir_utils.cpp、ascendc_graph_txt_dumper.cpp 的行/函数覆盖率为目标,据 PR 描述三目录合计覆盖率约达 94.3%。
主要改动
-
新增 codegen 实现元数据断言与策略探针测试:
test_ascir_codegen_impl.cpp对约 60 类算子逐一断言GetApiCallName/GetApiName/IncludeApiHeaderFiles/LoadApiHeaderFiles的非空与数量上限,并通过 13 次IsScalarInputSupported/IsScalarInputSupportedIfExchangeInputs计数探针驱动标量输入与 brc-inline 策略分支;test_ascir_codegen_calc.cpp采用Data→Load→Op→Store→Output构图覆盖 unary/binary/trinary/reduce/matmul 五族算子,调用CalcTmpBufSize、IsNodeValid、IsInplaceSupported、IsBrcInlineSupported,并对ArgMaxMultiRPhase1双输出场景单独构图验证。 -
将
v1_ascir_att_impl契约断言从 26 类扩展到 77 类:test_ascir_att_impl.cpp将原先按 ElementWise/ReduceArgMax/NoModeling 拆分的三个测试合并为GetApiPerfReturnsIrName_AllClasses,并补齐Maximum、ReduceMean、ClipByValue、Gelu、MaskedFill等算子的GetAscendCApiPerfTable断言。 -
补充 meta 目录 dump/工具函数单元测试:
test_ascir_meta.cpp构造携带非默认exec_condition、queue/buffer 内存属性(que_id/buf_id/hardware/position)、dtype 变体、tmp_buffers、常量轴与零 stride 广播、Workspace节点及_VfSubgraph_命名子图的图结构,驱动DebugImplGraphStr、DumpLoopExecutionView、GetDtypeInfo、GetAxisTypePriority/GetAxisTypeSuffix、CollectInputNames等渲染路径,并覆盖通过AUTOFUSE_DFX_FLAGS(--codegen_compile_debug)启用时GetDumpFilePrefix生成真实前缀的环境用例。 -
删除
reg_func无调用遗留死代码:整文件删除argmax.cpp、argmax_with_value.cpp(其CalcArgmaxTmpSize/CalcArgmaxWithValueTmpSize均回退到CalcDefaultTmpSize或固定分配临时 buffer)与zerosLike.cpp(CalcZerosLikeTmpSize),并同步从defalut_reg_func.h移除CalcArgmaxTmpSize、CalcArgmaxWithValueTmpSize两个函数声明。


/lgtm


/approve


Pull Request
描述
Issue #210 收官批次:补充 generator/meta 目录大批单元测试,并清理 reg_func 无调用遗留文件。
新增测试(4 个文件):
死代码清理: 删除TmpSize 在全仓库无任何调用方(ZerosLike 算子注册亦不存在),为迁移遗留死代码。
argmax.cpp/argmax_with_value.cpp/zerosLike.cpp及defalut_reg_func.h对应声明——三个文件的 Calc变更类型
关联的Issue
#210
如何测试
sh build.sh -u --module=autofuse_framework -j 8核对清单
其他信息
与 #1953(reg_func)、#1985(generator 前哨)、#1997(codegen 元数据)同属 Issue #210 分批交付,本 PR 为收官批次。剩余少量深渲染分支(~24 行)待 CI 增量覆盖率报告确认后按需补齐。