Pull Request已成功合入, 合并人@CANN-robot
(感谢 wangzitao 的贡献)变更摘要
此 PR 旨在解耦 blasLt MXFP8/MXFP4 内核与 adv_api/matmul/matmul.h 高层级 AscendC API 头文件的依赖。通过在 blasLt/matmul/common/ 下新增一个自包含的 aux_get_c0_size.h 头文件,将 AscendC::AuxGetC0Size 的本地实现提供给内核使用,避免在 Blaze 内核实现中引入高层次 API,从而降低编译依赖并提升代码独立性。两个内核文件(matmul_mxfp4_kernel.cpp 和 matmul_mxfp8_kernel.cpp)的 #include 头文件引用也相应替换。
主要改动
- 新增
aux_get_c0_size.h本地实现:在blasLt/matmul/common/aux_get_c0_size.h中提供AscendC::AuxGetC0Size<SrcT>()模板函数的本地版本,根据数据类型(float、int8_t、int4b_t及各类 fp8/fp4 类型)和 NPU 架构(__NPU_ARCH__)返回对应的 C0 大小常量,替代原先依赖的adv_api/matmul/matmul.h。 - 替换
matmul_mxfp4_kernel.cpp的头文件引用:将#include "adv_api/matmul/matmul.h"替换为#include "aux_get_c0_size.h",使 MXFP4 内核不再依赖高层级 matmul API 头文件。 - 替换
matmul_mxfp8_kernel.cpp的头文件引用:将#include "adv_api/matmul/matmul.h"替换为#include "aux_get_c0_size.h",使 MXFP8 内核不再依赖高层级 matmul API 头文件。


代码审查
审查总结
本次 diff 共涉及 3 个文件:
| 文件 | 审查结果 |
|---|---|
blasLt/matmul/common/aux_get_c0_size.h |
发现 1 个问题(P2) |
blasLt/matmul/mxfp4/arch35/matmul_mxfp4_kernel.cpp |
无问题(仅 include 替换) |
blasLt/matmul/mxfp8/arch35/matmul_mxfp8_kernel.cpp |
无问题(仅 include 替换) |
- P0: 0
- P1: 0
- P2: 1 —
aux_get_c0_size.h中#else分支(非 3510 架构路径)缺少对uint8_t的类型匹配,会导致返回错误的 C0 size(16 而非 32),影响 tiling 参数正确性。 - P3: 0
整体风险判断:低风险。核心架构(3510)路径的类型匹配是正确的;问题仅存在于非 3510 架构的兜底分支中,触发概率取决于该 header 是否被非 3510 架构的 kernel 以 uint8_t 模板参数引用。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


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 (2/2) | ✅ 宋恺 (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. 👍


compile


流水线任务触发成功
任务链接 [f94d86fc95664ea986b081afd2030a6c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_A2 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A2 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A2_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A2_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| precommit | ⚠️ WARNING | >>>>> | >>>>> |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-07-10 10:19:01] CI执行结束


/lgtm


/lgtm
/approve


描述
此 PR 旨在解耦 blasLt MXFP8/MXFP4 内核与 adv_api/matmul/matmul.h 高层级 AscendC API 头文件的依赖。通过在 blasLt/matmul/common/ 下新增一个自包含的 aux_get_c0_size.h 头文件,将 AscendC::AuxGetC0Size 的本地实现提供给内核使用,避免在 Blaze 内核实现中引入高层次 API,从而降低编译依赖并提升代码独立性。两个内核文件(matmul_mxfp4_kernel.cpp 和 matmul_mxfp8_kernel.cpp)的 #include 头文件引用也相应替换。
主要改动
关联的Issue
关联Issue #305
测试
文档更新
NA
类型标签