Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈永康's contribution.)变更摘要
该 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类)。


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


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.


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.


描述
本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生成声明