已合并
fix(cpu_engine): 按 CANN 日志规范修正日志文案 #4568
Ding_Jing创建于 7 天前
fix(cpu_engine): 按 CANN 日志规范修正日志文案 #4568
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Ding_Jing 的贡献)atomgit-bot
7 天前 评论:
7 天前 评论:
变更摘要
该 PR 聚焦于 CPU 引擎及 AI CPU 运行时日志文案的规范化:按 CANN 日志规范统一日志措辞、语法、拼写、格式符与单位表述,涉及 compiler/engines/cpu_engine 下 aicpu_graph_optimizer、kernel_builder、tf_engine、cpu_optimizer 等模块的 AICPUE_* 日志,以及 runtime/v2/engine/aicpu 下 converter、graph_builder、kernel 等模块的 GELOG* 日志,改动不涉及业务逻辑,仅影响日志输出内容。
主要改动
- 规范语法与措辞:将
Don't need to ...、is not need、not support、has already exist、is not valid等改为规范表述(如It does not need to ...、is not supported、already exists),并将配置转换失败日志由Tran ... to integer failed. default value is ...统一为Convert ... to integer failed, use default value ...,涉及optimizer.cc、cpu_optimizer.cpp、tf_optimizer.cc等文件。 - 修正拼写与错误引用:修复
neod→node、adge→edge、probuf→protobuf、enmu→enum、mulit→multi等拼写错误;同时纠正日志中错误的接口/函数名引用,如UpdateInputDesc→UpdateOutputDesc(graph_optimizer_utils.cc)、SetInt→SetListInt(tf_kernel_builder.cc)、CreateAndInsertCacheUpdatef→CreateAndInsertCacheUpdate、funtion→function。 - 统一尺寸类日志的单位与格式符:为 workspace、task、kernel run param、tensor size 等数值日志补充
bytes单位,并修正与参数类型不匹配的格式符(如%d→%ld、%u→%zu、%ld→%zu),涉及kernel_builder.cc、cpu_kernel_builder.cpp、tf_util.cc、aicpu_bin_handler.cc等。 - 修正运行时错误原因与序数表述:将失败原因表述由
result of ...改为because ...,Not find ...改为Cannot find ...,does not finished改为has not finished,3th→3rd,并统一must less than→must be less than、exceed ...→exceeds ...等措辞。 - sequence 相关日志格式修复:
tensor_sequence.h中int64_t的index/size打印改用PRId64格式符并新增#include <cinttypes>头文件,确保 64 位整数正确输出;bg_aicpu_arg.cc中then→than并统一空格分隔。


atomgit-bot
7 天前 评论:
7 天前 评论:
7 天前 添加了label:cann-cla/yes
CANN-robot
7 天前 评论:
7 天前 评论:
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 |
|---|---|---|
| compiler/engines/cpu_engine | ✅ tangqunzhang, lining23666, 刘伟, 张德鹏 (4/2) | ✅ 刘伟, 张德鹏 (2/1) |
| repo-cann/ge | ✅ lining23666, 张德鹏, tangqunzhang (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Ding_Jing, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了74条消息 查看更多
6 天前 添加了label:lgtm
5 天前 添加了label:approved
5 天前 关闭了关联的issue
5 天前 合入了pull request
描述
依据《CANN 日志规范》修正 develop 分支
compiler/engines/cpu_engine、runtime/v2/engine/aicpu下的运行时日志文案,共 233 处:语法错误 163、拼写错误 37、错误描述不完整 17、
缺少度量单位 15、魔鬼数字 1。
neod def→node def(13 处)、Tran→Convert、probuf→protobuf、adge→edge、funtion→function、smaller then→smaller thanwhen calculate→when calculating、is not need update→does not need to update、has already exist→already exists、failed result of→because ...Call UpdateInputDesc ...实际调用的是UpdateOutputDesc;AddInputDesc "x"与"perm"两处共用同一句文案;ffts 属性名打印成ATTR_NAME_UNKNOWN_SHAPE_TYPE,改为真实属性名bytes;unknown type 4改为unknown shape type[DEPEND_COMPUTE]修改边界:只改日志格式串及其实参,不改动任何控制流、返回值和业务逻辑。
部分行因文案变长按 120 列做了折行。
关联的Issue
关联Issue #541(master 分支对应 Issue:#528)
测试
1. develop 侧新增 2 处的单独验证
两处均为纯字符串字面量修改(占位符与实参未动)。用
format(printf)属性最小复现,对改前/改后两组格式串在
-Werror=format下编译:均通过,占位符与实参完全对应。其中
AICPU_REPORT_INNER_ERR_MSG最终落到带FORMAT_PRINTF(5, 6)的error_message::ReportInnerErrMsg,是真正受-Wformat检查的链路。2. 仓内 pre-commit 全量复跑(43 个改动文件)
trailing-whitespace / end-of-file-fixer / check-merge-conflict / detect-private-key /
clang-format / codespell / OAT Compliance —— 全部 Passed。
3. 脚本化校验
占位符数 - 实参数一致 —— 通过;注:本仓多数日志宏(
GELOGE→dlog_error→DlogRecord)未落到带format属性的函数上,GCC 的
-Wformat无法对其做格式串类型校验,因此这类调用的类型匹配依赖上述第 1 项的脚本核对。建议门禁补充完整编译 + 相关模块 UT/ST 冒烟。
文档更新
无,不涉及对外接口与文档。
类型标签