Torch-TensorRT v2.13.0
Torch-TensorRT 2.13.0 Linux x86-64 and Windows targets
PyTorch 2.13, CUDA 13.0/13.2, TensorRT 11.0, Python 3.10~3.13
Torch-TensorRT Wheels are available:
x86-64 Linux and Windows:
CUDA 13.0/13.2 + Python 3.10-3.13 is Available via PyPI
- https://pypi.org/project/torch-tensorrt/
- Available via PyTorch index: https://download.pytorch.org/whl/torch-tensorrt
aarch64 SBSA Linux and Jetson Thor and Orin:
CUDA 13.0/13.2 + Python 3.10–3.13 + Torch 2.13 + TensorRT 11.0
- Available via PyPI: https://pypi.org/project/torch-tensorrt/
- Available via PyTorch index: https://download.pytorch.org/whl/torch-tensorrt
Torch-TensorRT-RTX 2.13.0 Linux x86-64 and Windows targets
PyTorch 2.13, CUDA 13.0/13.2, TensorRT-RTX 1.5, Python 3.10~3.13
Torch-TensorRT-RTX Wheels are available:
x86-64 Linux and Windows:
CUDA 13.0/13.2 + Python 3.10-3.13 is Available via PyPI
CUDA 13.0/13.2 + Python 3.10-3.13 is also Available via Pytorch Index
New Features:
GQA/MQA and Decode-Phase Attention Support
Extends Group Query Attention (GQA) and Multi-Query Attention (MQA) alongside traditional Multi-Head Attention (MHA), enabling efficient inference for modern large language models. This release relaxes SDPA validator constraints to allow variable head-count configurations, adds native support for decode-phase attention where query and key sequences differ, and introduces comprehensive HLO-level test coverage across all three attention kernel variants (standard, flash, efficient) with multiple precision levels (fp16, bf16, fp32). These changes unlock optimized inference patterns for LLMs using GQA/MQA while maintaining full backward compatibility with existing MHA-based models.
FP8 Attention Quantization Support
Supports FP8 quantization of the attention in both TensorRT's IAttention path and decomposed attention path (decompose_attention=True). Working with NVIDIA ModelOpt, it detects when attention inputs (Q, K, V) are quantized to FP8 and configures TensorRT's native FP8 MHA kernel for optimal performance on FP8-capable hardware (Hopper and newer GPUs). A ViT quantization example demonstrates both IAttention and decomposed attention paths.
Caller-Selected CUDA Streams and Green Context Support
Enables TensorRT inference on caller-selected CUDA streams across both Torch-TensorRT and ExecuTorch. The PyTorch runtime now respects active non-default streams, while ExecuTorch introduces a scoped CudaStreamGuard API. This supports CUDA Green Contexts, NCCL streams, and custom GPU scheduling without changing default-stream behavior. CUDA Graphs are recaptured when streams change, and completion events safely protect asynchronous execution-context reuse.
TensorRT 11 Support
Torch-TensorRT 2.13 adds support for NVIDIA TensorRT 11, with release packages updated to TensorRT 11.0. The integration has been updated for TensorRT 11 APIs across compilation, runtime execution, packaging, and distributed inference.
Highlights:
- TensorRT 11.0 support for Python and C++ workflows.
- Updated CUDA 12 and CUDA 13 package dependencies for TensorRT 11.
- Updated distributed and NCCL-based operators for TensorRT 11.
- Improved scaled dot-product attention accuracy using TensorRT 11 fixes.
- Updated build configurations, CI coverage, and prebuilt release artifacts for TensorRT 11.
TensorRT 11 is the default supported TensorRT version for Torch-TensorRT 2.13 release packages.
ExecuTorch Support
This release delivers a pure ExecuTorch TensorRT backend for deploying TensorRT-accelerated models in ExecuTorch .pte format. The native runtime path no longer depends on Torch or LibTorch, enabling lightweight C++ deployment using only ExecuTorch and TensorRT runtime components.
Users can continue exporting TensorRT-compiled ExportedProgram and FX models with:
torch_tensorrt.save(model, "model.pte", output_format="executorch")
Highlights:
- Pure ExecuTorch native backend with no Torch or LibTorch runtime dependency.
- Support for TensorRT output allocators and data-dependent output shapes.
- Support for embedding TensorRT engine payloads larger than 2 GiB in .pte files.
- Target-device selection during ExecuTorch export.
- Continued support for static-shape and TensorRT profile-based dynamic-shape models.
- Updated C++ TensorRT ExecuTorch backend and reference runner for Python-free inference.
ExecuTorch Target-Device Metadata
Adds target_device metadata to TensorRT-delegated ExecuTorch partitions so device placement propagates into exported .pte files. Single-engine exports derive the CUDA index from the engine itself, while explicit caller overrides remain supported. This prepares exported programs for CUDA-aware memory planning and direct device-resident delegate buffers.
Caller-Selected CUDA Streams and Green Contexts
Introduces CudaStreamGuard, allowing the ExecuTorch TensorRT delegate to execute on a caller-selected CUDA stream. This enables CUDA Green Contexts, custom GPU scheduling, and asynchronous device-resident execution while preserving existing default behavior.
Large TensorRT Engine Export for ExecuTorch
Supports exporting TensorRT engines larger than 2 GB to ExecuTorch .pte files. Serialized engines are now stored as CPU tensor attributes instead of inline base64 Python string literals, avoiding CPython’s string-size limit during FX graph recompilation. This enables deployment of large models through ExecuTorch without changing the underlying TensorRT engine format.
Unified Python and C++ Runtime with Cross-Runtime Serialization
Unifies the Python and C++ TensorRT runtimes behind TorchTensorRTModule and a common execution operation. Torch-TensorRT now automatically uses the C++ runtime when available and falls back to the pure-Python implementation otherwise (Python-only build). Engine constants are normalized during serialization so models saved under either runtime can be loaded and executed in Python-only or C++-enabled runtime.
Simplified Refit Pipeline
Removes the heuristic cached weight-name mapping previously stored in compiled modules and engine-cache entries. Refit now reconstructs the TensorRT-to-PyTorch weight mapping directly from the new graph on every operation, eliminating stale or incorrect cache matches and the associated fallback logic. Weight refitting and engine caching remain supported, and existing cache entries continue to load with their obsolete mapping metadata ignored.
Multi-Device TensorRT (MD-TRT) Distributed Inference
Adds native multi-device inference built on TensorRT 11's multi-device (MD) engines, enabling TensorRT-accelerated collectives across GPUs driven through standard torch.distributed APIs. This release adds converters for All-to-All, Scatter, and Gather (alongside existing all-reduce, all-gather, and reduce-scatter), and integrates TensorRT's NCCL path with PyTorch's process groups via a distributed_context API that routes each collective to the correct communicator across default and non-default (subgroup) process groups. NCCL library discovery now shares the same libnccl instance PyTorch loads — on TensorRT 11.0+ the runtime loads libnccl.so.2 directly, matching PyTorch's library and removing the need for manual LD_LIBRARY_PATH or symlink workarounds — so distributed, tensor-parallel, and TP-subgroup inference works out of the box.
Shared Dynamic Dimensions Across Inputs
Adds a shared_dims argument to torch_tensorrt.Input for models whose dynamic axes must be equal across multiple inputs (for example, a batch dimension shared by input_ids and attention_mask). Axes given the same name via Input(shared_dims={axis: name}) are exported as a single torch.export.Dim, so the equality constraint is satisfied automatically and torch.export no longer raises a ConstraintViolationError from treating each input's dynamic axis as independent. New shared_dynamic_dims_example documents the end-to-end usage.
What's Changed
- fix: detect incomplete fast refit on TRT-RTX via unset weights check by @tp5uiuc in #4198
- feat: enhance validators of attention converters and add single-token tests by @zewenli98 in #4203
- upgrade torch-tensorrt from 2.12 to 2.13 by @lanluo-nvidia in #4207
- fix attention converter test issues by @lanluo-nvidia in #4214
- Remove deprecated apis by @lanluo-nvidia in #4195
- chore(deps): bump monai from 1.5.1 to 1.5.2rc1 in /tools/perf by @dependabot[bot] in #4166
- fix windows ci cd issue by @lanluo-nvidia in #4215
- fix the docker build issue by @lanluo-nvidia in #4217
- remove deprecated apis due to some are brought back by other PRs by @lanluo-nvidia in #4219
- remove dynamic_range in fx by @lanluo-nvidia in #4221
- fix: handle
engine_cachekwarg as alias forcustom_engine_cacheand tolerate missing cache fields by @anishesg in #4230 - fix the itensor issue by @lanluo-nvidia in #4224
- fix: torch-TRT runtime cache attribute + standard-TRT fast refit regression by @tp5uiuc in #4225
- fix: ND input quantization by @narendasan in #4210
- executorch save + load by @lanluo-nvidia in #4169
- fix missed deprecated api by @lanluo-nvidia in #4249
- remove setoutputtype by @lanluo-nvidia in #4255
- Remove setComputePrecision by @lanluo-nvidia in #4258
- reduce_scatter bug fix native by @apbose in #4244
- feat & fix: support GQA/MQA and decode-phase attention via IAttentionLayer; add comprehensive HLO-level tests; fix bugs by @zewenli98 in #4246
- Move all Python test dependencies to pyproject by @SandSnip3r in #4256
- Fix TensorRT runtime input buffer lifetimes by @SandSnip3r in #4247
- fix: support SymInt for slice_scatter_decomposition by @zewenli98 in #4236
- fix: Remove explicit casts from the torch.compile pre aten identity lowering pass by @narendasan in #4264
- fix: remove unnecessary elementwise kernel by @narendasan in #4235
- executorch_stage2: remove libtorch related dependencies by @lanluo-nvidia in #4245
- Fix #4150: [Bug] TestWeightStrippedEngine OOM on RTX 3070 (8GB) with ... by @JiwaniZakir in #4155
- feat: TorchTRT Cuda generated kernels plugin support by @bowang007 in #4199
- Replace FakeTensorUpdater copy with Torch import by @benjaminglass1 in #4260
- remove libtorchtrt_executorch by @lanluo-nvidia in #4282
- Python runtime rework by @cehongwang in #4222
- fix: cudnn and efficient attention by @zewenli98 in #4280
- fix: pass through copy_ casting operations by @narendasan in #4269
- Fixed test errors by @cehongwang in #4290
- release ci naming fix by @lanluo-nvidia in #4289
- [Executorch] build clean up + dlfw save only path on main branch by @lanluo-nvidia in #4285
- fix: ExecuTorch export of TRT engines >2 GB by storing engine as Tensor attribute by @shoumikhin in #4277
- [ExecuTorch] Partitioner: emit target_device CompileSpec by @shoumikhin in #4272
- shorten windows cond env path by @lanluo-nvidia in #4288
- docs: streamline tensorrt_rtx.rst, add RTX feature example by @tp5uiuc in #4296
- fix(test): enable TRT-RTX refit and engine cache tests by @tp5uiuc in #4192
- fix(lowering): use factored sqrt form for complex acosh rewrite by @tp5uiuc in #4301
- upgrade trt-rtx from 1.4 to 1.5,add cuda 13.2 support by @lanluo-nvidia in #4297
- fix: respect caller's CUDA stream in TRT runtime (Green Context support) by @shoumikhin in #4232
- fix: fix CI failures of plugin test cases by @bowang007 in #4302
- Remove debug fprintf from TRTEngine::verify_serialization_fmt by @shoumikhin in #4308
- upgrade to trt 11 by @lanluo-nvidia in #4305
- [Docs] Fix JetPack installation gaps, formatting, and OOM issues by @AceofStades in #4292
- docs: Update nightly package install instructions by @fs-eire in #4283
- build: upgrade cuda to 13.2 by @fs-eire in #4315
- cherry pick from dlfw26.06 to main by @lanluo-nvidia in #4317
- feat: reintroduce TRT-RTX runtime cache, dynamic shapes, and native CUDA graph support by @tp5uiuc in #4294
- chore(rtx): clean up TRT-RTX 1.4-era WARs and test skips by @tp5uiuc in #4306
- supported cross serialization and runtime merge by @cehongwang in #4286
- cherry pick python only workflow by @lanluo-nvidia in #4322
- Run the ExecuTorch TensorRT delegate on a caller-selected CUDA stream (green-context support) by @shoumikhin in #4314
- put executorch in the extras_require by @lanluo-nvidia in #4324
- executorch: derive the TensorRT delegate target_device from the engine's real device index by @shoumikhin in #4329
- one typo fix by @lanluo-nvidia in #4332
- fix: fix the ci issues by @bowang007 in #4337
- 2.13 torch-tensorrt release cut by @lanluo-nvidia in #4339
- [cherry-pick][release/2.13] TRT 11 MD Ops (#4321) by @apbose in #4373
- [cherry-pick][release/2.13] MD-TRT changes for release 2.13 (#4358) by @apbose in #4374
- [cherry-pick][release/2.13] dynamic shape arg (#4233) by @apbose in #4372
- fix(executorch): correct missing-dependency install hint to torch_ten… by @narendasan in #4386
- cherrypick: PRs #4371, #4387, #4209, and two commits on main branch by @zewenli98 in #4391
- cherrypick: TS bug fixes #4354, #4353 by @zewenli98 in #4394
- skip cumsum on rtx by @lanluo-nvidia in #4399
- Cherrypick ws fix by @cehongwang in #4389
- fix torchvision version issue by @lanluo-nvidia in #4406
- [cherry-pick][release/2.13] fix(distributed): subgroup NCCL regression + nccl_utils TRT 11 cleanup (#4407) by @apbose in #4408
- Lluo/cherry pick 4342 by @lanluo-nvidia in #4410
- fix 2.13 release issue by @lanluo-nvidia in #4412
- fix kernel plugin test issue with numpy version by @lanluo-nvidia in #4413
- cast conv input to kernel dtype for mixed precision by @lanluo-nvidia in #4419
New Contributors
- @anishesg made their first contribution in #4230
- @JiwaniZakir made their first contribution in #4155
- @benjaminglass1 made their first contribution in #4260
- @AceofStades made their first contribution in #4292
Full Changelog: v2.12.1...v2.13.0