已合并
Add Ascend950 SYRK block/kernel implementation #1194
void_ptr创建于 11 天前
Add Ascend950 SYRK block/kernel implementation #1194
已合并
void_ptr创建于 11 天前
void_ptr
11 天前

描述

  • Introduced BlockMmadSyrkTla for efficient computation of Y = X * X^T with fixed layout and dispatch policies.
  • Added kernel-level BasicSyrkTla to handle scheduling and execution of SYRK operations.
  • Updated block_mmad.hpp to include the new SYRK implementation.
  • Enhanced CopyL0CToGmTla to support storing transposed results in a ColumnMajor format.

关联的Issue

https://gitcode.com/cann/catlass/issues/489

原因

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 void_ptr 的贡献)
Vvoid_ptr
11 天前 创建了 pull request,commit 7cab3d5c
atomgit-bot
atomgit-bot
11 天前 评论:

变更摘要

本 PR 为 Ascend950 新增了块级与内核级的 SYRK 实现(Y = X * X^T),仅支持下三角计算。块级新增 BlockMmadSyrkTla,其布局标签由算子约定固定(X 为 RowMajor [M, K]Xt 为 ColumnMajor [K, M] 的同一 GM 缓冲转置视图、Y 为 RowMajor [M, M]),派发策略固定为 MmadPingpong<Ascend950, false>(关闭 unitFlag、HF32 与 L1-resident),并采用双写策略:对角块通过 nz2nd 写一次,下三角块通过 nz2ndnz2dn(转置)各写一次,L0C→GM 的同步统一使用 M_FIX。内核级新增 BasicSyrkTla,按调度规则仅处理下三角块(m < n 跳过、m == n 计算并写一次、m > n 计算并双写),并在 copy_l0c_to_gm.hpp 中为 CopyL0CToGmTla 增加 ColumnMajor 目标布局(nz2dn)的特化以支撑双写。改动为纯新增,未删除任何既有代码。

主要改动

  • 新增块级 SYRK 实现 BlockMmadSyrkTla:在 include/catlass/gemm/block/block_mmad_syrk_tla.hpp 中新增约 390 行,实现 Y = X * X^T 的 L1→L0→mmad→L0C 流水与双 GM 写回(对角块 nz2nd 写一次,非对角块 nz2nd + nz2dn 双写),并通过 static_assert 固定布局标签、Ascend950-only、关闭 unitFlag/HF32/L1-resident 等约束。
  • 新增内核级 SYRK 调度 BasicSyrkTla:在 include/catlass/gemm/kernel/basic_syrk_tla.hpp 中新增约 192 行,提供 Params/Arguments/ToUnderlyingArguments 接口,按块坐标执行"下三角跳过、对角单写、下三角双写"的调度规则,并限定 CanImplement 要求 M == N
  • 扩展 CopyL0CToGmTla 支持 ColumnMajor 目标(nz2dn):在 include/catlass/gemm/tile/ascend950/copy_l0c_to_gm.hpp 中为 Ascend950 新增 LayoutDst_ 为 ColumnMajor 的特化,构造 FixpipeParamsC310<COLUMN_MAJOR> 并调用 AscendC::Fixpipe 以支持 SYRK 双写的转置落盘。
  • 注册新块级头文件:在 include/catlass/gemm/block/block_mmad.hpp 的条件编译块中新增 #include "catlass/gemm/block/block_mmad_syrk_tla.hpp",使新实现随 BlockPrologue 一起编译。
likedislike
不准确?
atomgit-bot
atomgit-bot
11 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/no
CANN-robot
CANN-robot成员
11 天前 评论:

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/catlass 黄鑫, longjihui (2/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

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

likedislike
此处折叠了85条消息 查看更多
yuantaoyuantao成员
10 天前 删除了label:RDV-RUNNING
longjihui
longjihui成员
10 天前 评论:

/lgtm

likedislike
huangxin361成员
8 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
8 天前 合入了pull request