Pull Request已成功合入, 合并人@CANN-robot
(感谢 wuyufei 的贡献)变更摘要
本 PR 为 matmul_emu_split_weight(mesw)算子增加空指针校验,防止在推理 shape 与 tiling 阶段因属性指针或输入/输出描述为空而直接解引用导致崩溃。改动覆盖了算子的 infershape 与 arch35 tiling 两条路径:在解引用属性指针前先获取指针并判空,同时新增统一的输入非空校验流程并接入 GetShapeAttrsInfo() 主流程。
主要改动
-
InferShapeForMatmulEmuSplitWeight属性指针判空:在matmul_emu_split_weight_infershape.cpp中,将原先直接解引用attrs->GetAttrPointer<bool>获取transX/transW的方式改为先取指针,用OP_CHECK_IF校验两个指针均非空后再取值,为空时上报CUBE_INNER_ERR_REPORT并返回GRAPH_FAILED,避免空指针解引用。 -
ExtractAttrs中wLowScale属性判空:在matmul_emu_split_weight_tiling.cpp的ExtractAttrs()中,对INDEX_ATTR_W_LOW_SCALE的属性指针先判空(通过OP_TILING_CHECK),为空时返回GRAPH_FAILED,再解引用赋值给scale_。 -
新增
ValidateInputsNotNull()输入校验方法:在matmul_emu_split_weight_tiling.cpp中新增该方法,使用OPS_CHECK_NULL_WITH_CONTEXT依次校验context_、attrs、输入INDEX_X/INDEX_W_HIGH/INDEX_W_LOW的 desc 与 shape,以及输出INDEX_Y的 desc 与 shape;并在matmul_emu_split_weight_tiling.h中声明该私有方法。 -
GetShapeAttrsInfo()接入校验流程:在GetShapeAttrsInfo()中于ExtractAttrs()之前先调用ValidateInputsNotNull(),校验失败即返回GRAPH_FAILED,保证后续取属性、形状等操作在输入合法的前提下进行。


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


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


/lgtm
/approve


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
本 PR 为 matmul_emu_split_weight(mesw)算子增加空指针校验,防止在推理 shape 与 tiling 阶段因属性指针或输入/输出描述为空而直接解引用导致崩溃。改动覆盖了算子的 infershape 与 arch35 tiling 两条路径:在解引用属性指针前先获取指针并判空,同时新增统一的输入非空校验流程并接入 GetShapeAttrsInfo() 主流程。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/5475
测试
文档更新
类型标签
AI/Agent生成声明