已合并
fix: 规范 random 目录算子日志输出(级别错配/拼写/语法/格式符/中文残留) #5347
liangtongxue创建于 15 天前
fix: 规范 random 目录算子日志输出(级别错配/拼写/语法/格式符/中文残留) #5347
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 liangtongxue 的贡献)15 天前 创建了 pull request,commit acd662de
atomgit-bot
15 天前 评论:
15 天前 评论:
变更摘要
本 PR 依据 cann-log-evaluation 技能对 random/* 全目录(含 examples、tests)执行三轮扫描与整改,核心目的是规范日志与错误文案。改动集中在四类:将 geir 示例中失败分支的日志级别由 INFO 修正为 ERROR;统一并修正日志文案的语法与拼写(如 only support→only supports、should same with→should be the same as、Infershape→InferShape、running begin→started 等);为 dtype/shape/size 校验失败日志补充实际值、为 allowed set 补充集合内容,使描述与实现及校验边界对齐;同时统一日志接口(std::cerr 改 OP_LOGx)、清除中文文案、修正格式符与实际参数类型(如 %ld/%d/%f 与 int64_t/uint32_t/uint64_t)的匹配。
主要改动
- geir 示例失败分支日志级别整改:在
drop_out_do_mask_v3、drop_out_v3、stateless_random、random_standard_normal_v2、random_uniform_int_v2、stateless_uniform、truncated_normal_v2等 12 个test_geir_*.cpp示例中,将Initialize ge/Run graph/Finalize等失败分支的printf("%s - INFO - [XIR]: xxx failed")统一改为- ERROR -,使失败场景与日志级别匹配。 - 错误文案语法/拼写规范化:
drop_out_v3_split_fusion_pass.cpp、drop_out_do_mask_tiling_arch35.cpp、stateless_randperm_tiling_for_sort.cpp等文件将only support→only supports、must be not equal→must not be equal、dtype must be same as→must be the same as、Infershape→InferShape、RadixSortTIling→RadixSortTiling、running begin→started等,并修正get dataType size fail→Failed to get dataType size.等表述。 - 校验失败日志补充当前值:
drop_out_v3_fusion_pass.cpp、random_tiling_arch35.cpp、stateless_randperm_tiling_arch35.cpp、aclnn_multinomial.cpp、aclnn_bernoulli.cpp等为 dtype/shape/size/范围校验补充实际取值(如dtype %d not supported、ub size %ld is invalid、Numsamples must be greater than 0, but got %ld、prob should be in range [0, 1], but got %f),并为CheckTensor的 dtype/dimNum 校验失败日志拼接 allowed set 内容。 - 格式符与实参类型对齐:
random_tiling_arch35.cpp、random_standard_normal_v2_tiling_arch35.cpp、random_uniform_int_v2_tiling_arch35.cpp、sim_thread_exponential_tiling_arch22.cpp、stateless_random_normal_v2_tiling_arch35.cpp等按成员实类型将%d/%lld修正为%ld/%llu/%u,如totalCoreNum、ubSize、state、outputSize等字段的打印。 - 日志接口统一与中文清理:
random_infershape_base.cpp将业务std::cerr改为OP_LOGx宏、random_dtype_fmt_gen.h改为OP_LOGW;多个 ST executor 与golden.py将中文提示(如"非连续操作"、"连接错误")改为英文;各 fusion pass 将 GE 版本魔鬼数字90000000统一表述为9.0.0,并修正random_uniform_onnx_plugin.cpp中 ONNX dtype 注释/文案与 kvlist 实现不一致的问题。


不准确?
atomgit-bot
15 天前 评论:
15 天前 评论:
15 天前 添加了label:stat/needs-squash
15 天前 添加了label:cann-cla/yes
此处折叠了101条消息 查看更多
11 天前 添加了label:approved
songkai111
11 天前 评论:
11 天前 评论:
/lgtm


11 天前 添加了label:lgtm
11 天前 关闭了关联的issue
11 天前 合入了pull request
描述
对
random/全目录 26 个算子(含 examples、tests)的日志输出做规范整改,修复以下缺陷:- INFO - [XIR]: xxx failed改为- ERROR -,按级别过滤时故障信息不再被忽略改动方法
仅修改日志语句的文案/级别/格式符与配套标识符拼写(如 isContinous_→isContinuous_ 等全量同步改名),不改动任何校验逻辑与控制流。
关联的Issue
#3083
测试
bash build.sh --pkg --jit --soc=ascend950编译打包通过(含 -Werror=format 严格校验)文档更新
无
类型标签