已合并
fix: 整改责任田算子日志质量(修复日志规范问题) #9154
StoneChan_创建于 10 天前
fix: 整改责任田算子日志质量(修复日志规范问题) #9154
已合并
StoneChan_创建于 10 天前
StoneChan_
StoneChan_成员
10 天前

问题描述 (必填)

依据 CANN 日志规范检查规则,对责任田算子的运行时日志进行质量整改,修复以下问题:

  • 级别错配:GE IR 示例(test_geir_reverse_sequence.cpp)失败信息误标 INFO(应 ERROR)
  • 拼写错误:Precison 等
  • 语法错误:"is fail" 中式结构、"fail to get" 缺时态、"is failed" 结构、Dcache Size 大小写等
  • 变量越限日志缺正确范围(ubFactor 等补充 "must be greater than 0, but got %ld")
  • 内部缩写 [XIR] 替换;printf/std::cout 统一走 LOG_PRINT 宏
  • UT 测试中冗余 std::cout 状态输出

影响算子:glu/reverse_sequence/sleep/quant_max/concat_offset/foreach_asin

环境信息 (必填)

不涉及(纯日志文案整改,无运行时行为变化)

重现步骤 (必填)

执行算子 UT / 查看相关算子日志

预期结果 (必填)

日志级别、文案符合日志规范,便于问题定位

日志 / 截图 (必填)

-(整改前后对比见 PR 变更)

备注 (选填)

  • 本次整改不改变算子功能逻辑

关联 PR:https://gitcode.com/cann/ops-nn/merge_requests/9154


关联的Issue:#5110

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

变更摘要

本 PR 依据 CANN 日志规范,对 glu、reverse_sequence、sleep、quant_max、concat_offset、foreach_asin 等责任田算子的运行时日志及对应 UT 测试进行质量整改(排除 experimental 目录),均为日志文案、级别与输出方式的调整,不改变算子功能逻辑。核心动作包括:将失败场景误标为 INFO 的日志统一改为 ERROR;修正 "fail to get" 缺时态、"is failed" 中式结构、"less than Dcache Size" 缺系动词等语法问题;为变量越限日志补充正确取值范围(如 "must be greater than 0, but got %ld");将示例中的 printf/std::cout 统一收敛到 LOG_PRINT 宏并将内部缩写 [XIR] 替换为算子专属标记 [REVERSE_SEQUENCE_GE_IR];删除 UT 中冗余的 std::cout 状态输出并为涉及文件补 (void) 防止未使用告警。

主要改动

  • 修复 GE IR 示例日志级别错配:在 test_geir_reverse_sequence.cpp 中,将初始化 GE、AddGraph、RunGraph、Finalize 等失败路径误标为 INFO 的 LOG_PRINT 统一改为 ERROR,并同步修正 "Precision is fail" 等文案。
  • 统一示例日志输出方式与标识:将 test_geir_reverse_sequence.cpp 中的 printf/std::cout 输出改为 LOG_PRINT(如 printf 生成输入失败、std::cout 输出 error/warning 消息与输出张量信息),并将内部缩写 [XIR] 替换为算子专属标记 [REVERSE_SEQUENCE_GE_IR]
  • 补充越限日志的正确取值范围reverse_sequence 系列 tiling(reverse_sequence_bas_tiling.cppreverse_sequence_bs_tiling.cppreverse_sequence_bsa_tiling.cppreverse_sequence_sba_common_tiling.cpp)中将 ubFactorA_/ubFactorB_/ubFactorS_ is %ld 改为 "must be greater than 0, but got %ld"。
  • 修正日志语法与拼写:glu、reverse_sequence、foreach_asin 等算子将 "fail to get" 改为 "Failed to get"、"support" 改为 "supports"、"less than Dcache Size" 改为 "is less than Dcache size"、"set tiling data fail" 改为 "failed to set tiling data" 等。
  • 清理 UT 冗余输出:删除 test_aclnn_glu.cpptest_sleep_*test_foreach_asin*test_quant_max*test_concat_offset_tilling.cpp 等测试中 SetUpTestCase/TearDownTestCase 及用例内多余的 std::cout 状态打印,并在 test_concat_offset_tilling.cpp 中对 tiling_data_result(void) 避免未使用告警。
likedislike
atomgit-bot
atomgit-bot
10 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
10 天前 评论:

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
activation 王星, 汤平川 (2/2) 王星, 汤平川 (2/1)
control 刘伟, 汤平川 (2/2) 刘伟 (1/1)
index 王星, 汤平川 (2/2) 王星, 汤平川 (2/1)
quant 王星, 汤平川 (2/2) 汤平川, 王星 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了65条消息 查看更多
TangPC
TangPC成员
9 天前 评论:

/lgtm
/approve

likedislike
liu-wei
liu-wei成员
9 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
9 天前 关闭了关联的issue
CANN-robotCANN-robot成员
9 天前 合入了pull request