Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhoushaolong 的贡献)变更摘要
本 PR 针对 gmmaq(grouped matmul activation quant)算子做性能优化,核心改动位于 GroupedMatmulActivationQuantTiling950::DoLibApiTiling()(文件 grouped_matmul_activation_quant_tiling.cpp)。改动在 M 分块计算完成后新增了一个实验性逻辑:当输入满足特定目标形状(inputParams_.mSize == 51200、nSize == 1536、kSize == 4096、groupNum == 80)且 baseM/baseN 均为 256(GmmConstant::BASIC_BLOCK_SIZE_256)时,将 basicTiling_.baseM 下调一个 16 行的 cube 单元至 224(EPILOGUE_DB_EXPERIMENT_BASE_M),从而为 Epilogue 腾出可分配两个 UB 输出槽(双缓冲)的空间。该实验按形状范围收敛,待性能结果确认后再决定是否推广,改动不涉及接口、数据结构和配置变更。
主要改动
- 新增形状限定实验分支: 在
basicTiling_.baseM = std::min(alignedBaseM, maxBaseMByUb)计算之后,新增一段注释为 Experiment 的条件判断,通过inputParams_的mSize/nSize/kSize/groupNum精确匹配目标形状,保证实验只作用于该特定场景。 - 下调 M 分块以适配 Epilogue UB 双缓冲: 当
baseM与baseN均为GmmConstant::BASIC_BLOCK_SIZE_256时,将basicTiling_.baseM由 256 改为新增常量EPILOGUE_DB_EXPERIMENT_BASE_M(224),即减少一个 16 行 cube 单元,使 Epilogue 能分配两个 UB 输出槽,属于GroupedMatmulActivationQuantTiling950::DoLibApiTiling()中纯本地、不改变外部接口的 M 分块调整。


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 |
|---|---|---|
| gmm | ✅ kknan, 陈康 (2/2) | ✅ kknan (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhoushaolong, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/approve


/lgtm


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.


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


描述
针对 Ascend950 arch35 的 GroupedMatmulActivationQuant(GMMAQ)tiling,增加 epilogue UB 双缓冲的空间适配逻辑。
主要改动如下:
baseM经过基础 tiling 计算和 UB 上限约束后,检查当前分块是否能够容纳 epilogue 双缓冲。GmmConstant::CUBE_BLOCK步长递减搜索可用的baseM。baseM,避免引入额外的分块开销。baseM调整,确保后续 tiling 参数基于最终分块尺寸计算。关联的Issue
https://gitcode.com/cann/ops-transformer/issues/4955
测试
本次未新增或修改测试文件。现有
grouped_matmul_activation_quanthost UT 包含对 epilogue 每个 AIV 的元素数量上限校验,但当前 PR 未提供具体测试执行记录,需补充相关测试结果。文档更新
无。
类型标签