Pull Request已成功合入, 合并人@CANN-robot
(感谢 chenyifeng 的贡献)变更摘要
本 PR 修复 Gru 算子在 rnn/gru/op_host/gru_tiling.cpp 的 GruTilingOp::GetVectorTiling() 中计算 gruParams_.baseN 时的对齐问题,并同步整改相关代码。原逻辑直接比较 singleCoreN 与 partUb 取较小值,未考虑按数据类型换算的块大小对齐,可能引发算子执行报错;修改后引入按 BLOCK_SIZE / gruParams_.dataType 计算的 calBlockSize,对 partUb 向下对齐、对 singleCoreN 通过 Ops::Base::CeilDiv 向上对齐后再取较小值,保证分块结果满足对齐约束。
主要改动
- 新增按数据类型换算的块大小:新增
calBlockSize = BLOCK_SIZE / gruParams_.dataType,使对齐粒度随dataType(如 fp16/fp32)变化,而非固定使用 32。 partUb向下对齐:将partUb按calBlockSize向下取整对齐(partUb / calBlockSize * calBlockSize),避免分块后出现非对齐边界。singleCoreN向上对齐后参与比较:用Ops::Base::CeilDiv(gruParams_.singleCoreN, calBlockSize) * calBlockSize得到对齐后的singleCoreNAlign,再与partUb取较小值赋给gruParams_.baseN,修复原逻辑中未对齐导致的执行报错。


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 |
|---|---|---|
| rnn | ✅ 刘闯, 杨阳 (2/2) | ✅ 刘闯 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


流水线任务触发成功
任务链接 [6b0886dfbf794c0c87eeeda47c43fbe1][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-08-31 15:24:36] CI执行结束


流水线任务触发成功
任务链接 [4a2fcb6fa06d4f60b6b1e6c6303b396e][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| StaticCheck_md | ✅ SUCCESS |
[2026-08-31 15:12:45] CI执行结束


/approve


/lgtm
/approve


描述
修复GRU算子执行报错507015的问题,通过对其baseN,解决UB越界报错。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/5403
测试
本地自验证200case没问题,问题case验证通过
文档更新
类型标签
AI/Agent生成声明