已关闭
[Bug-Report|缺陷反馈]: deformable_offsets_grad算子A5(ascend950)图模式example运行失败,Run graph failed #6017
caorenlei创建于  9 天前关闭于  1 天前
caorenlei成员
9 天前 创建

一、算子信息 (必填)

二、问题描述 (必填)

执行 bash build.sh --run_example deformable_offsets_grad graph --soc=ascend950 失败,表现为 Run graph failed(GE 初始化与图构建均成功,plog 无明显 kernel 层报错,疑算子本身在 A5 运行问题)。

根因分析(plog 分析 + GDB 动态调试确认):

  • 失败点在 GE 图准备的 InferShape 阶段,而非 kernel 运行阶段
  • plog 报错:[nn_calculation_ops.cc][DeformableOffsetsGradInfer] "Grad_x format should be same as input x format"
  • example 输出 TensorDesc 设置 FORMAT_NHWC,而 A5 上 GE InferFormat 将输入 x/offsets 的 format 推导为 FORMAT_ND、输出保留用户设置的 FORMAT_NHWC
  • 内置 libopsproto.so 注册的 DeformableOffsetsGradInfer 执行 format 一致性校验时因 NHWC ≠ ND 失败 → 整图编译失败 → Run graph failed

三、环境信息

  • 昇腾硬件型号:Ascend950PR
  • CANN版本:730商发(cann-9.1.0)
  • 操作系统:Linux x86_64
  • ops-nn代码仓:9.1.0分支

四、重现步骤

  1. 编译:bash build.sh --pkg --soc=ascend950 --ops=deformable_offsets_grad
  2. 安装:./build_out/cann-ops-nn-custom_linux-x86_64.run --force
  3. 运行:bash build.sh --run_example deformable_offsets_grad graph --soc=ascend950 → Run graph failed

五、修复方案

  1. example ADD_OUTPUT 宏输出 format 由 FORMAT_NHWC 改为 FORMAT_ND,与 GE 对输入的 format 推导保持一致
  2. 算子仅支持 ascend950,按仓库芯片专属示例惯例将用例从 examples/ 顶层移入 examples/arch35/(include 路径适配),其他芯片环境不再扫描执行

验证:Ascend950PR 真机实测 --run_example 运行成功(kernel 编译、图执行、输出回读全流程通过)。

关联MR

https://gitcode.com/cann/ops-nn/merge_requests/9826

likedislike
Ccaorenlei成员
9 天前 添加了label:bug
黄黄强成员
9 天前 关联了pull request:修复deformable_offsets_grad算子A5(ascend950)图模式example运行失败问题
yuning_chenyuning_chen成员
9 天前 将 huang-qiang 设为负责人
黄黄强成员
1 天前 issue状态由 进行中 改变为 已完成
黄黄强成员
1 天前 关闭了 issue