Possible incorrect INT8 Q/DQ depthwise Conv + Concat output in TensorRT 11.3 on RTX 5060
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- ai-infra-agents
Direzione di ricerca
The issue is a suspected INT8 Q/DQ layout or stride bug in the TensorRT 11.3 optimized path, reproduced by the attached repro.onnx, input.npz, reproduce.py and inspector JSON files. Start by running reproduce.py at opt level 0 and 3 to confirm the RMSE gap, then compare the depthwise Conv output strides in inspector_trt11.json against inspector_trt10.json. Done would mean a root cause isolated to a writer, reader or metadata component, which requires engine internals rather than a simple edit.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
I observed a large output mismatch between TensorRT 11.3.0.99 and ONNX Runtime for a reduced INT8 Q/DQ convolution graph on an RTX 5060 under WSL2. TensorRT 10.13.3.9 produces output much closer to ONNX Runtime on the same GPU and input.
The attached repro is a 48-node, fully synthetic model. All model weights and the input are generated from fixed random seeds; it contains no pretrained weights or images. The model has FP32 input and output, explicit INT8 Q/DQ, and approximately this structure:
input [1,128,160,160]
-> INT8 Q/DQ -> depthwise Conv (groups=128, stride=2)
-> six ordinary Conv + ReLU stages, with intermediate branches
-> Concat (128 + 6*96 = 704 channels)
-> INT8 Q/DQ -> 1x1 Conv + ReLU
-> output [1,256,80,80]
With ONNX Runtime CPU as the reference, I obtain:
Backend :TensorRT 11.3.0.99 Builder optimization level:0 Relative RMSE:0.916985 Cosine similarity:0.402695
Relative RMSE is sqrt(mean((TRT - ORT)^2)) / sqrt(mean(ORT^2)). All outputs were finite. The comparison uses a single fixed synthetic input, not model accuracy or mAP. Both TensorRT versions were tested in separate Python environments; their binary dependencies can differ.
I also tested ONNX Runtime CUDAExecutionProvider; profiling showed 40 CUDA node events. Its output differs from ORT CPU by relative RMSE 0.0563 and maximum absolute error 0.0296; I have not separately investigated that difference. Relative to the ORT CUDA result, TensorRT 11.3 level 0 still has relative RMSE 0.9170, while TensorRT 10 has 0.0563. The attached reproduction script uses ORT CPU so that the CUDA execution provider is not required.
Environment
TensorRT Version: 11.3.0.99 (tensorrt_cu13); comparison: 10.13.3.9 (tensorrt_cu13)
NVIDIA GPU: GeForce RTX 5060, compute capability 12.0
NVIDIA Driver Version: WSL nvidia-smi reports KMD 610.62, NVIDIA-SMI 610.43.02, CUDA UMD 13.3
CUDA Version: nvcc reports toolkit 13.4.92; PyTorch reports build CUDA 13.2; installed Python CUDA runtime package is 13.2.75
CUDNN Version: PyTorch reports 9.26.0; installed packages include nvidia-cudnn-cu12==9.26.0.51 and nvidia-cudnn-cu13==9.24.0.43. The exact cuDNN dependency, if any, used by this engine has not been determined.
Operating System: Ubuntu 22.04.5 LTS under WSL2, kernel 6.18.33.2-microsoft-standard-WSL2, x86_64
Python Version: 3.10.21
PyTorch Version: 2.14.0+cu132
ONNX / ONNX Runtime / NumPy: 1.21.0 / 1.22.0 / 2.2.6; ORT reference uses CPUExecutionProvider
Baremetal or Container: WSL2, no container
Builder settings: strongly typed, 512 MiB workspace, TF32 enabled by default, optimization levels 0 and 3 as shown above. Engine input/output are LINEAR FP32.
The driver/toolkit mix may be relevant. The CUDA 13.4 release notes list R615 as the corresponding driver branch, while CUDA 13.x minor-version compatibility permits older R580+ drivers with feature limitations. I have not tested an R615 driver or native Linux and would appreciate confirmation that this environment is supported.
Relevant Files
Attached: trt11_int8_qdq_repro.zip.
- repro.onnx and input.npz: fixed synthetic model and input.
- generate_repro.py: generates the model and input independently.
- reproduce.py: builds and runs TensorRT and compares against ORT CPU.
- trace_unfused.py and analyze_layout.py: optional intermediate-tensor investigation.
- inspector_trt10.json, inspector_trt11.json, and results_*.json: captured layer information and results.
Steps To Reproduce
In a Python environment with NumPy, ONNX Runtime CPU, CUDA-enabled PyTorch, and TensorRT 11.3.0.99:
`unzip trt11_int8_qdq_repro.zip
cd trt11_int8_qdq_repro
python reproduce.py --model repro.onnx --input input.npz
--expected-version 11.3.0.99 --opt-level 0 --output result_11.npz
On the reporting machine this avoids the large error for the reduced graph:
python reproduce.py --model repro.onnx --input input.npz
--expected-version 11.3.0.99 --opt-level 3 --output result_11_opt3.npzIn a separate Python environment with TensorRT 10.13.3.9, using the same supplied model and input:python reproduce.py --model repro.onnx --input input.npz
--expected-version 10.13.3.9 --opt-level 0 --output result_10.npz`
Each run prints the loaded versions, hashes and metrics and saves ORT and TensorRT output tensors. README.md also documents an optional unfused-tensor trace and how to regenerate the synthetic model and input.
Have you tried the latest release? No. I have not yet tested TensorRT 11.4.1, a newer driver, or native Linux.
Can this model run on other frameworks? Yes. ONNX Runtime 1.22.0 CPUExecutionProvider runs it; TensorRT 10.13.3.9 with the settings above is close to that output.
Additional investigation
The TensorRT 11.3 level-0 Engine Inspector reports the depthwise Conv output as an INT8 view with logical shape [1,128,80,80] and strides [4505600,1,56320,704]. TensorRT 10's engine includes separate Concat-related reformat/copy layers. A stride of 704 is valid for a properly populated 704-channel Concat buffer; the stride alone does not prove an error.
With unfused tensor debugging enabled, the final TensorRT 11.3 output is bit-identical to the non-debug engine output on this input. In the captured depthwise output, a simulation that packs the ORT-quantized 128-channel output densely in NHWC, zero-fills the remaining region, and reads using the 704-channel view reproduces the captured INT8 tensor exactly. Feeding that captured tensor into an ORT downstream subgraph yields a relative RMSE of 0.0102 against the TensorRT 11.3 output, versus 0.9170 when feeding the normal ORT tensor.
This suggests a possible layout/stride inconsistency in the optimized path, but I have not established whether the writer, reader, optimizer metadata, debug capture, driver/toolkit interaction, or another component is responsible. Could NVIDIA help confirm whether the attached case is expected to be supported and whether this is a known issue?
- Lingua principale
- C++
- Stelle
- 13.5k
- Fork
- 2.4k
- Merge medio
- 6g 21h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/TensorRT
-
Module:Polygraphy
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 6 giorni
-
Polygraphy NumPy Top-K sorts unsigned and minimum signed integers incorrectlyForse già presa @0z5a l’ha presa 16 giorni fa. ApertaModule:Polygraphy
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 6 giorni
-
Polygraphy INT32 comparison can overflow and falsely pass at zero toleranceForse già presa @0z5a l’ha presa 16 giorni fa. ApertaModule:Polygraphy
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 6 giorni
-
onnx-graphsurgeon: Graph.toposort() hits RecursionError when a graph has a local function and an If/Loop nodeForse già presa @gabortar l’ha presa 39 giorni fa. ApertaModule:GraphSurgeon
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 6 giorni
-
Polygraphy parse_meta accepts a shape with a missing bracketForse già presa @SashaMIT l’ha presa 51 giorni fa. ApertaModule:Polygraphy
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di NVIDIA/TensorRT
Issue simili
-
[UBSan] spawn_simulator passes null child_options.args to uv_spawn (execvp nonnull violation)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
tenstorrent/tt-umd#4017 ·
I maintainer di solito rispondono entro 3 giorni
-
difficulty:easy func:gui prio:low type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/Natron#1538 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hyprwm/hyprsunset#103 · 1 commento ·
-
Feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qbittorrent/qBittorrent#25338 ·
I maintainer di solito rispondono entro 2 giorni
-
Needs: Attention Needs: Version Info Platform: Android Platform: tvOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
react/react-native#60180 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni