执行 bash build.sh --run_example deformable_offsets_grad graph --soc=ascend950 失败,表现为 Run graph failed(GE 初始化与图构建均成功,plog 无明显 kernel 层报错,疑算子本身在 A5 运行问题)。
bash build.sh --run_example deformable_offsets_grad graph --soc=ascend950
根因分析(plog 分析 + GDB 动态调试确认):
[nn_calculation_ops.cc][DeformableOffsetsGradInfer] "Grad_x format should be same as input x format"
FORMAT_NHWC
FORMAT_ND
DeformableOffsetsGradInfer
bash build.sh --pkg --soc=ascend950 --ops=deformable_offsets_grad
./build_out/cann-ops-nn-custom_linux-x86_64.run --force
ADD_OUTPUT
验证:Ascend950PR 真机实测 --run_example 运行成功(kernel 编译、图执行、输出回读全流程通过)。
--run_example
https://gitcode.com/cann/ops-nn/merge_requests/9826
一、算子信息 (必填)
二、问题描述 (必填)
执行
bash build.sh --run_example deformable_offsets_grad graph --soc=ascend950失败,表现为 Run graph failed(GE 初始化与图构建均成功,plog 无明显 kernel 层报错,疑算子本身在 A5 运行问题)。根因分析(plog 分析 + GDB 动态调试确认):
[nn_calculation_ops.cc][DeformableOffsetsGradInfer] "Grad_x format should be same as input x format"FORMAT_NHWC,而 A5 上 GE InferFormat 将输入 x/offsets 的 format 推导为FORMAT_ND、输出保留用户设置的FORMAT_NHWCDeformableOffsetsGradInfer执行 format 一致性校验时因 NHWC ≠ ND 失败 → 整图编译失败 → Run graph failed三、环境信息
四、重现步骤
bash build.sh --pkg --soc=ascend950 --ops=deformable_offsets_grad./build_out/cann-ops-nn-custom_linux-x86_64.run --forcebash build.sh --run_example deformable_offsets_grad graph --soc=ascend950→ Run graph failed五、修复方案
ADD_OUTPUT宏输出 format 由FORMAT_NHWC改为FORMAT_ND,与 GE 对输入的 format 推导保持一致验证:Ascend950PR 真机实测
--run_example运行成功(kernel 编译、图执行、输出回读全流程通过)。关联MR
https://gitcode.com/cann/ops-nn/merge_requests/9826