grounding dino onnx转om失败
收藏回复举报
grounding dino onnx转om失败
t('forum.solved') 已解决
新人帖
发表于2025-09-18 16:28:28
0 查看

参考项目

项目1 hpc203/GroundingDINO-onnxrun: 使用onnxruntime部署GroundingDINO开放世界目标检测,包含C++和Python两个版本的程序

项目2 Groundingdino模型在昇腾Altas平台上的部署_e10042: generateofflinemodel execute failed. trace-CSDN博客

当前已从项目1中获取grounding dino的onnx模型并完成推理,然后根据项目2中提到的算子不适配的情况进行模型结构修改。在删除/Concat_3467前的Unsqueeze节点和ConstantOfShape节点后,使用ATC转换模型时报错:

...Warning: set_tiling_params does not take effect because get_op_mode is dynamic
.....Warning: set_tiling_params does not take effect because get_op_mode is dynamic
Warning: set_tiling_params does not take effect because get_op_mode is dynamic
Warning: set_tiling_params does not take effect because get_op_mode is dynamic
.Warning: set_tiling_params does not take effect because get_op_mode is dynamic
.......Warning: set_tiling_params does not take effect because get_op_mode is dynamic
........Warning: set_tiling_params does not take effect because get_op_mode is dynamic
.....Warning: set_tiling_params does not take effect because get_op_mode is dynamic
...................
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E40021: [PID: 562866] 2025-09-18-16:16:44.155.400 Failed to compile Op [/backbone/backbone.0/layers.0/blocks.0/attn/Add]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/add.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/8.0.0/python/site-packages/tbe/tvm/error_mgr/tbe_python_error_mgr.py", line 111, in raise_tbe_python_err
    raise TBEPythonError(args_dict)
tvm.error_mgr.tbe_python_error_mgr.TBEPythonError:
[errClass:N/A]
[errCode:EB0500]
[message:can't find json file /data/lwq/kernel_meta/kernel_meta_3341548427549453646/kernel_meta/te_add_c2fda1af1ac02119cbdaa9b4f4b17959f50c7f8485563b997b7c082498b7cd44/te_add_c2fda1af1ac02119cbdaa9b4f4b17959f50c7f8485563b997b7c082498b7cd44_212100000.json, probably due to error in subprocess or cases with duplicate names.]
[errPcause:N/A]
[errSolution:N/A]
], optype: [Add])
        Solution: See the host log for details, and then check the Python stack where the error log is reported.
        TraceBack (most recent call last):
        op[SwinAttentionScoreFusionPass], The dims of bmm1_node input0 should be greater than 3.[FUNC:Fusion][FILE:swin_attention_score_fusion_pass.cc][LINE:263]
        Failed to compile Op [/backbone/backbone.0/layers.0/blocks.0/attn/Add]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/add.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/8.0.0/python/site-packages/tbe/tvm/error_mgr/tbe_python_error_mgr.py", line 111, in raise_tbe_python_err
    raise TBEPythonError(args_dict)
tvm.error_mgr.tbe_python_error_mgr.TBEPythonError:
[errClass:N/A]
[errCode:EB0500]
[message:can't find json file /data/lwq/kernel_meta/kernel_meta_3341548427549453646/kernel_meta/te_add_c2fda1af1ac02119cbdaa9b4f4b17959f50c7f8485563b997b7c082498b7cd44/te_add_c2fda1af1ac02119cbdaa9b4f4b17959f50c7f8485563b997b7c082498b7cd44_212100000.json, probably due to error in subprocess or cases with duplicate names.]
[errPcause:N/A]
[errSolution:N/A]
], optype: [Add])
        Compile op[/backbone/backbone.0/layers.0/blocks.0/attn/Add] failed, oppath[/usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/add.py], optype[Add], taskID[895]. Please check op's compilation error message.[FUNC:ReportBuildErrMessage][FILE:fusion_manager.cc][LINE:367]
        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[281466176981632] recompile single op[/backbone/backbone.0/layers.0/blocks.1/attn/Add] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]
        [SubGraphOpt][Compile][ParalCompOp] Thread[281466176981632] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]
        [SubGraphOpt][Compile][CompOpOnly] CompileOp failed.[FUNC:CompileOpOnly][FILE:op_compiler.cc][LINE:1190]
        [GraphOpt][FusedGraph][RunCompile] Failed to compile graph with compiler Normal mode Op Compiler[FUNC:SubGraphCompile][FILE:fe_graph_optimizer.cc][LINE:1410]
        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition11_rank145_new_sub_graph3061[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]
        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[281471604935296] recompile single op[/backbone/backbone.0/layers.0/blocks.0/attn/Add] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]
        [SubGraphOpt][Compile][ParalCompOp] Thread[281471604935296] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]
        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition11_rank67_new_sub_graph2908[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]
        subgraph 248 optimize failed[FUNC:OptimizeSubGraphWithMultiThreads][FILE:graph_manager.cc][LINE:815]
        Failed to compile Op [/backbone/backbone.0/layers.1/blocks.0/attn/Add]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/add.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/8.0.0/python/site-packages/tbe/tvm/_ffi/_ctypes/packed_func.py", line 239, in __call__
    raise get_last_ffi_error()
tvm._ffi.base.TVMError: {'errClass': 'Inner Error', 'errCode': '[EB9000]', 'message': 'Traceback (most recent call last):
  8: TVMFuncCall
  7: 0x0000ffff95c03f67
  6: ascend_tvm::PreProcessModuleForBuild(ascend_tvm::runtime::Map<ascend_tvm::Target, ascend_tvm::IRModule, void, void> const&, ascend_tvm::Target const&)
  5: ascend_tvm::codegen::Build(ascend_tvm::IRModule, ascend_tvm::Target)
  4: 0x0000ffff98160047
  3: ascend_tvm::tir::CCECodegenImpl(ascend_tvm::IRModule const&, ascend_tvm::Target)
  2: ascend_tvm::tir::AnalyseUseDef(ascend_tvm::tir::CCEPrimFunc&, bool)
  1: ascend_tvm::runtime::detail::LogFatal::Entry::Finalize()
  0: ascend_tvm::runtime::Backtrace()
  File "analyse_usedef.cc", line 259

TVMError: [EB9000] Check failed: (is_input_arg) is false: cce_func name te_add_865fa137adb0918c657a921207b1ed8ff54e088054477de08512e0a0026c96dc  Variable i0 does not appear in args', 'errPcause': 'N/A', 'errSolution': 'N/A'}

], optype: [Add])
        Compile op[/backbone/backbone.0/layers.1/blocks.0/attn/Add] failed, oppath[/usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/add.py], optype[Add], taskID[1120]. Please check op's compilation error message.[FUNC:ReportBuildErrMessage][FILE:fusion_manager.cc][LINE:367]
        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[281471681022592] recompile single op[/backbone/backbone.0/layers.1/blocks.1/attn/Add] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]
        [SubGraphOpt][Compile][ParalCompOp] Thread[281471681022592] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]
        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition11_rank338_new_sub_graph3442[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]
        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[281471638751872] recompile single op[/backbone/backbone.0/layers.1/blocks.0/attn/Add] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]
        [SubGraphOpt][Compile][ParalCompOp] Thread[281471638751872] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]
        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition11_rank260_new_sub_graph3289[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]
        build graph failed, graph id:0, ret:4294967295[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1618]
        GenerateOfflineModel execute failed.

在只删除Concat_3467前的Unsqueeze节点的情况下,atc转换报错:


ATC start working now, please wait for a moment.

...Warning: set_tiling_params does not take effect because get_op_mode is dynamic

Warning: set_tiling_params does not take effect because get_op_mode is dynamic

.Warning: set_tiling_params does not take effect because get_op_mode is dynamic

............

ATC run failed, Please check the detail log, Try 'atc --help' for more information

E40021: [PID: 578555] 2025-09-18-16:25:25.877.652 Failed to compile Op [/Concat_5,[/Concat_5,/Concat_5]]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/concat_d.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/tbe/common/utils/para_check.py", line 638, in _check_dynamic_shape

    raise RuntimeError(

RuntimeError: ({'errCode': 'E80002', 'op_name': 'concat_d', 'param_name': 'input_values', 'min_value': '-2', 'max_value': 9223372036854775807, 'real_value': -3}, 'In op, the parameter[input_values] should be in the range of [-2, 9223372036854775807], but actually is [-3].')

], optype: [ConcatD])

        Solution: See the host log for details, and then check the Python stack where the error log is reported.

        TraceBack (most recent call last):

        op[SwinAttentionScoreFusionPass], The dims of bmm1_node input0 should be greater than 3.[FUNC:Fusion][FILE:swin_attention_score_fusion_pass.cc][LINE:263]

        Failed to compile Op [/Concat_5,[/Concat_5,/Concat_5]]. (oppath: [Compile /usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/concat_d.py failed with errormsg/stack: File "/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/tbe/common/utils/para_check.py", line 638, in _check_dynamic_shape

    raise RuntimeError(

RuntimeError: ({'errCode': 'E80002', 'op_name': 'concat_d', 'param_name': 'input_values', 'min_value': '-2', 'max_value': 9223372036854775807, 'real_value': -3}, 'In op, the parameter[input_values] should be in the range of [-2, 9223372036854775807], but actually is [-3].')

], optype: [ConcatD])

        Compile op[/Concat_5,[/Concat_5,/Concat_5]] failed, oppath[/usr/local/Ascend/ascend-toolkit/8.0.0/opp/built-in/op_impl/ai_core/tbe/impl/dynamic/concat_d.py], optype[ConcatD], taskID[779]. Please check op's compilation error message.[FUNC:ReportBuildErrMessage][FILE:fusion_manager.cc][LINE:367]

        [SubGraphOpt][Compile][ProcFailedCompTask] Thread[281472214682240] recompile single op[/Concat_5] failed[FUNC:ProcessAllFailedCompileTasks][FILE:tbe_op_store_adapter.cc][LINE:1069]

        [SubGraphOpt][Compile][ParalCompOp] Thread[281472214682240] process fail task failed[FUNC:ParallelCompileOp][FILE:tbe_op_store_adapter.cc][LINE:1116]

        [SubGraphOpt][Compile][CompOpOnly] CompileOp failed.[FUNC:CompileOpOnly][FILE:op_compiler.cc][LINE:1190]

        [GraphOpt][FusedGraph][RunCompile] Failed to compile graph with compiler Normal mode Op Compiler[FUNC:SubGraphCompile][FILE:fe_graph_optimizer.cc][LINE:1410]

        Call OptimizeFusedGraph failed, ret:4294967295, engine_name:AIcoreEngine, graph_name:partition9_rank5_new_sub_graph7[FUNC:OptimizeSubGraph][FILE:graph_optimize.cc][LINE:119]

        subgraph 171 optimize failed[FUNC:OptimizeSubGraphWithMultiThreads][FILE:graph_manager.cc][LINE:815]

        build graph failed, graph id:0, ret:4294967295[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1618]

        GenerateOfflineModel execute failed.

请问应该怎么对模型结构进行修改呢?

本帖最后由 匿名用户2025/09/19 14:52:48 编辑

我要发帖子