Pull Request已成功合入, 合并人@CANN-robot
(感谢 wangzitao 的贡献)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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


变更摘要
此 PR 主要为 aclBLASLt 库新增了 aclblasLtMatmulAlgoInit、aclblasLtMatmulAlgoConfigSetAttribute、aclblasLtMatmulAlgoConfigGetAttribute 三个接口函数,用于算法结构的初始化与配置属性的读写。同时新增了 aclblasLtMatmulDescInit 函数,提供调用者自行分配内存的 matmul 描述符初始化路径。为支持这些接口,头文件中引入了 aclblasLtMatmulTile、aclblasLtMatmulStages、aclblasLtReductionScheme、aclblasLtMatmulAlgoConfigAttributes 等枚举类型,并提取了 InitMatmulDescCapsule 公共函数,重构了原有的 aclblasLtMatmulDescCreate。
主要改动
-
新增
aclblasLtMatmulAlgoInit函数:根据algoId、计算精度和数据类型组合初始化aclblasLtMatmulAlgo_t结构;algoId=0使用默认的 128x128 配置,非零值通过DecodeAlgoIdFields穷举验证并解码为 policy / L1 tile / splitK 等字段。 -
新增
aclblasLtMatmulAlgoConfigSetAttribute/GetAttribute函数:支持对ACLBLASLT_ALGO_CONFIG_TILE_ID、STAGES_ID、SPLITK_NUM、REDUCTION_SCHEME、CUSTOM_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查找表。


/lgtm


/approve


描述
新增接口:此 PR 主要为 aclBLASLt 库新增了 aclblasLtMatmulAlgoInit、aclblasLtMatmulAlgoConfigSetAttribute、aclblasLtMatmulAlgoConfigGetAttribute 三个接口函数,用于算法结构的初始化与配置属性的读写。同时新增了 aclblasLtMatmulDescInit 函数,提供调用者自行分配内存的 matmul 描述符初始化路径。为支持这些接口,头文件中引入了 aclblasLtMatmulTile、aclblasLtMatmulStages、aclblasLtReductionScheme、aclblasLtMatmulAlgoConfigAttributes 等枚举类型,并提取了 InitMatmulDescCapsule 公共函数,重构了原有的 aclblasLtMatmulDescCreate。
blasLt目录重构
关联的Issue
#260
测试
bash build.sh --ops=blasLtMatmul,blasLtMatrixTransform --soc=ascend950 --run

文档更新
类型标签