已关闭
[Bug-Report|缺陷反馈]: 部分迁移算子InferShape不支持unknown shape/rank及混合动态shape场景 #5250
xuejinghui创建于  9 天前关闭于  4 天前
xuejinghui
9 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

18 个算子(Threshold/AddRowRanges/InplaceScatterAdd/InplaceUpdate/ScatterMaxWithArgmax/ScatterNdSub/ScatterNonAliasingAdd/SparseSegmentSumGrad/ChamferDistanceGrad/SparseApplyAdadelta/SparseApplyAdagradV2/SparseApplyFtrl/SparseApplyFtrlV2/SparseApplyProximalAdagrad/SparseApplyRMSProp/Dilation2D/MaxPoolGradGradWithArgmax/MaxPoolV3Grad)的 InferShape 实现按全已知 shape 的假设编写:维度数校验、逐维一致性校验未对 unknown rank(-2)和 unknown dim(-1)做放行处理,导致合法动态 shape 图在 InferShape 阶段被误判为非法输入返回 GRAPH_FAILED;部分算子在 unknown rank 时未按语义透传 shape,导致下游推导异常。

Environment / 环境信息 (Mandatory / 必填)

CANN 9.2.0
Ascend 950

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 构造包含 unknown rank(shape 为 {-2})或部分维度未知(如 {-1,2,4,-1})输入的上述算子;
  2. 在动态 shape 图下执行 shape 推导(或直接用仓内 InferShapeContextFaker 构造 {-1}/{-2} 输入跑 ophost UT);
  3. InferShape 返回 GRAPH_FAILED(4294967295),或输出 shape 推导结果错误。

Describe the expected behavior / 预期结果 (Mandatory / 必填)

  • 输入 unknown rank 时:按算子语义透传输入 shape 或将输出置 unknown rank({-2}),不报错;
  • 输入 unknown dim 时:涉及 -1 维的校验跳过,已知维度校验与推导保持原有严格性;
  • 全已知 shape 及异常输入(nullptr 等)行为与原来完全一致。

典型报错样例:维度一致性校验对 -1 维误报 mismatch(如 "The rank of indices must be >= 2"、"shape mismatch" 类 OP_LOGE 输出),InferShape 返回 4294967295(GRAPH_FAILED)。

Special notes for this issue/备注 (Optional / 选填)

涉及 unknown shape/rank 的适配及 UT 已在 InferShape 分支完成,含全 -1/全 -2 用例与混合动态 shape({-1,2,4,-1}、{{-1,2,4,-1},{-2}})用例,可关联本 issue。

likedislike
xuejinghui
9 天前 评论:

/assign

likedislike
CANN-robotCANN-robot成员
9 天前 将 xuejinghui 设为负责人
CANN-robotCANN-robot成员
4 天前 关闭了 issue
CANN-robotCANN-robot成员
4 天前 添加了label:resolved