已合并
fix: conv3d dx 1x1 bias kernelsplit #6943
hexinhui创建于 7月2日
fix: conv3d dx 1x1 bias kernelsplit #6943
已合并
hexinhui创建于 7月2日
hexinhui成员
7月2日

描述

库上当前Convtranspose带bias场景filterhw=1,stride=2场景性能较差, 实现对应场景的kernel拆分模板适配

关联的Issue

https://gitcode.com/cann/ops-nn/issues/5245

测试

泛化用例,冒烟测试通过

文档更新

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 hexinhui 的贡献)
Hhexinhui成员
7月2日 创建了 pull request,commit d84230f0
CANN-robotCANN-robot成员
7月2日 添加了label:stat/needs-squash
CANN-robotCANN-robot成员
7月2日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月2日 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
atomgit-bot
atomgit-bot
7月2日 评论:

变更摘要

此 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 == 1hasBias 为真时的处理分支,调用 InitMmadParamsCompute(设置 needComputeFlag_ = false)后提前返回,避免走原有后续逻辑,确保 1×1 + bias 场景的计算正确执行。

  • 1×1 + bias 场景的迭代控制调整: 在 IterateAllForKernelSplit 中修改了与 isKernel1x1 相关的条件判断——不再跳过 rearrangeHIndex_ != 0 的迭代(仅当无 bias 时跳过),且 GetTensorC 的调用条件也增加了 hasBias 的例外,保证 bias 场景下一次迭代中的数据装载行为正确。

  • 工作空间数据搬运支持可变 N 步长: 在 LoadL0c2GMForKernelSplitInnerLoadWorkSpaceDataToUbRearrange2GmForL0cToWorkSpace 等函数中引入了 useFixedHwStride / srcNStride 参数,当 wk == 1 && hk == 1 && hasBias 时使用固定的 hwStride 而非动态的 hwSize 作为 N 方向步长,保证 data 搬移和 UB/GM 重排时地址计算与 1×1 + bias 的实际数据布局一致。

  • ComputeForBias 使用运行时上下文尺寸: 将 LoadL0Zero 调用中引用的 baseM/baseNself->ctx.tiling_->baseM/baseN 改为 self->ctx.baseUseM_/baseUseN_,使 L0 清零范围与实际使用的 M/N 尺寸匹配,避免 kernel split 场景下清零范围不准确。

likedislike
不准确?
此处折叠了104条消息 查看更多
yuxin5成员
10 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:approved
CANN-robotCANN-robot成员
10 天前 关闭了关联的issue
CANN-robotCANN-robot成员
10 天前 合入了pull request
CANN-robot
CANN-robot成员
10 天前 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike