TensorRT Lean cannot deserialize engine built in full TensorRT (ReformatRunner error)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Summary
I am unable to load a .trt engine using tensorrt_lean runtime. The engine fails during deserialization with a ReformatRunner error, even though the setup is inference-only and uses a CUDA runtime container.
Environment
Docker base image: nvidia/cuda:13.1.2-cudnn-runtime-ubuntu24.04
TensorRT version: 10.16.1.11 (tensorrt_lean)
Python: 3.12
GPU: NVIDIA GPU (CUDA enabled container)
Engine format: .trt (prebuilt outside container)
Installed packages
tensorrt_lean
numpy
Issue description
When trying to deserialize a TensorRT engine using:
import tensorrt_lean as trt
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
runtime = trt.Runtime(TRT_LOGGER)
with open("trt_weights_f16/mos.trt", "rb") as f:
engine = runtime.deserialize_cuda_engine(f.read())
The following error occurs:
[TRT] [E] IRuntime::deserializeCudaEngine: Error Code 1: Internal Error
Unexpected call to stub loadRunner for ReformatRunner
As a result:
engine is None
and inference cannot proceed.
Expected behavior
The engine should deserialize successfully and allow inference using:
context = engine.create_execution_context()
context.execute_async_v3(...)
Actual behavior
Engine fails during deserialization
ReformatRunner stub error is triggered
engine == None
No inference possible
What I tried
Switching to inference-only CUDA runtime image
Using tensorrt_lean instead of full TensorRT
Minimal Python inference script (no PyCUDA, no training dependencies)
Verifying engine file path and loading logic
Key observation
The engine was built using a full TensorRT environment, and fails when loaded with tensorrt_lean.
It seems that tensorrt_lean does not support certain internal runners (e.g., ReformatRunner) required by the engine.
Question
Is there a compatibility requirement between:
TensorRT engine build environment
TensorRT Lean runtime
Specifically:
Are engines built with full TensorRT incompatible with Lean runtime?
Is there a required “Lean-compatible engine export” workflow?
Additional context
This setup is intended for inference-only deployment, and the goal was to use a minimal runtime container without full TensorRT SDK.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the minimal Python script at runtime.deserialize_cuda_engine using the full-TensorRT-built .trt engine and tensorrt_lean runtime. Compare the engine build and runtime requirements; done means establishing whether this combination is supported and documenting the required compatibility or export workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100