NVIDIA / NVIDIA/TensorRT

IAttention failure of TensorRT 10.14 when running serilization on GPU RTX4080

Open
#4,705 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:ONNX
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

Description

Cannot use IAttention. Originally i tried build network SDK (i.e. network->addAttention), it failed, so i did some tests.

I build a dummy attention layer with ONNX opset v23. Error when exporting.

command:

trtexec --verbose --stronglyTyped --onnx=models/attn_export/1attn_attention_opset23.onnx

1 layer:

[02/26/2026-09:23:18] [I] Start parsing network model.
[02/26/2026-09:23:18] [I] [TRT] ----------------------------------------------------------------
[02/26/2026-09:23:18] [I] [TRT] Input filename:   models/attn_export/1attn_attention_opset23.onnx
[02/26/2026-09:23:18] [I] [TRT] ONNX IR version:  0.0.11
[02/26/2026-09:23:18] [I] [TRT] Opset version:    23
[02/26/2026-09:23:18] [I] [TRT] Producer name:    
[02/26/2026-09:23:18] [I] [TRT] Producer version: 
[02/26/2026-09:23:18] [I] [TRT] Domain:           
[02/26/2026-09:23:18] [I] [TRT] Model version:    0
[02/26/2026-09:23:18] [I] [TRT] Doc string:       
[02/26/2026-09:23:18] [I] [TRT] ----------------------------------------------------------------
[02/26/2026-09:23:18] [V] [TRT] Adding network input: x with dtype: float16, dimensions: (1, 8, 128, 512)
[02/26/2026-09:23:18] [V] [TRT] Registering tensor: x for ONNX tensor: x
[02/26/2026-09:23:18] [V] [TRT] Static check for parsing node: attn_1 [Attention]
[02/26/2026-09:23:18] [V] [TRT] Parsing node: attn_1 [Attention]
[02/26/2026-09:23:18] [V] [TRT] Searching for input: x
[02/26/2026-09:23:18] [V] [TRT] Searching for input: x
[02/26/2026-09:23:18] [V] [TRT] Searching for input: x
[02/26/2026-09:23:18] [V] [TRT] attn_1 [Attention] inputs: [x -> (1, 8, 128, 512)[HALF]], [x -> (1, 8, 128, 512)[HALF]], [x -> (1, 8, 128, 512)[HALF]], 
[02/26/2026-09:23:18] [V] [TRT] Registering layer: ONNXTRT_castHelper required by ONNX-TRT
[02/26/2026-09:23:18] [V] [TRT] Registering layer: ONNXTRT_castHelper_1 required by ONNX-TRT
[02/26/2026-09:23:18] [V] [TRT] Registering tensor: y1_2 for ONNX tensor: y1
[02/26/2026-09:23:18] [V] [TRT] attn_1 [Attention] outputs: [y1 -> (1, 8, 128, 512)[HALF]], 
[02/26/2026-09:23:18] [V] [TRT] Marking y1_2 as output: y1
[02/26/2026-09:23:18] [I] Finished parsing network model. Parse time: 0.000553871
[02/26/2026-09:23:18] [V] [TRT] could not open /sys/fs/cgroup/memory/memory.limit_in_bytes or /sys/fs/cgroup/memory.max
[02/26/2026-09:23:18] [V] [TRT] Trying to load shared library libnvinfer_builder_resource_sm89.so.10.14.1
[02/26/2026-09:23:18] [V] [TRT] Loaded shared library libnvinfer_builder_resource_sm89.so.10.14.1
[02/26/2026-09:23:18] [I] [TRT] [MemUsageChange] Init builder kernel library: CPU +204, GPU +4, now: CPU 434, GPU 1154 (MiB)
[02/26/2026-09:23:18] [V] [TRT] Original: 8 layers
[02/26/2026-09:23:18] [V] [TRT] After dead-layer removal: 8 layers
[02/26/2026-09:23:18] [V] [TRT] SYMBOLIC CHECKS
[02/26/2026-09:23:18] [V] [TRT] GRAPH NODES
[02/26/2026-09:23:18] [V] [TRT] CONSTANT (Unnamed Layer* 0) [Constant]
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT] CAST ONNXTRT_castHelper
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT] ELEMENTWISE (Unnamed Layer* 2) [ElementWise]
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Input 1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT] CONSTANT (Unnamed Layer* 3) [Constant]
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT] CAST ONNXTRT_castHelper_1
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT] ELEMENTWISE (Unnamed Layer* 5) [ElementWise]
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Input 1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT] ATTENTION_INPUT (Unnamed Layer* 7) [AttentionInput]
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Input 1
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Input 2
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT] ATTENTION_OUTPUT (Unnamed Layer* 8) [AttentionOutput]
[02/26/2026-09:23:18] [V] [TRT]     Input 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT]     Output 0
[02/26/2026-09:23:18] [V] [TRT]         1       1
[02/26/2026-09:23:18] [V] [TRT]         8       8
[02/26/2026-09:23:18] [V] [TRT]         128     128
[02/26/2026-09:23:18] [V] [TRT]         512     512
[02/26/2026-09:23:18] [V] [TRT] Graph construction completed in 0.000633728 seconds.
[02/26/2026-09:23:18] [V] [TRT] After adding DebugOutput nodes: 8 layers
[02/26/2026-09:23:18] [V] [TRT] After Myelin optimization: 1 layers
[02/26/2026-09:23:18] [V] [TRT] Applying ScaleNodes fusions.
[02/26/2026-09:23:18] [V] [TRT] After scale fusion: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After dupe layer removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After final dead-layer removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After tensor merging: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After vertical fusions: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After dupe layer removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After final dead-layer removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After tensor merging: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After slice removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] After concat removal: 1 layers
[02/26/2026-09:23:18] [V] [TRT] Trying to split Reshape and strided tensor
[02/26/2026-09:23:18] [V] [TRT] Graph optimization time: 0.000291817 seconds.
[02/26/2026-09:23:18] [V] [TRT] Building graph using backend strategy 2
[02/26/2026-09:23:18] [I] [TRT] Local timing cache in use. Profiling results in this builder pass will not be stored.
[02/26/2026-09:23:18] [V] [TRT] Constructing optimization profile number 0 [1/1].
[02/26/2026-09:23:18] [V] [TRT] Applying generic optimizations to the graph for inference.
[02/26/2026-09:23:18] [V] [TRT] Reserving memory for host IO tensors. Host: 0 bytes
[02/26/2026-09:23:18] [V] [TRT] =============== Computing costs for {ForeignNode[(Unnamed Layer* 0) [Constant]...(Unnamed Layer* 8) [AttentionOutput]]}
[02/26/2026-09:23:18] [V] [TRT] ForeignNode {ForeignNode[(Unnamed Layer* 0) [Constant]...(Unnamed Layer* 8) [AttentionOutput]]} metadata: 
[02/26/2026-09:23:18] [V] [TRT] *************** Autotuning format combination: Half(524288,65536,512,1) -> Half(524288,65536,512,1) ***************
[02/26/2026-09:23:18] [V] [TRT] --------------- Timing Runner: {ForeignNode[(Unnamed Layer* 0) [Constant]...(Unnamed Layer* 8) [AttentionOutput]]} (Myelin[0x80000023])
[02/26/2026-09:23:18] [I] [TRT] Compiler backend is used during engine build.
[1]    13731 segmentation fault (core dumped)  trtexec --verbose --stronglyTyped

2 layers:

[02/26/2026-09:24:23] [I] Start parsing network model.
[02/26/2026-09:24:23] [I] [TRT] ----------------------------------------------------------------
[02/26/2026-09:24:23] [I] [TRT] Input filename:   models/attn_export/2attn_attention_opset23.onnx
[02/26/2026-09:24:23] [I] [TRT] ONNX IR version:  0.0.11
[02/26/2026-09:24:23] [I] [TRT] Opset version:    23
[02/26/2026-09:24:23] [I] [TRT] Producer name:    
[02/26/2026-09:24:23] [I] [TRT] Producer version: 
[02/26/2026-09:24:23] [I] [TRT] Domain:           
[02/26/2026-09:24:23] [I] [TRT] Model version:    0
[02/26/2026-09:24:23] [I] [TRT] Doc string:       
[02/26/2026-09:24:23] [I] [TRT] ----------------------------------------------------------------
[02/26/2026-09:24:23] [V] [TRT] Adding network input: x with dtype: float16, dimensions: (1, 32, 256, 512)
[02/26/2026-09:24:23] [V] [TRT] Registering tensor: x for ONNX tensor: x
[02/26/2026-09:24:23] [V] [TRT] Static check for parsing node: attn_1 [Attention]
[02/26/2026-09:24:23] [V] [TRT] Parsing node: attn_1 [Attention]
[02/26/2026-09:24:23] [V] [TRT] Searching for input: x
[02/26/2026-09:24:23] [V] [TRT] Searching for input: x
[02/26/2026-09:24:23] [V] [TRT] Searching for input: x
[02/26/2026-09:24:23] [V] [TRT] attn_1 [Attention] inputs: [x -> (1, 32, 256, 512)[HALF]], [x -> (1, 32, 256, 512)[HALF]], [x -> (1, 32, 256, 512)[HALF]], 
[02/26/2026-09:24:23] [V] [TRT] Registering layer: ONNXTRT_castHelper required by ONNX-TRT
[02/26/2026-09:24:23] [V] [TRT] Registering layer: ONNXTRT_castHelper_1 required by ONNX-TRT
[02/26/2026-09:24:23] [V] [TRT] Registering tensor: y1 for ONNX tensor: y1
[02/26/2026-09:24:23] [V] [TRT] attn_1 [Attention] outputs: [y1 -> (1, 32, 256, 512)[HALF]], 
[02/26/2026-09:24:23] [V] [TRT] Static check for parsing node: attn_2 [Attention]
[02/26/2026-09:24:23] [V] [TRT] Parsing node: attn_2 [Attention]
[02/26/2026-09:24:23] [V] [TRT] Searching for input: y1
[02/26/2026-09:24:23] [V] [TRT] Searching for input: y1
[02/26/2026-09:24:23] [V] [TRT] Searching for input: y1
[02/26/2026-09:24:23] [V] [TRT] attn_2 [Attention] inputs: [y1 -> (1, 32, 256, 512)[HALF]], [y1 -> (1, 32, 256, 512)[HALF]], [y1 -> (1, 32, 256, 512)[HALF]], 
[02/26/2026-09:24:23] [V] [TRT] Registering layer: ONNXTRT_castHelper_3 required by ONNX-TRT
[02/26/2026-09:24:23] [V] [TRT] Registering layer: ONNXTRT_castHelper_5 required by ONNX-TRT
[02/26/2026-09:24:23] [E] Error[3]: INetworkDefinition::addAttention: Error Code 3: API Usage Error (Parameter check failed, condition: mScopedOps.size() == mGraph.scopedOps.size().  In addAttention at /_src/optimizer/api/network.cpp:2125)
[02/26/2026-09:24:23] [E] [TRT] ModelImporter.cpp:135: While parsing node number 1 [Attention -> "y2"]:
[02/26/2026-09:24:23] [E] [TRT] ModelImporter.cpp:138: --- Begin node ---
input: "y1"
input: "y1"
input: "y1"
output: "y2"
name: "attn_2"
op_type: "Attention"
attribute {
  name: "scale"
  f: 0.0441941731
  type: FLOAT
}

[02/26/2026-09:24:23] [E] [TRT] ModelImporter.cpp:139: --- End node ---
[02/26/2026-09:24:23] [E] [TRT] ModelImporter.cpp:141: ERROR: ModelImporter.cpp:362 In function parseNode:
[6] Invalid Node - attn_2
INetworkDefinition::addAttention: Error Code 3: API Usage Error (Parameter check failed, condition: mScopedOps.size() == mGraph.scopedOps.size().  In addAttention at /_src/optimizer/api/network.cpp:2125)
[02/26/2026-09:24:23] [E] Failed to parse onnx file
[02/26/2026-09:24:23] [I] Finished parsing network model. Parse time: 0.116632
[02/26/2026-09:24:23] [E] Parsing model failed
[02/26/2026-09:24:23] [E] Failed to create engine from model or file.
[02/26/2026-09:24:23] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v101401] [b48] # trtexec --verbose --stronglyTyped --onnx=models/attn_export/2attn_attention_opset23.onnx

Environment

TensorRT Version: 10.14.1

NVIDIA GPU: RTX 4080

NVIDIA Driver Version: 590.48.01

CUDA Version: 13.1

CUDNN Version: /

Operating System: Ubuntu 22.04

Python Version (if applicable): 3.12

Baremetal or Container (if so, version): Container, based on torch NGC 25.12

Relevant Files

models:

attn_export.zip

Steps To Reproduce

use

export_2attn_onnx.py

Commands or scripts:

python export_2attn_onnx.py --layers 1 --seq 128 --heads 8

or

python export_2attn_onnx.py --layers 2 --seq 128 --heads 8

Have you tried the latest release?: tried TesnsorRT 10.15 on Windows, same error.

Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt): works on cpu, but cannot find a suitable onnxruntime-gpu version

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash with trtexec --verbose --stronglyTyped using models/attn_export/1attn_attention_opset23.onnx and 2attn_attention_opset23.onnx. Start from the Attention parsing and compiler-backend build stages shown in the logs; done means the TensorRT engine build no longer ends in a segmentation fault for the supplied models.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
ai, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.