已合并
fix(compressor): validate A3 cache mode and grad enabled #10624
qiansunchi159创建于 11 天前
fix(compressor): validate A3 cache mode and grad enabled #10624
已合并
qiansunchi159创建于 11 天前
qiansunchi159成员
11 天前

描述

compressor算子A2/A3对cacheMode和gradEnable进行校验, 不支持的值直接报错

关联的Issue

关联issue #4581

测试

image.png

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 qiansunchi159 的贡献)
Qqiansunchi159成员
11 天前 创建了 pull request,commit a1422f25
atomgit-bot
atomgit-bot
11 天前 评论:

变更摘要

该 PR 聚焦于 Compressor 算子在 A3(arch22)平台上的参数校验:为 tiling 流程新增对 grad_enabled 属性的读取与合法性校验,并强化对 cache_mode 取值的约束,明确 A3 不支持环形缓冲模式(cache_mode=2)也不支持反向输出(grad_enabled=true),同时补充了对应的单测用例。

主要改动

  • 新增 grad_enabled 属性支持:在 compressor_tiling_arch22.h 中新增 GRAD_ENABLED_ATTR_INDEX = 4GRAD_ENABLED_NAME 常量及 CompressorContext 结构体的 gradEnabled 字段,并在 compressor_tiling.cppConvertContext 中将其从属性指针读出。
  • 新增 CheckSingleParaGradEnabled 校验:在 compressor_tiling.cpp 中新增该校验函数并挂入 CheckSinglePara 校验链,当 grad_enabled=true 时(A3 无 backward 输出路径)记录无效值日志并返回 GRAPH_FAILED
  • 收紧 cache_mode 校验:在 CheckSingleParaCacheMode 中补充注释明确 A3 不支持环形缓冲模式(cache_mode=2),仅支持线性 state-cache 缓冲模式(CACHE_MODE{1})。
  • 补充单测用例:在 test_compressor_tiling.cpp 中为现有 test1 增加 grad_enabled=false 属性,并新增两个预期失败的用例 test_cache_mode_ring_buffer_unsupportedcache_mode=2)和 test_grad_enabled_unsupportedgrad_enabled=true),验证非法参数均返回 GRAPH_FAILED
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
attention guijianwei, shasha_an (2/2) guijianwei (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robot成员
11 天前 评论:

CLA Signature Pass

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

likedislike
qiansunchi159成员
11 天前 评论:

compile

likedislike
Qqiansunchi159成员
11 天前 update merge request[project id: 7673863, iid: 10624, commit_id: 5601ab044923d071ced6c7b62cc7d1c1d0aaed16] virtual merging success
CANN-robotCANN-robot成员
11 天前 将guijianwei,hz36amy_00,coder_linx,juyangokok,monologue815,xuanyuandy,crystalhu,yu-xinjie62,huangwei791,jiang-lirui,yang-binrong,Allan_Yu,liudan12,shasha_an,wangzhe123456789,cc-z,shen_weiling,gaoxiang618,songjionghui,wenxin_fight,miaofangzheng,mabing1118,tang-hao-hw-gitcode,haijie_699874,zzy__,yuhao_,L_Euler设为评审人
CANN-robotCANN-robot成员
11 天前 将guijianwei,hz36amy_00,coder_linx,juyangokok,monologue815,xuanyuandy,crystalhu,yu-xinjie62,huangwei791,jiang-lirui,yang-binrong,Allan_Yu,liudan12,shasha_an,wangzhe123456789,cc-z,shen_weiling,gaoxiang618,songjionghui,wenxin_fight,miaofangzheng,mabing1118,tang-hao-hw-gitcode,haijie_699874,zzy__,yuhao_,L_Euler设为审查人
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [72e8bcfc2d584ed78be961c5feea6d9f][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-25 20:01:45]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [f786aa8a70b34e8cb0905d9e3ef0e959][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ❌ FAILED >>>>> >>>>>
likedislike
Qqiansunchi159成员
11 天前 update merge request[project id: 7673863, iid: 10624, commit_id: 10b0ffb27033f247307de3e629e5c837429ed2e7] virtual merging success
Qqiansunchi159成员
11 天前 推送  1 个提交:1d9bfd34-style(compressor): fix clang-format violations
Qqiansunchi159成员
11 天前 update merge request[project id: 7673863, iid: 10624, commit_id: 69f44d1e201260daac5f01fd42aaf7df911dd376] virtual merging success
CANN-robotCANN-robot成员
11 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
11 天前 添加了label:stat/needs-squash
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
qiansunchi159成员
11 天前 评论:

compile

likedislike
Qqiansunchi159成员
11 天前 update merge request[project id: 7673863, iid: 10624, commit_id: d789bb2f3c51a88827f321c81bb33c5d3f2b0e36] virtual merging success
CANN-robotCANN-robot成员
11 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
11 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-failed
CANN-robotCANN-robot成员
11 天前 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [3be212cfad274f22acebb60140f0d5e9][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_report_lcov ✅ SUCCESS >>>>>

[2026-08-25 20:34:53]    CI执行结束

likedislike
Qqiansunchi159成员
11 天前 修改了pull request 的描述
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [b38f15b18e6c44a0b75cb5d30c9ccc5d][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-08-25 20:08:32]    CI执行结束

likedislike
Qqiansunchi159成员
11 天前 修改了pull request 的描述
guijianwei
guijianwei成员
11 天前 评论:

/lgtm

likedislike
guijianwei
guijianwei成员
11 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:approved
shasha_an成员
11 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:api-check-pass
此处折叠了5条事件消息 查看更多
Qqiansunchi159成员
11 天前 修改了pull request 的描述