Pull Request已成功合入, 合并人@CANN-robot
(感谢 hexinhui 的贡献)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 |
|---|---|---|
| conv | ✅ 余鑫, 高成, 沈承宗, 林睿涵 (4/2) | ✅ 余鑫 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
hexinhui, thanks for your pull request. All authors of the commits have signed the CLA. 👍


变更摘要
此 PR 修复了 conv3d_backprop_input_v2 算子在 kernel 为 1×1 且存在 bias 时 kernel split 功能被禁用或运行不正确的问题。主要思路是:移除先前对 1×1 kernel + bias 场景禁用 kernel split 的限制,同时在 tiling 校验、迭代逻辑、数据搬运和输出重排等路径中增加对 1×1 kernel + bias 组合的特殊处理,确保 L1 空间预算计算和数据布局与实际计算模式一致。
主要改动
-
移除 1×1 kernel split 对 bias 的禁用: 在
Conv3DDXV2KernelSplitTiling::CheckKernelSplitHW11Enable中删除了hasBiasFlag_时直接返回false的逻辑,允许 bias 场景也使用 1×1 kernel split。同时将IsL1ParamsValid中 bias/scale 的 L1 空间校验从IsSocVersionFuse条件分支中提升为通用逻辑,不再限定于特定 SoC 版本。 -
1×1 kernel bias 迭代计算路径: 在
ProcessKernelSplitIteration中新增了当hk == 1且hasBias为真时的处理分支,调用InitMmadParams和Compute(设置needComputeFlag_ = false)后提前返回,避免走原有后续逻辑,确保 1×1 + bias 场景的计算正确执行。 -
1×1 + bias 场景的迭代控制调整: 在
IterateAllForKernelSplit中修改了与isKernel1x1相关的条件判断——不再跳过rearrangeHIndex_ != 0的迭代(仅当无 bias 时跳过),且GetTensorC的调用条件也增加了hasBias的例外,保证 bias 场景下一次迭代中的数据装载行为正确。 -
工作空间数据搬运支持可变 N 步长: 在
LoadL0c2GMForKernelSplitInner、LoadWorkSpaceDataToUb、Rearrange2GmForL0cToWorkSpace等函数中引入了useFixedHwStride/srcNStride参数,当wk == 1 && hk == 1 && hasBias时使用固定的hwStride而非动态的hwSize作为 N 方向步长,保证 data 搬移和 UB/GM 重排时地址计算与 1×1 + bias 的实际数据布局一致。 -
ComputeForBias使用运行时上下文尺寸: 将LoadL0Zero调用中引用的baseM/baseN从self->ctx.tiling_->baseM/baseN改为self->ctx.baseUseM_/baseUseN_,使 L0 清零范围与实际使用的 M/N 尺寸匹配,避免 kernel split 场景下清零范围不准确。


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
库上当前Convtranspose带bias场景filterhw=1,stride=2场景性能较差, 实现对应场景的kernel拆分模板适配
关联的Issue
https://gitcode.com/cann/ops-nn/issues/5245
测试
泛化用例,冒烟测试通过
文档更新
类型标签
AI/Agent生成声明