Closed
[Bug-Report|缺陷反馈]: index_check 等五个索引算子的错误码语义及失败首报整改 #7444
fazhenyao123Add on  25 days agoClosed at  1 day ago
fazhenyao123
fazhenyao123Collaborators
25 days ago Create

问题描述与合入背景

index_check、linear_index_v2、linear_index、index_put_with_sort、index_put 的部分参数校验和 InferShape/Tiling 失败路径通过泛化内部错误入口上报;外层 Init/launcher 包装还会追加 EZ9999,影响用户定位具体参数与根因。LinearIndexV2 在扣减预留 UB 后才检查容量,存在无符号下溢风险;Ascend950 实例枚举还缺少固定数组容量上限检查和逐实例 shape 判空。

本次整改按根因选择目标版本已注册的正式错误码,携带参数名、actual、expected/reason;下层已首报时仅补 PLOG 并透传,保持原公开返回行为。必要边界防护在错误码路径之前执行,避免越界或崩溃绕过诊断。

环境信息

  • ops-nn master;原整改 head 46d5e31bb6472d26cba22b960df69de41692aed2,本轮更新基于 master f2ab9177000e2c447c98187eb3260825cd4755cf。
  • Ascend950PR 测试服务器,CANN 9.2.0-beta.2,Python 3.11.17。
  • host UT/平台桩覆盖逻辑分支,不将其视为所有硬件上的完整 kernel 集成验证。

重现步骤

  1. 在五个算子 host 路径构造缺失输入、非法 rank/shape/dtype、UB/核数异常,检查 ErrorManager 正式码、诊断字段与首报数量。
  2. 对 LinearIndexV2 Tiling 构造 9 个 indices 实例,或在 Ascend950 枚举的第一/后续实例处提供缺失 shape。原实现分别可能写越 indicesMask_[8] 边界或空指针解引用。
  3. 对六个 L0 launcher 包装(LinearIndexV2 含两分支)注入空参数上下文;原安装库返回失败但 ErrorManager 为 0 条。
  4. 对真实 AllocTensor、AllocIntArray、ConvertToTensor 注入一次性 pooled Object 分配失败;均返回 nullptr 但 ErrorManager 为 0 条。

预期行为

每次失败具有一个匹配根因的已注册正式首错及可执行诊断,外层不重复上报;非法实例数、缺失 shape 应安全失败并报告。实际资源分配失败由掌握申请事实的分配层首报,不在只拿到 null 的算子外层机械借用 ACL/Runtime 资源码。

已验证结果与剩余范围

原五算子变更已有 25/25 host UT、API/Tiling/InferShape/graph 目标编译及 12 个实际 include trace。LinearIndexV2 不支持 SoC 路径用平台桩验证唯一 EZ1009 及 actual/supported 字段。

opbase 依赖补丁的生产库编译及 6/6 定向 UT 通过;六个 L0 空上下文包装子路径加载该库后各产生一个 EZ1011,保持原返回值。

三处分配漏报、依赖合入/交付及完整新 host 组合尚未关闭;本 issue 不以部分子路径通过宣称全链路完成。

关联 PR

likedislike
fazhenyao123fazhenyao123Collaborators
25 days ago Added label: bug-report
yuning_chenyuning_chenCollaborators
25 days ago Assign fazhenyao123 as responsible person
fazhenyao123fazhenyao123Collaborators
23 days ago Associated pull request
yuning_chen
yuning_chenCollaborators
18 days ago Comments:

初步分析

感谢反馈,我们已开始核对这个问题。

现象理解:[Bug-Report|缺陷反馈]: index_check 等五个索引算子的错误码语义及失败首报整改。
当前判断:初步判断,待复现确认,还不能当成已确认根因。
涉及范围:nit/launcher、expected/reason、rank/shape、25/25、hape/graph、actual/supported
下一步:我们会继续对照代码/文档定位。

likedislike
yuning_chen
yuning_chenCollaborators
18 days ago Comments:

您好,该问题已收到,当前问题 @jiangqi2025 正在处理中

likedislike
chenjiayi_chenjiayi_Collaborators
5 days ago Assign chenjiayi_ as responsible person
chenjiayi_
chenjiayi_Collaborators
5 days ago Comments:

补充说明本问题的处理进展:

当前状态:
关联 PR PR#13013 已合入,合入时间为 2026-10-30 09:41;该 issue 仍为 open,指派后评论区保持静止。

依据:

  • PR 状态:merged。
  • 合入时间:2026-10-30 09:41。
  • 当前责任人:fazhenyao123。
  • 指派时间:2026-10-27 16:07。

后续:
请责任人复核 master 的合入情况;确认修复后关闭 issue。

likedislike
fazhenyao123fazhenyao123Collaborators
1 day ago changed custom state from 进行中 to 已完成
fazhenyao123fazhenyao123Collaborators
1 day ago Close issue
chenjiayi_chenjiayi_Collaborators
14 hours ago Removed responsible person chenjiayi_