TensorRT 11.2 OSS Release (#4823)

Signed-off-by: Kevin Chen <kevinch@nvidia.com>
This commit is contained in:
Kevin Chen
2026-08-04 13:03:10 -07:00
committed by GitHub
parent a892d22267
commit 1dade062a4
133 changed files with 8338 additions and 775 deletions
+6 -5
View File
@@ -54,10 +54,14 @@ function(processWheelTemplates wheelType moduleName pyVersion)
set(__outputFile ${outputDir}/${filePath})
endif()
flagToInt(TRT_BUILD_WINML)
flagToInt(TRT_PRODUCT_IS_RTX)
add_custom_command(
OUTPUT ${__outputFile}
# Make (unlike Ninja) doesn't create the custom-command output dir, and
# __outDir contains $<CONFIG>, so create it here at build time (where the
# generator expression resolves) rather than in the Python script.
COMMAND ${CMAKE_COMMAND} -E make_directory ${__outDir}
COMMAND
${Python3_EXECUTABLE} ${TensorRT_SOURCE_DIR}/python/scripts/process_wheel_template.py
--src-dir ${__srcDir}
@@ -67,7 +71,7 @@ function(processWheelTemplates wheelType moduleName pyVersion)
--trt-py-version ${TensorRT_PACKAGE_VERSION}
--cuda-version ${TRT_CUDA_VERSION}
--trt-version ${TensorRT_VERSION}
--plugin-disabled ${TRT_BUILD_WINML_INT}
--plugin-disabled ${TRT_PRODUCT_IS_RTX_INT}
--trt-nvinfer-name ${TENSORRT_BASE_NAME}
--trt-onnxparser-name ${TRT_ONNXPARSER_NAME} # The TRT_ONNXPARSER_NAME var is populated in the root CMakeLists.txt
DEPENDS
@@ -163,6 +167,3 @@ function(get_wheel_platform isStandalone outVar)
endfunction()
add_subdirectory(bindings_wheel)
add_subdirectory(libs_wheel)
add_subdirectory(frontend_sdist)
add_subdirectory(metapackage)
@@ -0,0 +1,64 @@
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "tensorrt_build_backend"
backend-path = ["."]
[project]
# The package name is computed dynamically by the build backend
# based on [tool.tensorrt] config and wheel-type config setting
name = "build-backend-placeholder"
version = "##TENSORRT_PYTHON_VERSION##"
description = "A high performance deep learning inference library"
readme = {text = "A high performance deep learning inference library", content-type = "text/plain"}
license = {text = "Proprietary"}
authors = [
{name = "NVIDIA Corporation"}
]
classifiers = [
"License :: Other/Proprietary License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
keywords = ["nvidia", "tensorrt", "deeplearning", "inference"]
[project.optional-dependencies]
numpy = ["numpy"]
[project.urls]
Homepage = "https://github.com/nvidia/tensorrt"
Download = "https://developer.nvidia.com/tensorrt"
# TensorRT-specific build configuration used by the custom build backend
# The backend reads this to compute the correct package name based on wheel-type
[tool.tensorrt]
base-name = "##TENSORRT_MODULE##"
cuda-major = "##CUDA_MAJOR##"
[tool.setuptools]
zip-safe = true
include-package-data = true
# Package discovery - placeholder updated by build backend based on wheel type
[tool.setuptools.packages.find]
include = ["build-backend-placeholder"]
exclude = ["tensorrt_build_backend*"] # Explicitly exclude the backend, since tensorrt* will match it otherwise.
[tool.setuptools.package-data]
"*" = ["*.so*", "*.pyd", "*.pdb", "*.dll*"]
@@ -276,7 +276,10 @@ class _TemplatePluginCreator(trt.IPluginCreatorV3Quick):
if issubclass(attr_type_annot, str):
attrs[f.name] = f.data.tobytes().decode("utf-8")
else:
attrs[f.name] = attr_type_annot(f.data)
if isinstance(f.data, np.ndarray) and f.data.size == 1:
attrs[f.name] = attr_type_annot(f.data[0])
else:
attrs[f.name] = attr_type_annot(f.data)
jit_or_aot = None # True if JIT is to be created, False if AOT. Not None will be asserted before plugin creation.
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -111,7 +111,7 @@ def _parse_register_inputs(register_func, lazy_register):
)
if issubclass(param.annotation, TensorDesc):
if inspect.isclass(param.annotation) and issubclass(param.annotation, TensorDesc):
if saw_first_attr:
raise ValueError(
f"TensorDescs args and attribute args cannot be interspersed. Received function with signature {sig}."
@@ -226,12 +226,12 @@ def _validate_impl(impl_func, plugin_def):
f"Argument for receiving output Tensor, '{name}' contains a {param.annotation}. '{name}' should be a Tuple[Tensor]."
)
elif name == "stream":
if not issubclass(param.annotation, int):
if not (inspect.isclass(param.annotation) and issubclass(param.annotation, int)):
raise ValueError("'stream' input argument should be an int")
elif name == "tactic":
if not issubclass(param.annotation, int):
if not (inspect.isclass(param.annotation) and issubclass(param.annotation, int)):
raise ValueError("'tactic' input argument should be an int")
elif issubclass(param.annotation, Tensor):
elif inspect.isclass(param.annotation) and issubclass(param.annotation, Tensor):
if name not in plugin_def.input_tensor_names:
raise ValueError(
f"Unexpected tensor '{name}' specified in autotune function. Expected one of {plugin_def.input_tensor_names}."
@@ -300,9 +300,9 @@ def _validate_aot_impl(aot_impl_func, plugin_def):
f"Argument for receiving output TensorDesc, '{name}' contains a {param.annotation}. '{name}' should be a Tuple[TensorDesc]."
)
elif name == "tactic":
if not issubclass(param.annotation, int):
if not (inspect.isclass(param.annotation) and issubclass(param.annotation, int)):
raise ValueError("'tactic' input argument should be an int")
elif issubclass(param.annotation, TensorDesc):
elif inspect.isclass(param.annotation) and issubclass(param.annotation, TensorDesc):
if name not in plugin_def.input_tensor_names:
raise ValueError(
f"Unexpected tensor '{name}' specified in autotune function. Expected one of {plugin_def.input_tensor_names}."
@@ -415,7 +415,7 @@ def _validate_autotune(autotune_func, plugin_def):
raise ValueError(
f"Argument for receiving output TensorDescs, '{name}' contains a {param.annotation}. '{name}' should be a Tuple[TensorDesc]."
)
elif issubclass(param.annotation, TensorDesc):
elif inspect.isclass(param.annotation) and issubclass(param.annotation, TensorDesc):
if name not in plugin_def.input_tensor_names:
raise ValueError(
f"Unexpected tensor '{name}' specified in autotune function. Expected one of {plugin_def.input_tensor_names}."
@@ -0,0 +1,60 @@
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "##TENSORRT_MODULE##_cu##CUDA_MAJOR##"
version = "##TENSORRT_PYTHON_VERSION##"
description = "A high performance deep learning inference library"
readme = {text = "##TENSORRT_README##", content-type = "text/markdown"}
license = {text = "Proprietary"}
authors = [
{name = "NVIDIA Corporation"}
]
classifiers = [
"License :: Other/Proprietary License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
keywords = ["nvidia", "tensorrt", "deeplearning", "inference"]
requires-python = ">=3.8"
# Dependencies are hosted on pypi.nvidia.com and fetched using the wheel-stub package
dependencies = [
"##TENSORRT_MODULE##_cu##CUDA_MAJOR##_libs==##TENSORRT_PYTHON_VERSION##",
"##TENSORRT_MODULE##_cu##CUDA_MAJOR##_bindings==##TENSORRT_PYTHON_VERSION##",
]
[project.optional-dependencies]
numpy = ["numpy"]
[project.urls]
Homepage = "https://github.com/nvidia/tensorrt"
Download = "https://developer.nvidia.com/tensorrt"
[tool.setuptools]
zip-safe = true
include-package-data = true
[tool.setuptools.packages.find]
include = ["##TENSORRT_MODULE##*"]
[tool.setuptools.package-data]
"*" = ["*.so*", "*.pyd", "*.pdb", "*.dll*"]
+1 -1
View File
@@ -54,7 +54,7 @@ function(buildLibsWheel moduleName)
elseif(${moduleName} STREQUAL "tensorrt" OR ${moduleName} STREQUAL "tensorrt_rtx")
set(moduleLibraryTargets tensorrt)
get_all_fatbin_archs(KLIB_ARCHS KLIB_ARCHS_CROSS)
if(NOT ${TRT_BUILD_WINML})
if(NOT ${TRT_PRODUCT_IS_RTX})
if(NOT ${TRT_BUILD_SPLIT_KLIB})
list(APPEND moduleLibraryTargets tensorrt_builder_resource)
else()
@@ -0,0 +1,51 @@
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "tensorrt_build_backend"
backend-path = ["."]
[project]
name = "##TENSORRT_MODULE##_cu##CUDA_MAJOR##_libs"
version = "##TENSORRT_PYTHON_VERSION##"
description = "TensorRT Libraries"
readme = {text = "TensorRT Libraries", content-type = "text/plain"}
license = {text = "Proprietary"}
authors = [
{name = "NVIDIA Corporation"}
]
classifiers = [
"License :: Other/Proprietary License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
keywords = ["nvidia", "tensorrt", "deeplearning", "inference"]
[project.urls]
Homepage = "https://github.com/nvidia/tensorrt"
Download = "https://developer.nvidia.com/tensorrt"
[tool.setuptools]
zip-safe = true
include-package-data = true
[tool.setuptools.packages.find]
include = ["##TENSORRT_MODULE##_libs*"]
[tool.setuptools.package-data]
"*" = ["*.so*", "*.pyd", "*.pdb", "*.dll*"]
@@ -0,0 +1,50 @@
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "##TENSORRT_MODULE##"
version = "##TENSORRT_PYTHON_VERSION##"
description = "TensorRT Metapackage"
readme = {text = "##TENSORRT_README##", content-type = "text/markdown"}
license = {text = "Proprietary"}
authors = [
{name = "NVIDIA Corporation"}
]
classifiers = [
"License :: Other/Proprietary License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
keywords = ["nvidia", "tensorrt", "deeplearning", "inference"]
requires-python = ">=3.8"
# This metapackage depends on the CUDA-versioned frontend package
dependencies = [
"##TENSORRT_MODULE##_cu##CUDA_MAJOR##==##TENSORRT_PYTHON_VERSION##",
]
[project.urls]
Homepage = "https://github.com/nvidia/tensorrt"
Download = "https://developer.nvidia.com/tensorrt"
[tool.setuptools]
zip-safe = true
include-package-data = true
+36
View File
@@ -0,0 +1,36 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
[[package]]
name = "setuptools"
version = "80.4.0"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
optional = false
python-versions = ">=3.8"
files = [
{file = "setuptools-80.4.0-py3-none-any.whl", hash = "sha256:6cdc8cb9a7d590b237dbe4493614a9b75d0559b888047c1f67d49ba50fc3edb2"},
{file = "setuptools-80.4.0.tar.gz", hash = "sha256:5a78f61820bc088c8e4add52932ae6b8cf423da2aff268c23f813cfbb13b4006"},
]
[package.extras]
docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"]
testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"]
testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"]
[[package]]
name = "wheel"
version = "0.46.1"
description = "A built-package format for Python"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
files = [
{file = "wheel-0.46.1-py3-none-any.whl", hash = "sha256:f796f65d72750ccde090663e466d0ca37cd72b62870f7520b96d34cdc07d86d8"},
{file = "wheel-0.46.1.tar.gz", hash = "sha256:fd477efb5da0f7df1d3c76c73c14394002c844451bd63229d8570f376f5e6a38"},
]
[package.extras]
test = ["pytest (>=3.0.0)", "pytest-cov"]
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "bd4a2226ae7207e7ffec5f0414f75897ea112465ee8d898ecb5466c5b573685a"
+16
View File
@@ -0,0 +1,16 @@
[tool.poetry]
name = "tensorrt"
version = "0.1.0"
description = ""
authors = ["TensorRT [svc_tensorrt@nvidia.com]"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.8"
wheel = "0.45.1"
setuptools = "^80.4.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"