Pull Request已成功合入, 合并人@CANN-robot
(感谢 Hu1L1 的贡献)变更摘要
本 PR 针对 QuantBatchMatMulV3 在一维 bias 的 shape 校验失败时,报错信息中实际维度缺少方括号的问题进行修复。在 matmul/quant_batch_matmul_v3/op_api/quant_matmul_checker.cpp 的 QuantMatmulChecker::CheckBiasShape 中,将 OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON 的实际 shape 参数由 std::to_string(biasFirstDim).c_str() 改为拼接方括号的 "[" + std::to_string(biasFirstDim) + "]",使实际维度以 [0] 的形式呈现,与期望 shape 的书写格式一致。该改动仅涉及错误信息格式,校验条件、返回值与计算逻辑均未变化。
主要改动
- 错误信息实际 shape 补上方括号: 在
QuantMatmulChecker::CheckBiasShape中,OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON的 shape 参数改为"[" + std::to_string(biasFirstDim) + "]",使一维 bias 校验失败时实际维度显示为带方括号的形式(如[0])。 - 普通日志与 EZ0009 上报格式统一: 修改后普通日志与
EZ0009上报使用相同的 shape 字符串,避免再出现缺少方括号的incorrect shape 0。 - 校验逻辑保持不变: 仅调整报错参数的拼接方式,
biasFirstDim == x2NDim_的校验条件、return false/return true返回值及计算逻辑均未改动。


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 |
|---|---|---|
| */*/op_api/*.h | ✅ 汤磊, 杨阳, 王子韬 (3/2) | ✅ 汤磊 (1/1) |
| matmul | ✅ 王子韬, 杨阳 (2/2) | ✅ 王子韬, 杨阳 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Hu1L1, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/approve


/approve


描述
修复 QBMMv3、QBMMIA 和 QuantMatmulActivationQuant 在 shape 校验失败时,错误信息中的实际 shape 缺少方括号的问题。例如实际 shape 为 [16] 时,错误信息由
incorrect shape 16改为incorrect shape [16]。op::ToString(shape).GetString()保留完整 shape。matmul/common/op_host/log_format_util.h中的StripEnclosingSquareBrackets(),清理全部调用和 using 声明。改动涉及 API 日志格式及公共日志工具清理。校验条件、返回值和计算逻辑保持不变,QBMMv4 tiling 不在本次修改范围内。
目标分支:
master。关联的Issue
关联并修复 #6129。
测试
pre-commit run --show-diff-on-failure --files ...,所有适用检查通过(退出码 0)。git diff --check通过。StripEnclosingSquareBrackets已无定义或引用。文档更新
无。
类型标签
AI/Agent生成声明