Pull Request已成功合入, 合并人@CANN-robot
(感谢 wuao 的贡献)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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| index | ✅ chenqi317, zhou-qilong (2/2) | ✅ chenqi317, zhou-qilong (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wow5523, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🔵 source code change are detected, tasks labels is removed in this pull request!


流水线任务触发成功
任务链接 [72dc328130ff42588fc473e8b4db6ac5][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 解析CI分支 | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| 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 | >>>>> | >>>>> |
| API_Check | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-03-19 17:44:52] CI执行结束


问题/功能描述
本次PR修复了repeat_interleave_grad算子反向传播计算中的一个边界条件缺陷。原实现中,当重复因子r为0时,算子未对输出梯度进行显式初始化,可能导致输出梯度数据未定义(包含脏数据),从而影响模型训练的正确性。本次修改旨在完善算子的鲁棒性,确保在r=0时能输出正确的零梯度。
修改方案描述
修改在RepeatInterleaveGradDimNOneDavid类中实现。核心是在ProcessRepeatBlock函数中新增了对r == 0的特殊处理分支。该分支会调用新增的ProcessZeroR函数,该函数使用值为0.0的常量INIT_FLOAT_VALUE,通过Duplicate操作将计算缓冲区初始化为0,再通过CopyOut将结果写回全局内存的输出位置,并正确同步MTE3_V事件以保证数据一致性,从而确保对应输出梯度区域被正确填充为0。


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: chenqi317, zhou-qilong.
Reviewers who wrote a comment of /lgtm are: zhou-qilong, chenqi317.


描述
repeat_interleave_grad算子,当repeat轴中存在0时,实际应该输出0,但是当前代码跳过了0,没有处理,导致精度失败。
修改:在kernel侧判断,当repeat轴出现0时,增加特殊处理的分支,直接搬出0.0到gm上。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/1383
测试
执行repeat轴中存在0的repeat_interleave_grad 的单算子用例。
文档更新
类型标签