EngineDeadError message compounds a prefix each time it is unpickled
System Info
- TensorRT-LLM: 1.3.0rc23 (built from
f20ea652); behaviour re-checked againstmain@fbda11f5 - GPU: NVIDIA GeForce RTX 5090 (sm_120), driver 595.71.05
- PyTorch 2.11.0+cu130, CUDA 13.0, Python 3.12.13
- Ubuntu 25.10, kernel 6.17.0-41-generic
- Backend: PyTorch; single GPU, no TP/PP
- Model where observed: Qwen3.6-35B-A3B-NVFP4 with FP8 KV cache (where model-specific)
Who can help?
No response
Reproduction
EngineDeadError.__init__ renders root_cause into the message, and default exception pickling
round-trips through args — which holds that rendered message. Unpickling re-invokes __init__ with
the message string as the cause, so the prefix is prepended again on every hop:
original : Engine has died: RuntimeError: PyExecutor has already been shutdown
1 hop : Engine has died: str: Engine has died: RuntimeError: PyExecutor has already been shutdown
2 hops : Engine has died: str: Engine has died: str: Engine has died: RuntimeError: ...The class is raised when a worker process dies, i.e. exactly where it crosses a process boundary, so the mangled text is the form users are most likely to encounter.
Expected behavior
An EngineDeadError reconstructed in another process renders the same message as the original.
actual behavior
Each unpickle prepends the prefix again, so the message grows one 'Engine has died: str: ' per hop. .root_cause is unaffected.
additional notes
Message only. __dict__ is restored after __init__, so .root_cause survives as the original
exception and the attribute contract holds. This is log legibility and unbounded message growth, not
a broken consumer contract.
Add __reduce__ returning (self.__class__, (self.root_cause,)) so reconstruction uses the cause
rather than the rendered text. root_cause is already pickled as part of __dict__, so no new
picklability requirement is introduced.
We have the patch with four CPU-only tests (2 fail before, 4 pass after) and are raising this Issue Request first per CONTRIBUTING.md.
Questions for maintainers
- Would you prefer
__reduce__, or moving the rendering out of__init__into__str__soargsnever holds the formatted text? - Are there other exception types in
tensorrt_llm/executorthat render constructor arguments into the message and would have the same issue?
Source: NVIDIA/TensorRT-LLM