已合并
test: 补充ascir_common与ascir_att_impl单元测试(#210) #1985
test: 补充ascir_common与ascir_att_impl单元测试(#210) #1985
已合并
Leechi666创建于 11 天前
Leechi666
Leechi666成员
11 天前

Pull Request

描述

补充 autofuse/ascir/generator 目录的单元测试(Issue #210 generator 部分第一批提交):

源文件 新增内容 覆盖目标 行覆盖率
ascir_common.cpp 4 个用例 GetConversionFromDtypeMap 的输入/输出 dtype 命中映射分支;IsAllVecAxisContinuous 的输入/输出双向量化轴连续性判断(连续为真、输入侧非连续、输出侧非连续) 85.7% → 100%
v1_ascir_att_impl.h 26 个算子类契约断言 各 XAscIrAttImpl 的 GetApiPerf / GetAscendCApiPerfTable 返回自身 IR 名(宏生成类,防止算子改名/宏重构引入回归) 63.6% → 77.9%

变更含 CMakeLists 接线:test_ascir_ut 新增 2 个测试文件与 ${CODE_ROOT_DIR}/ascir/generator include 路径。

变更类型

关联的Issue

#210

如何测试

  1. sh build.sh -u --module=autofuse_framework -j 8
  2. 运行 AscirCommonTest(4 用例)与 AscIrAttImplTest(3 组共 26 类断言)全部通过
  3. lcov 收集验证 ascir_common.cpp 行覆盖率 100%(98/98 行、12/12 函数)

核对清单

其他信息

与 PR #1953(reg_func 部分)同属 Issue #210 的分批交付,本 PR 为 generator 目录首批。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Leechi666 的贡献)
Leechi666Leechi666成员
11 天前 创建了 pull request,commit 9a364772
Leechi666Leechi666成员
11 天前 关联了issue:【代码加固】补充autofuse/ascir/目录下单元测试
atomgit-bot
atomgit-bot
11 天前 评论:

变更摘要

本 PR 为 Issue #210(generator 目录)首批单元测试补充,聚焦 autofuse/ascir/generator 目录:新增 AscirCommonTest(4 个用例)与 AscIrAttImplTest(3 组共 26 类断言)两个测试文件,分别将 ascir_common.cpp 的行覆盖率从 85.7% 提升至 100%,并对 v1_ascir_att_impl.h 中各 XAscIrAttImpl 宏生成类做契约级断言;同时在 test_ascir_ut 的 CMakeLists 中接线新增测试文件与 ${CODE_ROOT_DIR}/ascir/generator include 路径。

主要改动

  • 新增 test_ascir_common.cpp(4 个用例):通过 AscirCommonTest 覆盖 GetConversionFromDtypeMap 输入/输出 dtype 命中映射表并正确替换(如 DT_FLOAT→DT_BF16DT_INT32→DT_FLOAT16)的分支,以及 IsAllVecAxisContinuous 输入/输出两侧双向量化轴连续判断的三个分支(两侧均连续返回 true、输出侧非连续返回 false、输入侧非连续返回 false)。
  • 新增 test_ascir_att_impl.cpp(26 类断言):通过 AscIrAttImplTestEXPECT_ATT_IMPL_NAMED 宏,对 Add/Gather/Abs 等逐元素类、ReduceArgMax 系列及 Data/Scalar/MatMul 等无建模类共 26 个 XAscIrAttImpl 实例断言 GetApiPerf()GetAscendCApiPerfTable() 均返回其自身 IR 名,防止算子改名或宏重构引入回归。
  • CMakeLists 接线调整test_ascir_ut 新增上述 2 个测试文件编译目标,并加入 ${CODE_ROOT_DIR}/ascir/generator include 路径(依据 PR 描述,无内嵌补丁)。
likedislike
不准确?
atomgit-bot
atomgit-bot
11 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
11 天前 评论:

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, zhang_shengjie, liyuewei (3/2) yangyongqiang0606 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robot成员
11 天前 评论:

CLA Signature Pass

hitLeechi, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
11 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
CANN-robotCANN-robot成员
11 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
Leechi666
Leechi666成员
11 天前 评论:

compile

likedislike
Leechi666Leechi666成员
11 天前 预合并成功(commit_id: 75375a5a64e1a825c908b675461aa8df561ac18a)
CANN-robot
CANN-robot成员
11 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
11 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-passed
Leechi666Leechi666成员
11 天前 修改了pull request 的描述
Leechi666Leechi666成员
11 天前 修改了pull request 的描述
zhang_shengjie成员
11 天前 评论:

/lgtm

likedislike
liyuewei
liyuewei成员
11 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:lgtm
yangyongqiang
yangyongqiang成员
10 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:approved
CANN-robotCANN-robot成员
10 天前 合入了pull request