Merged
fix(index): 修正框架内部对象缺失的错误码归因 #13013
fix(index): 修正框架内部对象缺失的错误码归因 #13013
Merged
fazhenyao123Add on 23 days ago
fazhenyao123
fazhenyao123Collaborators
23 days ago

原 !12754 合入后的错误码排查表发现:框架上下文、CompileInfo、PlatformInfo、RuntimeAttrs、输出 Shape 等内部对象缺失,被误报为用户必填参数为空(EZ0004)。本变更按排查表 F01–F05 修正 30 处:index_check 12 处、linear_index_v2 9 处、linear_index 6 处、index_put_with_sort 3 处;index_put 没有表中明确问题。

Tiling/Prepare 路径使用 EZ1008,InferShape/InferDataType 路径使用 EZ1014。消息包含算子、函数名、缺失框架对象和排查建议;保持原判断条件及 GRAPH_FAILED 返回。实际用户输入的 EZ0004 判空保留。两个码的注册 Arglist 均为 opName, reason,通过可见公共 ErrorManager 入口首报。

关联:ops-nn #7444、原 !12754。目标 master,基准 dbad856de2c6cea62205b9f14a94558341e4142d,本次 head 734a5e1f1f79c78becd17480f1484c3eb062cf2d。

验证(A5_ci / x86_64 / CANN 9.2.0-beta.2):

  • 受影响 InferShape、graph 插件、host UT(含 Tiling 对象)目标编译、链接通过;7 个生产文件按真实编译命令执行 -E -H,通过并确认实际日志头文件。
  • 本地 host UT 52/52 通过:新增 26 个参数化负向用例及原有 26 个相关用例。新增用例校验原失败返回、正式码、算子/对象/原因字段以及恰好 1 条 ErrorManager 首错。
  • 两处 computeNodeInfoPtr、两处 attrs 防御检查受框架 getter 契约约束,已核对源码和共享 reporter,未声称独立故障注入覆盖。实际测试前合法构造上下文,再清空目标 slot。
  • clang-format 18.1.8 dry-run、git diff --check 通过;还原 30 处报告调用后,七个文件的 C++ token 与原版一致,原条件、返回及算法未改变。
  • 测试基于 4081356df 的复用构建树;随后同步 master 的 3 个无关提交。7 个最终提交 blob 的 SHA256 与实际验证文件一致,相关构建配置与依赖未变。没有执行全仓构建、设备 ST 或完整远端 CI。

按用户要求,UT、测试 CMake 和验证产物全部仅保存在本地,PR 最终差异只有 7 个生产文件。

排查表 F14 明确保留的三处分配诊断继续使用用户指定的 ACLNN_ERR_INNER_NULLPTR,本次未改动;不宣称已解决实际 allocator 的正式资源首报。通用静态审计仍有既有 include/CMake 解析及本地 reporter 控制流识别限制,候选—审计未对账为 0;四份处置检查为 0/0/1/0,linear_index 的 3 个 F14 保留项仍标为 BLOCKED。本 PR 修复 F01–F05,不宣称原任务全链路治理关闭。

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for fazhenyao123's contribution.)
fazhenyao123fazhenyao123Collaborators
23 days ago Created pull request, commit 3919a74a
fazhenyao123fazhenyao123Collaborators
23 days ago Associated issue: [Bug-Report|缺陷反馈]: index_check 等五个索引算子的错误码语义及失败首报整改
atomgit-bot
atomgit-bot
23 days ago Comments:

变更摘要

本变更修正索引类算子中框架内部对象缺失时的错误码归因问题:原先框架上下文、CompileInfo、PlatformInfo、attrs、输出 Shape 等框架侧对象为空时被误报为用户必填参数未填(EZ0004),现按 Tiling/Prepare 与 InferShape/InferDataType 两条路径分别改用 EZ1008 与 EZ1014 上报。各改动文件均新增局部静态辅助函数(ReportMissingTilingObject 或 ReportMissingInferenceObject),统一构造包含函数名、缺失框架对象名及排查建议的 reason 字符串,先调用 OP_LOGE_WITHOUT_REPORT 打日志,再通过 REPORT_PREDEFINED_ERR_MSG 以 opName、reason 两个 Arglist 键上报;原有判空条件与 GRAPH_FAILED 返回保持不变,覆盖 IndexCheck、IndexPutWithSort、LinearIndex、LinearIndexV2 四个算子。


主要改动

  • 新增统一上报辅助函数: 四个算子的 tiling/infershape 文件中各定义匿名命名空间内的 ReportMissingTilingObject 或 ReportMissingInferenceObject,以 functionName 与 objectName 拼接 reason,固定 opName/reason 键值对并选择 EZ1008(Tiling/Prepare 路径)或 EZ1014(InferShape/InferDataType 路径)。
  • index_check 全量替换框架对象误报: index_check_tiling.cpp 将 tilingContext_、compileInfo、computeNodeInfoPtr、idxInstanceInfoPtr、rawTilingData、workspaces、context、platformInfo 等判空由 OP_LOGE_WITH_INVALID_INPUT 改为调用 ReportMissingTilingObject;index_check_infershape.cpp 与 index_check_graph_infer.cpp 的 context 判空改为调用 ReportMissingInferenceObject。
  • linear_index_v2 细化缺失对象标识: linear_index_v2_infershape.cpp 中输出 Shape 判空由原先误标的 "index" 改为 "outputShape(index)" 并使用推理侧上报;linear_index_v2_tiling.cpp 的 Init 与 TilingPrepareForLinearIndexV2 中 compileInfo、computeNodeInfoPtr、idxInstanceInfoPtr、platformInfo 判空改用 Tiling 侧上报。
  • linear_index 与 index_put_with_sort 同类替换: linear_index_tiling.cpp 中 tilingContext、compileInfo、attrs、rawTilingData、platformInfo 判空,以及 index_put_with_sort_tiling.cpp 中 attrs、compileInfo、platformInfo 判空,均改为调用各自文件内的 ReportMissingTilingObject;linear_index 中仍保留针对用户输入 indices、shape 的原有 EZ0004 判空不动。
  • 上报链路与行为保持不变: 新增 #include <string>、#include <vector> 支撑 reason 与键值容器,日志统一经 OP_LOGE_WITHOUT_REPORT 输出,错误码经可见公共 ErrorManager 入口 REPORT_PREDEFINED_ERR_MSG 首报,条件判断与失败返回路径未调整。

🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
atomgit-bot
atomgit-bot
23 days ago Comments:

代码审查

✅ 未发现问题


🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
23 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
23 days ago Comments:

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
index ✅ 陈展熹, 陈兴宇 (2/2) ✅ 陈兴宇 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

fazhenyao123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
23 days ago Set zengjuan,u010470851,chenfeng61,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,wangrui_,su-yueming,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,chenxingyu18,pingchuantang,qianzehong as approver
CANN-robotCANN-robotCollaborators
23 days ago Set u010470851,chenfeng61,kevin_huang1234,wangrui_,su-yueming,yourealize,wang-xing001,chenxingyu18,pingchuantang,qianzehong as approver
fazhenyao123
fazhenyao123Collaborators
23 days ago Comments:

compile

likedislike
fazhenyao123fazhenyao123Collaborators
23 days ago Pre merge succeeded (commit_id: 8f6d09d1040eee91c3bd6b8453bb2d78d1c19b44)
fazhenyao123
fazhenyao123Collaborators
23 days ago Comments:

/check-pr

likedislike
CANN-robot
CANN-robotCollaborators
23 days ago Comments:

The following labels are not ready.

lgtm: Please wait for committers to review the code.

approved: Please wait for committers to review the code.

ci-pipeline-passed: Please wait for the CI test to be completed. You can also comment /compile to retry it!

likedislike
fazhenyao123
fazhenyao123Collaborators
23 days ago Comments:

/compile

likedislike
fazhenyao123fazhenyao123Collaborators
23 days ago Pre merge succeeded (commit_id: 2b7eeb6c1ed4493a785cfc66452d7d29700ef03f)
CANN-robot
CANN-robotCollaborators
23 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
23 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
23 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
23 days ago Added label: ci-pipeline-passed
chenxingyu18
chenxingyu18Collaborators
23 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
23 days ago Added label: approved
yuning_chen
yuning_chenCollaborators
23 days ago Comments:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!
@yangyang016 @yourealize @su-yueming @chenxingyu18 @kevin_huang1234 @u010470851 @wang-xing001

likedislike
FelixTang7
FelixTang7Collaborators
22 days ago Comments:

/lgtm
/approve

likedislike
fazhenyao123
fazhenyao123Collaborators
22 days ago Comments:

/check-pr

likedislike
CANN-robot
CANN-robotCollaborators
22 days ago Comments:

The following label is not ready.

lgtm: Please wait for committers to review the code.

likedislike
陈展熹
陈展熹Collaborators
22 days ago Comments:

/lgtm

likedislike
CANN-robot
CANN-robotCollaborators
22 days ago Comments:

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

likedislike
CANN-robotCANN-robotCollaborators
22 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
22 days ago Merged pull request