已关闭
Fix CleanCode #11170
yayahello创建于 9月3日关闭于 9月4日
Fix CleanCode #11170
已关闭
yayahello创建于 9月3日关闭于 9月4日
yayahello成员
9月3日

描述

关联的Issue

测试

文档更新

类型标签

likedislike
当前Pull Request已关闭, 关闭人@yayahello
Yyayahello成员
9月3日 创建了 pull request,commit 87cfa3d4
atomgit-bot
atomgit-bot
9月3日 评论:

变更摘要

该 PR(标题 "Fix CleanCode")针对 mc2 目录下 MoE 分布式通信相关算子的 op_api 实现进行代码清理:为仅做空指针校验、实际不修改的 tensor 指针参数补充 const 限定符,移除 CheckParams 中未被使用的参数并同步更新调用处,同时对长表达式和函数签名做格式化整理,不涉及业务逻辑与对外行为变更。

主要改动

  • 补充 const 限定符: 在 aclnn_moe_ep_dispatch.cpp、aclnn_moe_ep_dispatch_epilogue.cpp、aclnn_moe_ep_combine_epilogue.cpp 的 CheckNotNull 中,为 combinedX、recvX、recvSrcMetadata、recvTopkWeights、recvScales、numRecvTokensPerRank、numRecvTokensPerExpert、dstBufferSlotIdx、routeCount、routeDstScaleout、routeScaleoutSlot 等仅被校验是否为空、不被写入的形参加上 const,使校验函数语义更清晰。
  • 移除未使用参数: 删除 aclnn_moe_distribute_dispatch_teardown.cpp 中 CheckParams 的 expertShardType、sharedExpertRankNum、moeExpertNum、globalBs 形参,以及 aclnn_moe_ep_dispatch.cpp 中 CheckParams 的 expertAlignment 形参,并同步简化 aclnnMoeDistributeDispatchTeardownGetWorkspaceSize、aclnnMoeEpDispatchGetWorkspaceSize 等处的调用。
  • 代码格式化整理: 对 aclnn_moe_ep_dispatch.cpp 与 aclnn_moe_ep_dispatch_epilogue.cpp 中较长的函数签名、anyCachedRoute/allCachedRoute/hybridCachedMode 布尔表达式及调用语句按多行风格重排,属于纯排版调整,不影响编译结果与运行时行为。
likedislike
不准确?
CANN-robotCANN-robot成员
9月3日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9月3日 评论:

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

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
*/*/op_api/aclnn*.h ❌ (0/2)(You can also ask: tgwsakiko_, wang-minbo, 王永光, 刘丹, 汤磊) ❌ (0/1)(You can also ask: 汤磊, 王永光)
mc2 ❌ (0/2)(You can also ask: 黄俊健, captainmiaow, libohao6, 俞郑中, yangzeheng) ❌ (0/1)(You can also ask: captainmiaow, liuboxi, chenjunjian11, 刘丹, wang-minbo)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

yayahello, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robot
CANN-robot成员
9月3日 评论:

CLA Signature Pass

yayahello, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
9月3日 将captainmiaow,monologue815,jiang-lirui,Allan_Yu,wang-minbo,tgwsakiko_,liudan12,chenjunjian11,yangzeheng,liuboxi,luobaiqing,libohao6,mabing1118,macech设为评审人
此处折叠了33条事件消息 查看更多
Yyayahello成员
9月4日 关闭了 pull request