已合并
pre-commit修复posembedding、mhc、ffn等目录.h/.hpp历史格式问题 #11021
pre-commit修复posembedding、mhc、ffn等目录.h/.hpp历史格式问题 #11021
已合并
景明创建于 9 天前
景明
景明成员
9 天前

关联的Issue

关联Issue https://gitcode.com/cann/ops-transformer/issues/4850

描述

对仓内算子源码提前做 pre-commit 历史格式问题清理,为后续功能改动(如 Regbase API 替换等)扫清钩子障碍,避免后续 PR 因格式问题被大面积格式化污染 diff。

处理方式:find <目录> -type f \( -name '*.h' -o -name '*.hpp' \) | xargs pre-commit run --files,多轮执行直到所有 hook 收敛(无 Failed / 无自动修复)。

修复内容(仅格式,不改任何代码语义):

  • 尾随空白(trailing whitespace)
  • 文件末尾换行(end of file)
  • clang-format 代码重排(换行、缩进、对齐,遵循仓内 .clang-format)

排除范围(不做格式化)

  • *_def.cpp 算子定义文件(排版由开发者自行维护,另见 PR #11041)
  • */op_api/aclnn*.h*/op_graph/*_proto.h*/op_host/op_api/aclnn*.h 接口/原型头文件(排版由开发者自行维护)
  • mamba/ 目录(该目录 causal_conv1d 算子 UT 上游基线存在失败,见 Issue #4840,本批不涉及)
  • examples/experimental/ 目录

PR 拆分说明

全仓 .h/.hpp 清理共 2362 个文件,按场景目录拆分为 6 个 PR(分支不同、内容互不重叠,可独立 review 合入):

PR 分支 范围
#4878 compile attention 第1批(按算子字母序前段)
#10422 graph attention 第2批(按算子字母序中段)
#9331 test attention 第3批(按算子字母序后段)
#10991 fix mc2
#11020 fix_2 moe、gmm
#11021 fix_3 posembedding、mhc、ffn、common、tests、torch_extension

测试

  • 纯格式化改动:不改变任何代码语义,逐文件 diff 均为空白/换行/clang-format 重排
  • pre-commit 全量 hook 收敛验证:多轮执行后 trailing-whitespace / end-of-file-fixer / clang-format 均 Passed
  • 建议合入前对相关算子做一次编译验证
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 景明 的贡献)
景明景明成员
9 天前 创建了 pull request,commit b1439227
atomgit-bot
atomgit-bot
9 天前 评论:

🤖 正在生成合并请求摘要,请稍候…

likedislike
不准确?
CANN-robotCANN-robot成员
9 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9 天前 评论:

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
common 蒋礼锐, wang-minbo, 马兵 (3/2) 蒋礼锐, wang-minbo, 马兵 (3/1)
ffn 蒋礼锐, 马兵 (2/2) 蒋礼锐, 马兵 (2/1)
mhc 马兵, wangxun21, 蒋礼锐 (3/2) wangxun21 (1/1)
posembedding 蒋礼锐, wangxun21, 马兵 (3/2) 马兵, 蒋礼锐, wangxun21 (3/1)
sig-ops-transformer 马兵, 蒋礼锐 (2/2) 马兵, 蒋礼锐 (2/1)
tests wang-minbo, 马兵, 蒋礼锐 (3/2) wang-minbo, 马兵, 蒋礼锐 (3/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
9 天前 将hz36amy_00,juyangokok,monologue815,chaotang233,xuanyuandy,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,wang-minbo,tang-lei01,xtqh,songkai111,liudan12,luwei_1104,cc-z,gaoxiang618,mabing1118,wangyongguang,yuhao_,wangxun21设为评审人
此处折叠了56条消息 查看更多
wangxun21成员
8 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:approved
mabing成员
8 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:lgtm
CANN-robotCANN-robot成员
8 天前 合入了pull request