Pull Request已成功合入, 合并人@CANN-robot
(感谢 yzf 的贡献)变更摘要
本 PR 针对 pypto_pro 的 MX matmul 物理形状校验进行放宽:在 _check_mx_operands 中移除了基于输入物理形状推断逻辑窗口的约束(lhs/rhs 的 K 维度必须相等、dst_tile 形状必须为 [lhs M, rhs N]),因为 set_validshape 更新的是描述符状态而非 TileType.shape,构建器不应据此推断逻辑输出窗口;同时将 dst_tile 与 acc_tile 形状一致性校验抽取为独立辅助函数 _check_matmul_acc_shape,并在 _ir_matmul_acc 中统一调用。
主要改动
- 新增形状校验辅助函数: 在
block_ops.py中新增_check_matmul_acc_shape,集中校验acc_tile与dst_tile形状是否一致,不一致时抛出InvalidShape。 matmul_acc增加形状校验: 在_ir_matmul_acc中调用_check_matmul_acc_shape,使普通(非 MX)matmul_acc路径也执行acc_tile/dst_tile形状匹配检查。- 放宽 MX matmul 物理形状约束:
_check_mx_operands删除了lhs/rhsK 维度必须相等以及dst_tile必须等于[lhs M, rhs N]的校验,仅保留 K 维度须为 64 倍数的检查,并将acc_tile形状校验改为复用新辅助函数。 - 测试用例更新:
test_matmul_mx.py将原先的 K 不匹配、输出形状不匹配拒绝用例改为允许用例(allows_physical_k_selected_by_valid_shape、allows_output_shape_selected_by_valid_shape),test_block_ops.py新增test_matmul_acc_rejects_mismatched_acc_shape覆盖acc_tile形状不匹配场景。


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


/approve
/lgtm


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: gaoxiang618


relax MX matmul physical shape checks