Pull Request已成功合入, 合并人@CANN-robot
(感谢 chenyifan 的贡献)变更摘要
本 PR 主要针对仓库内的同名头文件进行整改,围绕 ffn、mhc、posembedding 等模块将易重名的头文件重命名或按架构/用途拆分,并同步更新 #include 路径与 include guard;同时进行了大量无业务逻辑影响的代码格式整理(如构造初始化列表、__gm__ T * 指针写法、注释对齐、} // namespace 风格等)。
主要改动
ffn头文件去重命名: 将ffn.h重命名为ffn_kernel.h,并把ffn_antiquant.h、ffn_base.h、ffn_glu.h、ffn_quant.h、ffn_nonquant_nz.h等文件中的#include "ffn.h"统一改为#include "ffn_kernel.h",消除与其它ffn.h的重名。mhc按架构拆分重命名: 将mhc_post.h重命名为mhc_post_arch22.h/mhc_post_arch35.h,mhc_post_backward.h重命名为mhc_post_backward_arch22.h,mhc_sinkhorn.h重命名为mhc_sinkhorn_arch35.h,并更新mhc_post.cpp、mhc_post_apt.cpp、mhc_post_backward.cpp、mhc_sinkhorn_apt.cpp中的 include。posembeddingrotary 文件统一命名前缀: 将rotary_position_embedding_a_and_b.h、rotary_position_embedding_ab.h、rotary_position_embedding_aba_and_ba.h、rotary_position_embedding_bab.h重命名为inplace_partial_rotary_mul_*系列,并将apply_rotary_pos_emb_common.h重命名为inplace_partial_rotary_mul_arpe_common.h,同步更新 include guard 与引用。norm_rope_concat及 grad 的 host/kernel 头文件分离: 将norm_rope_concat_base.h拆分为norm_rope_concat_base_host.h与norm_rope_concat_base_kernel.h,norm_rope_concat_grad_base.h同理拆分,并将norm_rope_concat_grad.h重命名为norm_rope_concat_grad_kernel.h,更新各 host/kernel 文件的 include。rope_with_sin_cos_cache增加_arch35后缀: 将rope_with_sin_cos_cache_base.h、rope_with_sin_cos_cache_fp32.h、rope_with_sin_cos_cache_f_bf16.h分别重命名为rope_with_sin_cos_cache_base_arch35.h、rope_with_sin_cos_cache_fp32_arch35.h、rope_with_sin_cos_cache_f_bf16_arch35.h,并同步更新rope_with_sin_cos_cache_apt.cpp中的引用。


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
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 |
|---|---|---|
| ffn | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐 (1/1) |
| posembedding | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐 (1/1) |
| sig-ops-transformer | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
mutex_lock, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [0f29e65bcd4d4163985a3bf5889fb38a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-08-14 15:35:51] CI执行结束


流水线任务触发成功
任务链接 [12206a82922547059488c6fc75dee107][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ⚠️ WARNING | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_style | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_checkpr | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> |
[2026-08-14 15:21:06] CI执行结束


/lgtm
/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wang-minbo


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wang-minbo


/approve
/lgtm


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wang-minbo


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wang-minbo


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wang-minbo


描述
按仓内重名头文件规范,完成(
ffn/torch_extension/mhc/posembedding)整改,消除单仓内同名头冲突。原因:上述组件存在同名头文件,违反「单仓内原则上不允许重名头文件」;易导致 include 误解析、维护成本上升。
仓内分类规则
对每个重名头文件,先判断 内容是否相同、是否对外/包间头文件,再套用:
原则:除 1.4 外,单仓内原则上不允许重名头文件。
本 PR 实际用到:1.1、1.3、1.4(另:
aclnn_common.h为 build 产物与源码重复,不套用上表,忽略 build 路径)。决策一览
ffn.hop_api/ffn.h;op_kernel/ffn.h→ffn_kernel.haclnn_common.htorch_extension/build产物重复aclnn_rotary_position_embedding.hmhc_post.hop_api;内部 →mhc_post_arch22.h/mhc_post_arch35.hmhc_post_backward.hop_api;内部 →mhc_post_backward_arch22.hmhc_sinkhorn.hop_api;内部 →mhc_sinkhorn_arch35.hnorm_rope_concat_grad.hop_api;kernel →norm_rope_concat_grad_kernel.happly_rotary_pos_emb_common.hinplace_partial_rotary_mul_arpe_common.h(避免与已有inplace_partial_rotary_mul_common.h冲突)norm_rope_concat_base.h*_host.h/*_kernel.hnorm_rope_concat_grad_base.h*_host.h/*_kernel.hrope_with_sin_cos_cache_base.h*_arch35.h;root 保留rope_with_sin_cos_cache_f_bf16.h*_arch35.h;root 保留rope_with_sin_cos_cache_fp32.h*_arch35.h;root 保留rotary_position_embedding_a_and_b.hrotary_position_embedding侧;inplace →inplace_partial_rotary_mul_a_and_b.hrotary_position_embedding_ab.hinplace_partial_rotary_mul_ab.hrotary_position_embedding_aba_and_ba.hinplace_partial_rotary_mul_aba_and_ba.hrotary_position_embedding_bab.hinplace_partial_rotary_mul_bab.h改名映射(旧路径 → 新路径)
ffn/ffn/op_kernel/ffn.hffn/ffn/op_kernel/ffn_kernel.hmhc/mhc_post/op_kernel/arch22/mhc_post.hmhc/mhc_post/op_kernel/arch22/mhc_post_arch22.hmhc/mhc_post/op_kernel/arch35/mhc_post.hmhc/mhc_post/op_kernel/arch35/mhc_post_arch35.hmhc/mhc_post_backward/op_kernel/arch22/mhc_post_backward.hmhc/mhc_post_backward/op_kernel/arch22/mhc_post_backward_arch22.hmhc/mhc_sinkhorn/op_kernel/arch35/mhc_sinkhorn.hmhc/mhc_sinkhorn/op_kernel/arch35/mhc_sinkhorn_arch35.hposembedding/norm_rope_concat_grad/op_kernel/norm_rope_concat_grad.hposembedding/norm_rope_concat_grad/op_kernel/norm_rope_concat_grad_kernel.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/apply_rotary_pos_emb_common.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/inplace_partial_rotary_mul_arpe_common.hposembedding/norm_rope_concat/op_host/norm_rope_concat_base.hposembedding/norm_rope_concat/op_host/norm_rope_concat_base_host.hposembedding/norm_rope_concat/op_kernel/norm_rope_concat_base.hposembedding/norm_rope_concat/op_kernel/norm_rope_concat_base_kernel.hposembedding/norm_rope_concat_grad/op_host/norm_rope_concat_grad_base.hposembedding/norm_rope_concat_grad/op_host/norm_rope_concat_grad_base_host.hposembedding/norm_rope_concat_grad/op_kernel/norm_rope_concat_grad_base.hposembedding/norm_rope_concat_grad/op_kernel/norm_rope_concat_grad_base_kernel.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_base.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_base_arch35.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_f_bf16.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_f_bf16_arch35.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_fp32.hposembedding/rope_with_sin_cos_cache/op_kernel/arch35/rope_with_sin_cos_cache_fp32_arch35.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/rotary_position_embedding_a_and_b.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/inplace_partial_rotary_mul_a_and_b.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/rotary_position_embedding_ab.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/inplace_partial_rotary_mul_ab.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/rotary_position_embedding_aba_and_ba.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/inplace_partial_rotary_mul_aba_and_ba.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/rotary_position_embedding_bab.hposembedding/inplace_partial_rotary_mul/op_kernel/arch35/inplace_partial_rotary_mul_bab.h范围汇总
aclnn_common.h、aclnn_rotary_position_embedding.h)ffn、mhc、posembedding(torch_extension仅判定不改)关联的Issue
测试
文档更新
类型标签