Pull Request has been successfully merged by CANN-robot.
(Thank you for Yuan Bin's contribution.)变更摘要
本 PR 修复了 posembedding/inplace_partial_rotary_mul 模块中 inplacePartialRotaryMul 算子部分 special 路径用例精度失效的问题。问题根因是在 special 路径调用 Mul 时,repeatTimes 入参(由 numHead 决定)超过接口限制而被截断,导致计算结果不完整。修复方式是在调用 Mul 时,当 numHead 超过 MAX_MUL_REPEAT_TIME 时不再一次性调用,而是展开循环按段处理,直到处理完所有 head。
主要改动
Mul调用改为分段循环: 在InplacePartialRotaryMulABA<T, isBrc>::ComputeMul的非 brc elewise 乘路径中,将原本单次Mul(dtsUb[...], src0Ub[...], ..., mask, numHead, repeatParams_)调用替换为以done为游标的for循环,按段累加直到覆盖全部numHead。- 单次 repeatTimes 上限约束: 每段通过
remaining > MAX_MUL_REPEAT_TIME ? MAX_MUL_REPEAT_TIME : remaining计算repeats并转换为uint8_t,确保传入Mul的repeatTimes不超过接口允许的最大值,避免截断。 - 分段偏移量调整: 每次
Mul的dtsUb与src0Ub地址按done * mask递增偏移,使各段落在正确的数据区间,保证分段处理与整体处理等价。


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 |
|---|---|---|
| 9.2.0 | ✅ gcw_kUomxQ2l, kdy18482276080 (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
aaaakai, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


流水线分析报告 — ops-transformer run#9125
流水线: https://gitcode.com/CANN/ops-transformer/actions/runs/ad258c65b5554ecea021e193edbd6171 | PR#13047 | 2026-09-28 10:43:25 ~ 2026-09-28 10:48:14 | 失败 Job 1 个
定界结论: 代码问题 / 代码检查错误 — clang-format 格式化不通过
- 失败类型: 代码问题
- 根因:
CodeCheck_precommitJob 中 pre-commit 的 clang-format 检查失败, 文件posembedding/inplace_partial_rotary_mul/op_kernel/inplace_partial_rotary_mul.h未按 clang-format 规范格式化(hook 自动修改了该文件) - 处置建议: PR 提交者在本地执行
pre-commit run clang-format --all-files(或直接对上述文件执行 clang-format) 修复格式后重新推送- 参考链接: 本地执行 pre-commit 指导
- 排除项: 其余检查项(merge conflicts / private key / codespell / duplicate-header 等)均 Passed 或 Skipped, 无环境或平台类错误
失败根因分析
根因 #1: 代码问题 / 代码检查错误 — clang-format 格式化不通过
- 判据: pre-commit 检查项 clang-format Failed, files were modified by this hook
- 定位步骤:
3_precommit.log - 影响 Job: CodeCheck_precommit
- 根因证据(日志原文):
[2026-09-28 10:46:53.746+08:00] clang-format.............................................................Failed
[2026-09-28 10:46:53.747+08:00] - hook id: clang-format
[2026-09-28 10:46:53.748+08:00] - files were modified by this hook
[2026-09-28 10:46:53.750+08:00] Formatting [1/1] posembedding/inplace_partial_rotary_mul/op_kernel/inplace_partial_rotary_mul.h
由门禁失败定界分析自动生成 | repo: ops-transformer | run: ad258c65b5554ecea021e193edbd6171 | PR#13047


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm
/approve


/approve


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


描述
调用入参截断导致了inplacePartialRotaryMul算子的部分special路径的用例精度失效。
解决方法
在special路径调用Mul时针对repeatTime参数超过接口限制时展开循环逐段处理。
关联的Issue
https://gitcode.com/cann/ops-transformer/issues/5722
测试
通过了本地白盒泛化测试。
文档更新
类型标签