Closed
[Documentation|文档反馈]: aclnnInplaceRoundGetWorkspaceSize 错误码表缺 ACLNN_ERR_PARAM_INVALID(161002) 整类说明 #3916
liuhanwen8Add on 16 days agoClosed at 3 days ago
16 days ago Added label: documentation
陈思
15 days ago Comments:
15 days ago Comments:
您好,感谢反馈!核对 cann/ops-math@584b2ea6cbaeba684a51a74296d82d4d50ab3b0f,原地小节的错误码表确实缺少 ACLNN_ERR_PARAM_INVALID(161002),该返回码有实际校验路径支持。
aclnnInplaceRoundGetWorkspaceSize把同一个 selfRef 同时作为输入和输出调用非原地第一段,随后由 CheckParamsRound检查类型、shape 和格式。类型不在对应产品支持列表内、使用私有格式,或张量维数超过 8,均可返回 161002;八维限制位于共用形状检查,不是从参数表单独推测出来的。
可行的资料修订是在原地错误码表中增加 161002,包含“selfRef 的数据类型或数据格式不在支持范围内”和“selfRef 的维数大于 8”两项,并按两项设置合并行数。原地两端是同一张量,不需要照抄非原地的输入输出 shape 或 dtype 不一致条目;既有 161001、561101 及产品类型限制仍保留。
本项是源码与资料可直接核对的说明缺项,无需设备复现才能判断。我们会继续确认该错误码表的补齐方式。


15 days ago Assign chensi79 as responsible person
15 days ago Added label: pending-confirmation
15 days ago Assign jiaoyiming as responsible person
15 days ago Removed responsible person chensi79
15 days ago Removed label: pending-confirmation
3 days ago Close issue
3 days ago changed custom state from 进行中 to 已完成
3 days ago Added label: resolved
文档链接
cann/ops-mathmaster@584b2ea6cbaeba684a51a74296d82d4d50ab3b0fmath/round/docs/aclnnRound&aclnnInplaceRound.md:284-309(## aclnnInplaceRoundGetWorkspaceSize的「返回值」错误码表)math/round/docs/aclnnRound&aclnnInplaceRound.md:142-173(## aclnnRoundGetWorkspaceSize同名表)math/round/docs/aclnnRound&aclnnInplaceRound.md:284-309问题文档片段
问题描述:
aclnnInplaceRoundGetWorkspaceSize的「第一段接口完成入参校验」错误码表只列了161001(空指针)与561101(执行器创建失败),整类缺ACLNN_ERR_PARAM_INVALID(161002)。而同文件 out-of-place 的aclnnRoundGetWorkspaceSize同名表里161002是存在的(rowspan=3)。Inplace 侧参数表已明确声明selfRef的 dtype 支持面与维度范围 0-8,违反其中任一条必然走参数校验失败路径,即161002。推导链:
aclnnInplaceRoundGetWorkspaceSize参数说明表(L245-252)声明:selfRef数据类型为BFLOAT16、FLOAT16、FLOAT32、DOUBLE、INT32、INT64,数据格式ND,维度0-8。这是接口自己声明的合法域。ACLNN_ERR_PARAM_INVALID(161002)。## aclnnRoundGetWorkspaceSize的错误码表(L142-173)确实列了161002,并用rowspan=3给出三条子描述:self和out的数据类型或数据格式不在支持的范围之内。/self和out的shape不一致。/self和out的dtype不一致。161001与561101两条,161002整类缺失。161002。反向排除:
161001已出现在该表中,说明校验链存在且在文档里被承认;若真的只有空指针检查,参数表就不会声明 dtype 支持面与维度 0-8。161002所在行的<td rowspan="3">161002</td>做了标签剥离,在对照小节正确取到161002(实测输出里对照 aclnnRoundGetWorkspaceSize 错误码: ['161001', '161002']),说明解析逻辑能处理rowspan,Inplace 侧确实是没写而不是没读到。影响:调用方按文档编写错误处理分支时,会为
161001/561101写专门分支,而对161002无预期。实际传入不支持的 dtype 或 rank>8 时会拿到 161002,被归入「未预期错误」直接上抛或忽略,掩盖真实的入参问题;自动化用例的错误码断言也会照文档写成不可能命中的期望值。原文片段(Inplace 表,
math/round/docs/aclnnRound&aclnnInplaceRound.md:298-307,逐字):<tr> <td>ACLNN_ERR_PARAM_NULLPTR</td> <td>161001</td> <td>传入的Tensor为空指针。</td> </tr> <tr> <td>ACLNN_ERR_INNER_CREATE_EXECUTOR</td> <td>561101</td> <td>内部错误,执行器创建失败。</td> </tr>对照片段(out-of-place 表,
math/round/docs/aclnnRound&aclnnInplaceRound.md:161-171,逐字):<tr> <td rowspan="3">ACLNN_ERR_PARAM_INVALID</td> <td rowspan="3">161002</td> <td>self和out的数据类型或数据格式不在支持的范围之内。</td> </tr> <tr> <td>self和out的shape不一致。</td> </tr> <tr> <td>self和out的dtype不一致。</td> </tr>对照片段(Inplace 参数表
selfRef行,...md:245-251,逐字):<td>selfRef(aclTensor*)</td> <td>输入/输出</td> <td>输入Tensor。</td> <td>支持空Tensor。</td> <td>BFLOAT16、FLOAT16、FLOAT32、DOUBLE、INT32、INT64</td> <td>ND</td> <td>0-8</td>复现三件套:
0= 符合预期(不成立)/1= 缺陷成立并打印[DEFECT]/2= 无法判定0;实测值:1脚本全文:
#!/usr/bin/env python3 import argparse, os, re, sys def section(text, heading): m = re.search(r"^##\s+%s\s*$" % re.escape(heading), text, re.M) if not m: return None rest = text[m.end():] m2 = re.search(r"^##\s+\S", rest, re.M) return rest[:m2.start()] if m2 else rest def codes(seg): m = re.search(r"第一段接口完成入参校验(.*?)</table>", seg, re.S) if not m: return None out = [] for tr in re.findall(r"<tr>(.*?)</tr>", m.group(0), re.S): cells = [re.sub(r"<[^>]+>", "", c).strip() for c in re.findall(r"<td[^>]*>(.*?)</td>", tr, re.S)] if len(cells) >= 2 and re.match(r"^\d{6}$", cells[1] or ""): out.append(cells[1]) return out def main(): ap = argparse.ArgumentParser() ap.add_argument("--repo", required=True) ap.add_argument("--file", required=True) ap.add_argument("--section", required=True) ap.add_argument("--control", default="") ap.add_argument("--code", required=True) ap.add_argument("--claim", choices=["missing", "extra"], default="missing") a = ap.parse_args() path = os.path.join(a.repo, a.file) if not os.path.isfile(path): print("[SKIP] 文件不存在: %s" % path); return 2 text = open(path, encoding="utf-8", errors="replace").read() seg = section(text, a.section) if seg is None: print("[SKIP] 未找到小节 ## %s" % a.section); return 2 rows = codes(seg) if not rows: print("[SKIP] 未能解析出错误码表(结构可能已变)"); return 2 ctrl = [] if a.control: cs = section(text, a.control) ctrl = codes(cs) or [] print("文件: %s" % a.file) print("小节 %s 错误码: %s" % (a.section, sorted(set(rows)))) if a.control: print("对照 %s 错误码: %s" % (a.control, sorted(set(ctrl)))) hit = a.code in rows if a.claim == "missing": if hit: print("结论: 已包含 %s,本条不成立" % a.code); return 0 if a.control and a.code not in ctrl: print("[SKIP] 对照小节也无 %s,无法判定'同族已有此处漏写'" % a.code); return 2 print("[DEFECT] 小节缺 %s 整类说明(对照小节有 %d 条)" % (a.code, ctrl.count(a.code))); return 1 else: if not hit: print("结论: 确实不含,本条不成立"); return 0 print("[DEFECT] 不应含 %s 却出现" % a.code); return 1 if __name__ == "__main__": sys.exit(main())实测输出:
存在的问题
修复建议:在 Inplace 小节的错误码表中补
161002一行,措辞必须针对单张量selfRef,不能照抄 out-of-place 的「self 和 out 的 shape/dtype 不一致」(Inplace 只有一个张量,结构上不存在 self/out 不一致)。建议在561101行之后追加:<tr> <td rowspan="2">ACLNN_ERR_PARAM_INVALID</td> <td rowspan="2">161002</td> <td>selfRef的数据类型或数据格式不在支持的范围之内。</td> </tr> <tr> <td>selfRef的维度大于8。</td> </tr>若实现侧对 Inplace 只有一条校验(例如仅 dtype/format 而 rank 由通用链路拦截),则只补第一条,
rowspan改为 1 并去掉第二个<tr>,以实际校验条数为准。证据与环境:
1(含[DEFECT])161002具体对应几条子描述需实现侧确认,故修复建议给了「按实际校验条数补 1 或 2 条」的收敛写法。完整文件清单:
math/round/docs/aclnnRound&aclnnInplaceRound.md(L284-309 错误码表,待补充)