已合并
fix: improve log usability #4556
洪跃城创建于 9 天前
fix: improve log usability #4556
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 洪跃城 的贡献)9 天前 添加了label:enhancement
atomgit-bot
9 天前 评论:
9 天前 评论:
变更摘要
本 PR(#4556,fix: improve log usability)是针对 GE 代码中日志易用性的专项整改,共涉及 54 个文件,改动以文本层面为主,不改变核心功能逻辑。主要工作包括修复日志与提示信息中的英文拼写、语法错误(如 "Dose"→"Does"、"fail"→"failed"、"concent"→"content"、"Uppdate"→"Update"、"can't not"→"cannot" 等),补充日志中的单位与上下文信息,统一并英文化生成代码中的注释与 T_DESC 等标记,以及优化不规范的日志输出方式(如将 printf/std::cerr 输出改为统一日志接口)。改动覆盖 api/acl、base/common、base/formats、compiler、graph_metadef、parser、runtime 等多个模块,涉及 ACL_LOG_INFO、GELOGI、GELOGE、REPORT_INNER_ERR_MSG、GE_ASSERT 等日志/断言宏的调用文本。
主要改动
- 修复拼写与语法错误:在
base/formats/format_transfers/format_transfer_nc1hwc0_nchw.cc、runtime/om2/formats/format_transfers/om2_format_transfer_hwcn_c1hwncoc0.cc中修正 "Dose not support" 为 "Does not support";在api/acl/stub/gen_stubapi.py、api/atc/main_impl.cc、compiler/graph/preprocess/hccl_offline_option_builder.cc、graph_metadef/register/op_binary_resource_manager.cc、compiler/opcompiler/op_compile_adapter/register/interface_checker/check_interface.py、parser/parser/tensorflow/tensorflow_parser.cc、runtime/v1/single_op/task/op_task.cc等文件修正 "fail"→"failed"、"generate"→"generated"、"concent"→"content"、"resion"→"reason"、"supper"→"super"、"Uppdate"→"Update"、"can't not"→"cannot"、"[Date]"→"[Data]" 等拼写及语法问题。 - 补充日志单位与上下文信息:在
runtime/v1/graph/load/model_manager/davinci_model.cc与runtime/v1/graph/manager/active_memory_allocator.cc的日志中补充bytes单位;在api/acl/acl_model/model/model_common.cpp中明确 "is longer than %zu characters";在graph_metadef/base/common/plugin/plugin_manager.cc的版本校验告警中补充所需版本范围信息[%s]。 - 英文化生成代码与注释:在
base/common/om2/codegen/emitter/stable_parts/stable_part_provider.cc中批量将OpArgInfo、AicoreDispatchInfo、AicpuDispatchInfo等稳定代码生成部分的中文注释译为英文;compiler/graph/eager_style_graph_builder/es_generator/py_generator.h、py_generator_utils.h、base/common/om2/codegen/file_code_generator/resources_file_code_generator.cc中的代码生成注释同步英文化;api/python/ge/ge/_capi/*.py的 docstring "C层" 改为 "C-layer",compiler/engines/hccl_engine/hcom_graph_adaptor/ge_plugin/common/hcom_log.h的T_DESC描述改为英文。 - 统一日志输出方式:在
compiler/opcompiler/op_compile_adapter/source/compile/fusion_manager.cc中将PrintProgressHint中逐点输出的printf(".")+fflush(stdout)改为TE_INFOLOG("Compiling, please wait.");在graph_metadef/graph/expression/expression_impl.cc中将Rational中的std::cerr输出改为GELOGE日志;compiler/graph/manager/graph_manager.cc中将不完整的日志消息 "Update " 补全为完整的 "Failed to update multi-batch context."。 - 优化错误提示语义:在
compiler/graph/manager/graph_manager.cc、base/common/helper/mobile_model_helper.cc、runtime/v2/lowering/graph_converter.cc、graph_metadef/graph/utils/ge_ir_utils.cc、tuning_utils.cc等文件的错误与告警文案中,将 "may lost"、"is not support"、"can only held" 等不规范表达改为 "may be lost"、"does not support"、"can only be held" 等语义更准确的说法。


atomgit-bot
9 天前 评论:
9 天前 评论:
9 天前 添加了label:cann-cla/yes
此处折叠了620条消息 查看更多
洪跃城
3 天前 评论:
3 天前 评论:
/check-pr


CANN-robot
3 天前 评论:
3 天前 评论:
The following label is not ready.
approved: Please wait for committers to review the code.


3 天前 添加了label:approved
3 天前 合入了pull request
Pull Request
描述
本次修改针对 GE 代码中的日志易用性问题进行整改,主要包括:
本次修改主要涉及日志和提示文本,不改变核心功能逻辑。
变更类型
请选择本次引入的变更类型:
关联的Issue
无关联Issue
如何测试
描述测试此变更的步骤和前提条件:
使用 git diff 对本次修改内容进行检查,确认修改范围均属于日志易用性整改。
使用 git diff --check 检查代码格式,确认不存在 trailing whitespace 等格式问题。
检查日志字符串修改前后的参数及格式化占位符,确认日志参数与原有逻辑保持一致。
确认本次修改主要涉及日志、提示信息及相关文本,不影响原有核心功能逻辑。
核对清单
其他信息
本次为日志易用性专项整改,修改范围涉及多个模块,主要针对现有日志中的拼写、语法、语义表达、单位信息以及日志输出规范进行优化。
相关修改不涉及对外接口变更,不改变现有业务流程及核心功能逻辑。