已合并
Feat:add aclblasLtMatmulAlgo init/configSetAttr/configGetAttr func #248
Feat:add aclblasLtMatmulAlgo init/configSetAttr/configGetAttr func #248
已合并
wangzitao创建于 7月2日
wangzitao
wangzitao成员
7月2日

描述

  1. 新增接口:此 PR 主要为 aclBLASLt 库新增了 aclblasLtMatmulAlgoInit、aclblasLtMatmulAlgoConfigSetAttribute、aclblasLtMatmulAlgoConfigGetAttribute 三个接口函数,用于算法结构的初始化与配置属性的读写。同时新增了 aclblasLtMatmulDescInit 函数,提供调用者自行分配内存的 matmul 描述符初始化路径。为支持这些接口,头文件中引入了 aclblasLtMatmulTile、aclblasLtMatmulStages、aclblasLtReductionScheme、aclblasLtMatmulAlgoConfigAttributes 等枚举类型,并提取了 InitMatmulDescCapsule 公共函数,重构了原有的 aclblasLtMatmulDescCreate。

  2. blasLt目录重构

关联的Issue

#260

测试

bash build.sh --ops=blasLtMatmul,blasLtMatrixTransform --soc=ascend950 --run
image.png

文档更新

  1. blasLt/README.md
  2. blasLt/matrix_transform/README.md
  3. docs/zh/api_list.md

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wangzitao 的贡献)
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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/ops-blas xutianze, chenbinbin199309 (2/2) xutianze (1/1)

💡 Tip:

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

CLA Signature Pass

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

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

变更摘要

此 PR 主要为 aclBLASLt 库新增了 aclblasLtMatmulAlgoInitaclblasLtMatmulAlgoConfigSetAttributeaclblasLtMatmulAlgoConfigGetAttribute 三个接口函数,用于算法结构的初始化与配置属性的读写。同时新增了 aclblasLtMatmulDescInit 函数,提供调用者自行分配内存的 matmul 描述符初始化路径。为支持这些接口,头文件中引入了 aclblasLtMatmulTileaclblasLtMatmulStagesaclblasLtReductionSchemeaclblasLtMatmulAlgoConfigAttributes 等枚举类型,并提取了 InitMatmulDescCapsule 公共函数,重构了原有的 aclblasLtMatmulDescCreate

主要改动

  • 新增 aclblasLtMatmulAlgoInit 函数:根据 algoId、计算精度和数据类型组合初始化 aclblasLtMatmulAlgo_t 结构;algoId=0 使用默认的 128x128 配置,非零值通过 DecodeAlgoIdFields 穷举验证并解码为 policy / L1 tile / splitK 等字段。

  • 新增 aclblasLtMatmulAlgoConfigSetAttribute / GetAttribute 函数:支持对 ACLBLASLT_ALGO_CONFIG_TILE_IDSTAGES_IDSPLITK_NUMREDUCTION_SCHEMECUSTOM_OPTION 等属性的设置与查询;Set 操作会自动重新计算 algoId(通过 GenerateAlgoId),Get 操作支持仅查询所需缓冲区大小。

  • 新增 aclblasLtMatmulDescInit 函数:提供调用者分配的栈/自定义内存上初始化 matmul 描述符的能力,与 Create 不同,不需要调用 Destroy 释放内存;内部逻辑通过提取的 InitMatmulDescCapsule 复用。

  • 重构 aclblasLtMatmulDescCreate:抽取 InitMatmulDescCapsule 静态函数封装 magic、computeType、scaleType 的 memcpy 与 memset 逻辑,消除原有重复代码。

  • 新增辅助枚举和转换函数:引入 aclblasLtMatmulTile(4 种 L1 Tile 形状)、aclblasLtMatmulStages(1-4 级流水线)、aclblasLtReductionScheme(None/InPlace/Workspace)、aclblasLtMatmulAlgoConfigAttributes 等枚举;新增 TileIdToL1MN / L1MNToTileId / DecodeAlgoIdFields 等内部转换函数,以及 kTileTable 查找表。

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

代码审查

发现 4 个问题,均为中低优先级建议。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
wangzitaowangzitao成员
7月2日 修改了pull request 的描述
此处折叠了50条消息 查看更多
chenbinbin199309成员
7月9日 评论:

/lgtm

likedislike
xutianze
xutianze成员
7月9日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
7月9日 添加了label:lgtmapproved
CANN-robotCANN-robot成员
7月9日 关闭了关联的issue
CANN-robotCANN-robot成员
7月9日 合入了pull request