Merged
fix(machine): fix log level mismatch, magic number and grammar errors #5720
chaizhengtongAdd on Aug 27
fix(machine): fix log level mismatch, magic number and grammar errors #5720
Merged
Merged fromchai-hw/pypto_chaipyptolog_fix2intocann/pyptomaster
chaizhengtongCollaborators
Aug 27
Aug 27


Pull Request has been successfully merged by CANN-robot.
(Thank you for chaizhengtong's contribution.)Aug 27 Created pull request, commit 334ea529
atomgit-bot
Aug 27 Comments:
Aug 27 Comments:
变更摘要
本 PR(fix(machine))主要针对日志输出进行规范性整改(对应背景说明"日志规范性整改"),涉及 4 个文件的少量改动,修复日志级别不匹配、魔法数字以及日志/报错文本中的语法与格式错误,不涉及业务逻辑变更。具体包括:在 cann_adapter.h 中将函数加载失败的日志级别由 info 提升为 error 并补充错误码;在 device_ctrl.h 中用描述性文本替换无意义的魔法数字日志;在 convbp_operation_impl.cpp 中修正多条 CHECK 报错信息的语法与空格问题;在 dev_encode_workspace.cpp 中修正日志格式串多余的逗号。
主要改动
- 修复日志级别不匹配: 在
cann_adapter.h中,函数加载失败的日志由ADAPTER_LOGI(info 级)改为ADAPTER_LOGE(AdapterError::LOAD_LIBRARY_FAILED, ...),提升为 error 级并携带对应错误码AdapterError::LOAD_LIBRARY_FAILED。 - 消除魔法数字日志: 在
device_ctrl.h中,将DEV_INFO("ControlFlowCache: 1")改为DEV_INFO("ControlFlowCache: first init"),用描述性文本替代无意义的魔法数字 "1"。 - 修正报错信息语法: 在
convbp_operation_impl.cpp中修正三条CHECK报错文本:补充"]. Current value:"中缺失的空格、将 "must equal to" 改为 "must be equal to"、将 "should less than" 改为 "should be less than"。 - 修正日志格式标点: 在
dev_encode_workspace.cpp中移除日志格式串中多余的逗号,将"%lu bytes.,"修正为"%lu bytes."。


Incorrect?
atomgit-bot
Aug 27 Comments:
Aug 27 Comments:
Aug 27 Added label: cann-cla/yes
CANN-robot
Aug 27 Comments:
Aug 27 Comments:
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 |
|---|---|---|
| framework/src/adapter | ✅ 尹杰, jason_yuan_ye, gaoxingwang, gaoxiang618 (4/2) | ✅ 尹杰, jason_yuan_ye (2/1) |
| framework/src/cost_model | ✅ 尹杰, gaoxiang618, gaoxingwang (3/2) | ✅ 尹杰 (1/1) |
| framework/src/interface/cache | ✅ gaoxiang618, 尹杰, gaoxingwang (3/2) | ✅ 尹杰, gaoxiang618 (2/1) |
| framework/src/interface/operation | ✅ dai-zhentao, 尹杰, gaoxiang618, gaoxingwang (4/2) | ✅ dai-zhentao, 尹杰 (2/1) |
| framework/src/interface/program | ✅ gaoxiang618, 尹杰, gaoxingwang (3/2) | ✅ gaoxiang618, 尹杰 (2/1) |
| framework/src/interface/tensor | ✅ gaoxingwang, gaoxiang618, 尹杰 (3/2) | ✅ gaoxiang618, 尹杰 (2/1) |
| framework/src/machine | ✅ 尹杰, jason_yuan_ye, gaoxingwang, gaoxiang618 (4/2) | ✅ 尹杰, jason_yuan_ye (2/1) |
| repo-cann/pypto | ✅ gaoxiang618, dai-zhentao, 尹杰, jason_yuan_ye, gaoxingwang (5/2) | ✅ gaoxiang618, dai-zhentao, 尹杰, jason_yuan_ye (4/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chai-hw, thanks for your pull request. All authors of the commits have signed the CLA. 👍


103 messages are collapsed here。 See more
Aug 28 Added label: lgtm
dai-zhentao
Aug 28 Comments:
Aug 28 Comments:
/approve


Jie Yin
Aug 28 Comments:
Aug 28 Comments:
/approve


Aug 28 Added label: approved
Aug 28 Merged pull request