已合并
gemm blaze模板 TT量化场景支持StreamK性能优化 #142
chen-shuai创建于 7月13日
gemm blaze模板 TT量化场景支持StreamK性能优化 #142
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 chen-shuai 的贡献)7月13日 添加了label:cann-cla/yes
CANN-robot
7月13日 评论:
7月13日 评论:
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-tensor | ✅ 陈康, 杨阳 (2/2) | ✅ 杨阳, 陈康 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chen-shuai, thanks for your pull request. All authors of the commits have signed the CLA. 👍


7月15日 推送 1 个提交:4201861e-fix
此处折叠了333条消息 查看更多
yangyang016
8月6日 评论:
8月6日 评论:
/lgtm
/approve


8月6日 添加了label:lgtm
CANN-robot
8月6日 评论:
8月6日 评论:
The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


8月6日 合入了pull request
描述
本 PR 在 Blaze TensorApi 中新增 QuantBatchMatmulV3 非 per-tensor 量化场景的 StreamK Device 实现,与 ops-nn Host Tiling 配合,在 M/N 较小、K 较大的场景下通过切分 K 维提高核利用率。
配套 Host PR:
https://gitcode.com/cann/ops-nn/pull/7449
整体流程
Device 侧按照以下模块组织:
Policy
新增
KernelQbmmPertensorMultiBlockStreamK调度类型,并为MatmulWithScaleFixpipeQuant增加可配置的ScheduleType。通过独立 ScheduleType 将普通 Fixpipe QBMM、MX StreamK 和 per-tensor StreamK 的模板实例区分开,防止 Kernel、MMAD 和 Epilogue 发生错误组合。
Kernel
新增
kernel_qbmm_pertensor_streamk.h,实现 QBMM per-tensor StreamK 对应的GemmUniversal特化。Kernel 主要完成:
BlockScheduler
直接复用已有
BlockSchedulerMatmulStreamK,不修改原有 StreamK 切块策略。Scheduler 负责:
BlockMmad
扩展
block_mmad_a8w8_fixpipe_quant.h,使已有 QBMM BlockMmad 支持 per-tensor StreamK ScheduleType。主要修改包括:
int32 bias,以及 FP8 整数编码 scale 对应的 fp32 bias,在 MMAD 累加域处理。
BlockEpilogue
新增
block_epilogue_qbmm_pertensor_streamk.h,实现专用 AIV 后处理:反量化全部在 UB 上由 Vector 完成,不使用 Fixpipe 随路反量化处理 StreamK partial。
Scale 和 Bias 顺序
支持两类 bias 处理顺序:
对于反量化后 bias,Host Tiling 仅允许全 StreamK 调度,确保所有输出 tile 都经过 AIV Epilogue。
关联的Issue
https://gitcode.com/cann/ops-tensor/issues/136
测试
已有用例的精度和性能
文档更新
docs/API/README.md
docs/API/epilogue/README.md
docs/API/epilogue/block/block_epilogue_qbmm_pertensor_streamk.md
docs/API/gemm/block/README.md
docs/API/gemm/block/block_mmad_a8w8_fixpipe_quant.md
docs/API/gemm/kernel/README.md
docs/API/gemm/kernel/kernel_qbmm_pertensor_streamk.md
类型标签