jp6/cu126/: torch-tensorrt-2.8.0+cu126 metadata and description

Simple index

Torch-TensorRT is a package which allows users to automatically compile PyTorch and TorchScript modules to TensorRT while remaining in PyTorch

author_email NVIDIA Corporation <narens@nvidia.com>
classifiers
  • Development Status :: 5 - Production/Stable
  • Environment :: GPU :: NVIDIA CUDA
  • License :: OSI Approved :: BSD License
  • Intended Audience :: Developers
  • Intended Audience :: Science/Research
  • Operating System :: POSIX :: Linux
  • Programming Language :: C++
  • Programming Language :: Python
  • Programming Language :: Python :: Implementation :: CPython
  • Topic :: Scientific/Engineering
  • Topic :: Scientific/Engineering :: Artificial Intelligence
  • Topic :: Software Development
  • Topic :: Software Development :: Libraries
description_content_type text/markdown
dynamic license-file
keywords pytorch, torch, tensorrt, trt, ai, artificial intelligence, ml, machine learning, dl, deep learning, compiler, dynamo, torchscript, inference
license Copyright (c) 2020-present, NVIDIA CORPORATION. All rights reserved. Copyright (c) Meta Platforms, Inc. and affiliates. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
license_file LICENSE
project_urls
  • Homepage, https://pytorch.org/tensorrt
  • Documentation, https://pytorch.org/tensorrt
  • Repository, https://github.com/pytorch/tensorrt.git
  • Changelog, https://github.com/pytorch/tensorrt/releases
requires_dist
  • torch<2.9.0,>=2.8.0; platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)
  • torch<2.9.0,>=2.8.0; platform_machine == "aarch64" and "tegra" in platform_release
  • tensorrt<10.13.0,>=10.12.0; platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)
  • tensorrt-cu12-bindings<10.13.0,>=10.12.0; platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)
  • tensorrt-cu12-libs<10.13.0,>=10.12.0; platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)
  • tensorrt<10.4.0,>=10.3.0; platform_machine == "aarch64" and "tegra" in platform_release
  • packaging>=23
  • numpy; platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)
  • numpy<2.0.0; platform_machine == "aarch64" and "tegra" in platform_release
  • typing-extensions>=4.7.0
  • dllist
  • torchvision<0.24.0,>=0.23.0; (platform_machine != "aarch64" or (platform_machine == "aarch64" and "tegra" not in platform_release)) and extra == "torchvision"
  • torchvision<0.23.0,>=0.22.0; (platform_machine == "aarch64" and "tegra" in platform_release) and extra == "torchvision"
  • nvidia-modelopt[all]>=0.27.1; extra == "quantization"
requires_python >=3.9

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
torch_tensorrt-2.8.0+cu126-cp310-cp310-linux_aarch64.whl
Size
3 MB
Type
Python Wheel
Python
3.10

Torch-TensorRT

Easily achieve the best inference performance for any PyTorch model on the NVIDIA platform.

Documentation pytorch cuda trt license Linux x86-64 Nightly Wheels Linux SBSA Nightly Wheels Windows Nightly Wheels


Torch-TensorRT brings the power of TensorRT to PyTorch. Accelerate inference latency by up to 5x compared to eager execution in just one line of code.

Installation

Stable versions of Torch-TensorRT are published on PyPI

pip install torch-tensorrt

Nightly versions of Torch-TensorRT are published on the PyTorch package index

pip install --pre torch-tensorrt --index-url https://download.pytorch.org/whl/nightly/cu128

Torch-TensorRT is also distributed in the ready-to-run NVIDIA NGC PyTorch Container which has all dependencies with the proper versions and example notebooks included.

For more advanced installation methods, please see here

Quickstart

Option 1: torch.compile

You can use Torch-TensorRT anywhere you use torch.compile:

import torch
import torch_tensorrt

model = MyModel().eval().cuda() # define your model here
x = torch.randn((1, 3, 224, 224)).cuda() # define what the inputs to the model will look like

optimized_model = torch.compile(model, backend="tensorrt")
optimized_model(x) # compiled on first run

optimized_model(x) # this will be fast!

Option 2: Export

If you want to optimize your model ahead-of-time and/or deploy in a C++ environment, Torch-TensorRT provides an export-style workflow that serializes an optimized module. This module can be deployed in PyTorch or with libtorch (i.e. without a Python dependency).

Step 1: Optimize + serialize

import torch
import torch_tensorrt

model = MyModel().eval().cuda() # define your model here
inputs = [torch.randn((1, 3, 224, 224)).cuda()] # define a list of representative inputs here

trt_gm = torch_tensorrt.compile(model, ir="dynamo", inputs=inputs)
torch_tensorrt.save(trt_gm, "trt.ep", inputs=inputs) # PyTorch only supports Python runtime for an ExportedProgram. For C++ deployment, use a TorchScript file
torch_tensorrt.save(trt_gm, "trt.ts", output_format="torchscript", inputs=inputs)

Step 2: Deploy

Deployment in PyTorch:
import torch
import torch_tensorrt

inputs = [torch.randn((1, 3, 224, 224)).cuda()] # your inputs go here

# You can run this in a new python session!
model = torch.export.load("trt.ep").module()
# model = torch_tensorrt.load("trt.ep").module() # this also works
model(*inputs)
Deployment in C++:
#include "torch/script.h"
#include "torch_tensorrt/torch_tensorrt.h"

auto trt_mod = torch::jit::load("trt.ts");
auto input_tensor = [...]; // fill this with your inputs
auto results = trt_mod.forward({input_tensor});

Further resources

Platform Support

Platform Support
Linux AMD64 / GPU Supported
Linux SBSA / GPU Supported
Windows / GPU Supported (Dynamo only)
Linux Jetson / GPU Source Compilation Supported on JetPack-4.4+
Linux Jetson / DLA Source Compilation Supported on JetPack-4.4+
Linux ppc64le / GPU Not supported

Note: Refer NVIDIA L4T PyTorch NGC container for PyTorch libraries on JetPack.

Dependencies

These are the following dependencies used to verify the testcases. Torch-TensorRT can work with other versions, but the tests are not guaranteed to pass.

Deprecation Policy

Deprecation is used to inform developers that some APIs and tools are no longer recommended for use. Beginning with version 2.3, Torch-TensorRT has the following deprecation policy:

Deprecation notices are communicated in the Release Notes. Deprecated API functions will have a statement in the source documenting when they were deprecated. Deprecated methods and classes will issue deprecation warnings at runtime, if they are used. Torch-TensorRT provides a 6-month migration period after the deprecation. APIs and tools continue to work during the migration period. After the migration period ends, APIs and tools are removed in a manner consistent with semantic versioning.

Contributing

Take a look at the CONTRIBUTING.md

License

The Torch-TensorRT license can be found in the LICENSE file. It is licensed with a BSD Style licence