Skip to content

Mismatched type for tensor __mye30106_shape, i64 vs. expected type:b. #4538

@CallmeZhangChenchen

Description

@CallmeZhangChenchen

My onnx information
https://drive.google.com/file/d/1w8h8IisRseRUh8e9kTMoJdqXAtBriK7w/view?usp=sharing

./llm.decoder.llm.fp32.onnx.sim
----------------- input -----------------
{'name': 'lm_input', 'shape': [1, 'seq_len', 1024], 'type': 'tensor(float)'}
{'name': 'att_cache',
 'shape': [1, 14, 16, 'seq_len', 128],
 'type': 'tensor(float)'}
{'name': 'att_mask',
 'shape': [1, 'seq_len', 'seq_len'],
 'type': 'tensor(int32)'}
----------------- output -----------------
{'name': 'xs', 'shape': [1, 'Addxs_dim_1', 1024], 'type': 'tensor(float)'}
{'name': 'r_att_cache',
 'shape': [14, 16, 'Concatr_att_cache_dim_2', 128],
 'type': 'tensor(float)'}

converted command

/usr/src/tensorrt/bin/trtexec --onnx=llm.decoder.llm.fp32.onnx --minShapes=lm_input:1x1x1024,att_cache:1x14x16x1x128,att_mask:1x1x1 --optShapes=lm_input:1x1x1024,att_cache:1x14x16x100x128,att_mask:1x1x1 --maxShapes=lm_input:1x100x1024,att_cache:1x14x16x500x128,att_mask:1x100x100 --iterations=5  --saveEngine=test.engine

error message

[07/31/2025-10:14:27] [I] TensorRT version: 10.7.0
[07/31/2025-10:14:27] [I] Loading standard plugins
[07/31/2025-10:14:27] [I] [TRT] [MemUsageChange] Init CUDA: CPU +2, GPU +0, now: CPU 21, GPU 390 (MiB)
[07/31/2025-10:14:30] [I] [TRT] [MemUsageChange] Init builder kernel library: CPU +2283, GPU +440, now: CPU 2460, GPU 830 (MiB)
[07/31/2025-10:14:30] [I] Start parsing network model.
[07/31/2025-10:14:32] [I] [TRT] ----------------------------------------------------------------
[07/31/2025-10:14:32] [I] [TRT] Input filename:   llm.decoder.llm.fp32.onnx
[07/31/2025-10:14:32] [I] [TRT] ONNX IR version:  0.0.8
[07/31/2025-10:14:32] [I] [TRT] Opset version:    18
[07/31/2025-10:14:32] [I] [TRT] Producer name:    pytorch
[07/31/2025-10:14:32] [I] [TRT] Producer version: 2.7.0
[07/31/2025-10:14:32] [I] [TRT] Domain:           
[07/31/2025-10:14:32] [I] [TRT] Model version:    0
[07/31/2025-10:14:32] [I] [TRT] Doc string:       
[07/31/2025-10:14:32] [I] [TRT] ----------------------------------------------------------------
[07/31/2025-10:14:32] [I] Finished parsing network model. Parse time: 1.25075
[07/31/2025-10:14:32] [I] Set shape of input tensor lm_input for optimization profile 0 to: MIN=1x1x1024 OPT=1x1x1024 MAX=1x100x1024
[07/31/2025-10:14:32] [I] Set shape of input tensor att_cache for optimization profile 0 to: MIN=1x14x16x1x128 OPT=1x14x16x100x128 MAX=1x14x16x500x128
[07/31/2025-10:14:32] [I] Set shape of input tensor att_mask for optimization profile 0 to: MIN=1x1x1 OPT=1x1x1 MAX=1x100x100
[07/31/2025-10:14:32] [I] [TRT] Local timing cache in use. Profiling results in this builder pass will not be stored.
[07/31/2025-10:14:32] [I] [TRT] Compiler backend is used during engine build.
[07/31/2025-10:14:32] [E] Error[9]: Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [shape.cpp:verify_output_type:1568] Mismatched type for tensor __mye30106_shape, i64 vs. expected type:b.
[07/31/2025-10:14:32] [E] Error[10]: IBuilder::buildSerializedNetwork: Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[/encoders.0/self_attn/Cast_2.../after_norm/LayerNormalization]}.)
[07/31/2025-10:14:32] [E] Engine could not be created from network
[07/31/2025-10:14:32] [E] Building engine failed
[07/31/2025-10:14:32] [E] Failed to create engine from model or file.
[07/31/2025-10:14:32] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v100700] [b23] # /usr/src/tensorrt/bin/trtexec --onnx=llm.decoder.llm.fp32.onnx --minShapes=lm_input:1x1x1024,att_cache:1x14x16x1x128,att_mask:1x1x1 --optShapes=lm_input:1x1x1024,att_cache:1x14x16x100x128,att_mask:1x1x1 --maxShapes=lm_input:1x100x1024,att_cache:1x14x16x500x128,att_mask:1x100x100 --iterations=5 --saveEngine=test.engine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module:ONNXIssues relating to ONNX usage and import

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions