Merged
fix(blaze): 为 GM 到 L1 拷贝使用枚举类型的 L2 cache mode #548
fix(blaze): 为 GM 到 L1 拷贝使用枚举类型的 L2 cache mode #548
Merged
zhoushaolongAdd on Oct 22
zhoushaolong
zhoushaolongCollaborators
Oct 22

描述

修复 include/blaze/gemm/tile/arch35/copy_gm_to_l1.h 中 GM 到 L1 拷贝的 cache mode 参数类型,使调用显式匹配 asc_load_l2_cache_mode 接口。

  1. 两处 asc_copy_gm2l1_nd2nz 调用将 cache mode 显式转换为 asc_load_l2_cache_mode。
  2. CopyConcatGM2L1 的 NZ/ZN 权重对齐快速路径,将 src.engine().get_cache_mode() 的结果转换为该枚举,供后续 asc_copy_gm2l1_align 调用使用,替代原 uint8_t 局部变量。
  3. asc_copy_gm2l1_dn2nz 调用同样显式转换为枚举类型。

仅调整四处参数类型表达;cache mode 的来源、拷贝地址、尺寸、布局及步长不变,未新增算子功能或修改 tiling。

关联的Issue

关联 Issue #326:https://gitcode.com/cann/ops-tensor/issues/326

测试

已核对提交 49c814e2af9be656c2718c8e49f1847b1dc12b04 的完整 diff:仅一个头文件变更(+7/-4)。

本次未执行编译、UT、设备精度或性能测试,PR 未新增测试用例。不将其他提交或既有验证材料的结果作为本提交已验证的结论;仍需在目标 CANN 头文件环境下编译并回归相关 GM 到 L1 拷贝路径。

文档更新

本次未修改文档。

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for zhoushaolong's contribution.)
zhoushaolongzhoushaolongCollaborators
Oct 22 Created pull request, commit 19cf77b3
atomgit-bot
atomgit-bot
Oct 22 Comments:

变更摘要

本 PR 针对 Blaze GEMM 中 GM 到 L1 的拷贝路径,将 L2 cache 模式参数由原始整型/uint8_t 改为强类型的 asc_load_l2_cache_mode 枚举,使 asc_copy_gm2l1_nd2nz、asc_copy_gm2l1_dn2nz 等 DMA 拷贝接口的调用与底层签名保持一致。改动集中在 include/blaze/gemm/tile/arch35/copy_gm_to_l1.h,涉及 CopyConcatGM2L1 的 cache 模式获取及多处 arch35 平台下的拷贝调用。

主要改动

  • ND2NZ 拷贝接口参数类型化:在 arch35 平台的两处 asc_copy_gm2l1_nd2nz 调用中,将 cacheMode 由隐式整型传参改为 static_cast<asc_load_l2_cache_mode>(cacheMode),使 L2 cache 模式以明确枚举类型传入。
  • DN2NZ 拷贝接口参数类型化:asc_copy_gm2l1_dn2nz 调用同样改为先将 cacheMode 转换为 asc_load_l2_cache_mode 再传入,保持两类拷贝路径的 cache 模式处理一致。
  • 缓存模式取值类型收敛:在 CopyConcatGM2L1 中获取 cache 模式时,不再声明为 uint8_t,而是使用 auto 并直接 static_cast<asc_load_l2_cache_mode>(src.engine().get_cache_mode()),从源头统一为类型化枚举,避免后续调用处重复或隐式的类型转换。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Oct 22 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Oct 22 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Oct 22 Comments:

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
repo-cann/ops-tensor ✅ 宋恺, 商晓波 (2/2) ✅ 宋恺, 商晓波 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

zhoushaolong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
79 messages are collapsed here。 See more
sxb154714
sxb154714Collaborators
26 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
26 days ago Added label: lgtm
CANN-robot
CANN-robotCollaborators
26 days ago Comments:

The MR can not be merged, because of CodeReview discussion not resolved

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

likedislike
sxb154714sxb154714Collaborators
26 days ago Resolved final issue
CANN-robotCANN-robotCollaborators
26 days ago Merged pull request