Pull Request已成功合入, 合并人@CANN-robot
(感谢 devHaven 的贡献)变更摘要
该 PR 是一次日志整改(fix/log-warnings-cleanup),针对通信库中错误描述不完整、日志级别错配、日志含中文、冗余日志和未知缩写等问题,对 19 个文件的日志文本、日志级别和日志内容进行了系统性修正。改动不涉及功能逻辑变更,主要覆盖 HCCL_INFO/HCCL_ERROR/hccp_err 等日志宏的调用内容与级别调整,以及 Python 侧 common.log_info/log_error 的中文日志英文化。
主要改动
- 未知缩写清理:移除日志中的非标准缩写,如
SPK、nslbdp、NSLBDP-VERSION、rs_ibv_exp_create_cq等,改为带函数上下文的可读描述;其中coll_comm_executor.cc的GetAdjInfo将错误分支日志从HCCL_INFO提升为HCCL_WARNING,修正级别错配。 - 日志内容错误修正:修正日志文本与实际变量/操作不符的问题,如
transport_pub.h中将误写的remoteInputMem/remoteOutputMem改为localInputMem/localOutputMem,rs_rdma.c中将addr is NULL改为ibMr is NULL并在RsMrDereg中补充qpn/addr信息,ccu_context_reduce_mesh1d_two_shot_mem2mem.cc将日志中的srcAddr改为dstAddr,ins_temp_reduce_aicpu_reduce.cc将BatchSend改为BatchRecv。 - 错误描述补全:为报错日志补充取值范围或期望值,如
externalinput.cc的HCCL_DETERMINISTIC错误补充期望值STRICT/TRUE/FALSE,ra_adp.c的 chip id 错误补充HCCP_MAX_CHIP_ID、HDC 超时错误补充单位ms,cluster_monitor.cc/my_rank.cc/group_schedule_mgr.cc的端口与 rank 校验错误补充最大值/有效区间。 - 日志英文化:
exec_realtime_cmd.py将signal_handler、force_close等函数的文档字符串与运行日志(如 Ctrl+C 处理、SSH 连接失败、命令执行错误)由中文改为英文,符合禁止中文日志要求。 - 语义与冗余修正:
adapter_rts.cc将enableP2P/disableP2P的日志措辞由fail改为ret(避免与 INFO 级别语义冲突),aicpu_zero_copy_exchanger.cc修复重复方括号并明确sdma batch copy语义,host_cpu_roce_channel.cc在日志中补充BuildSocket上下文,rs_drv_rdma.c区分发送/接收 CQ 的创建日志。


代码审查
I have now reviewed all 19 changed files in this PR. This is a pure "日志整改" (log rectification) PR — every hunk modifies only log message text, log levels, or format strings. Let me do the final sweep on the one hunk containing computation (ra_adp.c timeout conversion) and the boundary values:
Final sweep notes:
ra_adp.cRaHwInit:timeout * (RA_THREAD_SLEEP_TIME / 1000)=timeout * 2ms, sinceRA_THREAD_SLEEP_TIMEis 2000µs andtimeout(int) starts atRA_THREAD_TRY_TIME=500, max value 1000 — no overflow, math consistent with theusleep(RA_THREAD_SLEEP_TIME)loop. Log-only.ra_adp.cRaHdcServerInit: new message passeschipId(unsigned int) andHCCP_MAX_CHIP_IDfor%u— both unsigned, format matches; thegHdcServer[chipId]indexing/short-circuit logic is pre-existing and untouched.group_schedule_mgr.cc:serverToRankSize_isstd::map<uint32_t,uint32_t>, so.at()returnsuint32_tfor%u— valid range[0, size)message matches thecurLocalRank >= sizecheck.cluster_monitor.cc/my_rank.cc:Hccl::MAX_VALUE_TCPPORTisconstexpr unsigned int(65535) —%ucorrect, matches the> MAXchecks.rs_rdma.c:gRsSendWrNumis still referenced at line 1054 (gRsSendWrNum++), so removing its log reference does not create dead code; newqpn[%u] addr[0x%llx]args match types (unsigned int,(unsigned long long)(uintptr_t)addr).transport_pub.h: labels now match the data printed (each of the 4 MemDetails logged with its own correct label) — this is a fix, not a regression.ccu_context_reduce_mesh1d_two_shot_mem2mem.cc: log now namesdstAddr.sizematching the actual checkdstAddr.size() != transports.size() + 1(theInvalid srcAddr sizeexception string mismatch is pre-existing, unmodified).ins_temp_reduce_aicpu_reduce.cc:Recvfailure now logs "BatchRecv failed" — genuine fix.adapter_rts.cc:fail[%d]→ret[%d]on unconditional INFO logs — accurate improvement.- Python file: docstring/log translations only; syntax intact.
No boundary errors, format-string mismatches, memory issues, or logic regressions were introduced.
关闭总结
审查结论:本 PR 为纯日志整改,共 19 个文件全部逐一审查完毕,未发现值得上报的问题。
按文件确认:
experimental/base_comm/channel/host_cpu_roce_channel.cc— no issues(仅日志文本补充)experimental/cluster_link_diag/dispatcher/exec_realtime_cmd.py— no issues(中译英日志/文档字符串,语法完整)src/base_comm/resources/hccp/rdma_agent/adapter/ra_adp.c— no issues(日志消息完善;timeout 换算×2ms与RA_THREAD_SLEEP_TIME=2000us一致,无溢出)src/base_comm/resources/hccp/rdma_agent/peer/ra_peer_ctx.c— no issues(格式串参数与类型匹配)src/base_comm/resources/hccp/rdma_service/rs_drv_rdma.c— no issues(日志加 send/recv 区分)src/base_comm/resources/hccp/rdma_service/rs_rdma.c— no issues(gRsSendWrNum仍在别处引用,非死代码)src/coll_communicator_mgr/communicator/group_schedule_mgr/group_schedule_mgr.cc— no issues(%u与 map 值类型匹配,范围描述正确)src/coll_communicator_mgr/dfx/cluster_monitor/cluster_monitor.cc— no issues(MAX_VALUE_TCPPORT为 unsigned int,格式正确)src/coll_communicator_mgr/resource_mgr/local/my_rank/my_rank.cc— no issues(同上)coll_all_reduce_mesh_aiv_executor.cc— no issues(仅移除 "SPK " 前缀)coll_comm_executor.cc— no issues(INFO→WARNING 级别调整 + 日志标签规范化,无逻辑改动)coll_reduce_scatter_aiv_deter_small_executor.cc— no issues(仅移除 "SPK " 前缀)comm_config.cc— no issues(日志标签规范化)aicpu_zero_copy_exchanger.cc— no issues(错误消息措辞修正,与实际 sdma 操作一致)adapter_rts.cc— no issues(无条件 INFO 日志 "fail"→"ret",更准确)externalinput.cc— no issues(补充合法取值说明,字符串拼接正确)transport_pub.h— no issues(日志标签与所打印字段对齐,属修复)ccu_context_reduce_mesh1d_two_shot_mem2mem.cc— no issues(日志变量名与检查条件dstAddr.size()对齐)ins_temp_reduce_aicpu_reduce.cc— no issues(Recv 失败日志 "BatchSend"→"BatchRecv",属修复)
风险判断:低风险。所有改动均限定在日志文本与日志级别,无逻辑、内存、安全或接口契约变更;个别格式串修复提升了日志可读性且参数类型均正确。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


/approve


/approve


描述
本pr主要是修改错误描述不完整、级别错配、禁止中文、冗余日志和未知缩写等问题,主要涉及experimental、src/base_comm/resources/hccp、src/coll_communicator_mgr、src/legacyascend910/algorithm/impl/coll_executor、src/legacyascend910/framework、src/legacyascend910/platform/commom/adapter、src/legacyascend910/pub_inc、src/legacy/ascend950/service/collective/alg/coll_alg_factory等文件的修改
变更类型
请选择本次引入的变更类型:
关联的Issue
NA
测试
未修改功能逻辑,故不涉及checker和真机用例验证
补充的UT用例:
1.Ut_GetCurLocalRank_When_RankNotInList_Expect_InternalError:增加GetCurLocalRank接口中当curLocalRank无效时返回HCCL_E_INTERNAL
2.Ut_GetSocketDescFromRankInfo_When_ListenPortInvalid_Expect_ParaError:GetSocketDescFromRankInfo 返回 HCCL_E_PARA,验证了 server 端监听端口非法时的错误返回路径
文档更新
NA
合入检查