Merged
QuantMatmul伪量化TCGA8W4算子迁移blaze框架 #9840
QuantMatmul伪量化TCGA8W4算子迁移blaze框架 #9840
Merged
陈永康Add on Sep 3
陈永康
Sep 3

描述

本PR完成了QuantBatchMatmulV4伪量化TCG A8W4算子从CMCT迁移到blaze框架的实现,并移除了cmct相关代码
该pr解决了A8W4的pergroup没有校验x2_scale和out_dtype一致性校验

关联的Issue

https://gitcode.com/cann/ops-tensor/issues/254
#3374
#3373

测试

本地tiling UT验证,白盒、泛化、二级冒烟, 泛化/门槛用例全部通过

文档更新

不涉及

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈永康's contribution.)
陈永康陈永康
Sep 3 Created pull request, commit 2874db8c
atomgit-bot
atomgit-bot
Sep 3 Comments:

变更摘要

该 PR 是对 matmul/quant_batch_matmul_v4(arch35 版本)的一次大规模代码迁移与清理:将原属于 QuantBatchMatmulV4 命名空间下的 per-channel 量化批矩阵乘内核实现整体删除,并改为复用 blaze/gemm 路径下的通用实现(kernel_qbmm_v4_pergroup.h)。整体以删除为主(约 2921 行删除、8 行新增),未新增业务逻辑,主要目的是消除重复代码、统一实现路径。

主要改动

  • 切换内核头文件引用: 在 quant_batch_matmul_v4.cpp 中,将原有的本地头文件 quant_batch_matmul_v4_perchannel.h 替换为 blaze/gemm/kernel/kernel_qbmm_v4_pergroup.h,使 per-group/per-channel 场景改走 blaze 的通用内核实现。
  • 删除入口分发函数: 移除 quant_batch_matmul_v4.cpp 中 QuantBatchMatmulV4::Arch35 命名空间下的模板分发入口 InvokeWeightQuantBmmOpImpl(原负责初始化 TemplateClass 并调用 op.Init/op.Process)。
  • 删除 per-channel 内核实现: 删除 quant_batch_matmul_v4_perchannel.h(QuantBatchMatmulV4PerChannelKernel,含 GetAL1/GetBL1/IterateMatmul/Process 等)及其公共基类 quant_batch_matmul_v4_reg_base_common.h(QuantBatchMatmulV4RegBaseCommonKernel,约 1617 行,涵盖 L1/UB buffer 布局、BL1ProcessNK/BL1ProcessKN 搬运及 AntiQuantCompute 反量化逻辑)。
  • 删除配套辅助文件: 删除向量化反量化函数文件 quant_batch_matmul_v4_vf.h(含 AntiquantW4Pergroup32NK、ParamsGroupSize32 等)、常量定义文件 quant_batch_matmul_v4_constant.h(含 QuantType 枚举及各类掩码/对齐常量),以及通用工具 tool.h(含 SyncProcessor、DataCopyPad2D 等工具)和 matmul_custom_impl.h(MatmulCustomImpl 类)。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 3 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 3 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 3 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
cmake ✅ 杨阳, 商晓波 (2/2) ✅ 杨阳 (1/1)
matmul ✅ 徐炳麟, 商晓波, 杨阳 (3/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

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

likedislike
466 messages are collapsed here。 See more
CANN-robot
CANN-robotCollaborators
Oct 12 Comments:

The following label is not ready.

ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.

likedislike
CANN-robot
CANN-robotCollaborators
Oct 12 Comments:

The following label is not ready.

ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.

likedislike
renzetaorenzetaoCollaborators
Oct 12 Associated issue: [Requirement|需求建议]: Matmul Q3 功能支持规划
renzetaorenzetaoCollaborators
Oct 12 Modify description of pull request
renzetaorenzetaoCollaborators
Oct 12 Modify description of pull request