diff --git a/MODULE.bazel b/MODULE.bazel index 31b03188bc..625ddbea6b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "torch_tensorrt", - version = "2.10.0a0", + version = "2.11.0a0", repo_name = "org_pytorch_tensorrt", ) diff --git a/README.md b/README.md index 4a9f141481..e8c0c8b164 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Torch-TensorRT

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

[![Documentation](https://img.shields.io/badge/docs-master-brightgreen)](https://nvidia.github.io/Torch-TensorRT/) -[![pytorch](https://img.shields.io/badge/PyTorch-2.10-green)](https://download.pytorch.org/whl/nightly/cu130) +[![pytorch](https://img.shields.io/badge/PyTorch-2.11-green)](https://download.pytorch.org/whl/nightly/cu130) [![cuda](https://img.shields.io/badge/CUDA-13.0-green)](https://developer.nvidia.com/cuda-downloads) -[![trt](https://img.shields.io/badge/TensorRT-10.14.0-green)](https://github.com/nvidia/tensorrt) +[![trt](https://img.shields.io/badge/TensorRT-10.14.1-green)](https://github.com/nvidia/tensorrt) [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue)](./LICENSE) [![Linux x86-64 Nightly Wheels](https://github.com/pytorch/TensorRT/actions/workflows/build-test-linux-x86_64.yml/badge.svg?branch=nightly)](https://github.com/pytorch/TensorRT/actions/workflows/build-test-linux-x86_64.yml) [![Linux SBSA Nightly Wheels](https://github.com/pytorch/TensorRT/actions/workflows/build-test-linux-aarch64.yml/badge.svg?branch=nightly)](https://github.com/pytorch/TensorRT/actions/workflows/build-test-linux-aarch64.yml) @@ -121,7 +121,7 @@ auto results = trt_mod.forward({input_tensor}); 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. - Bazel 8.1.1 -- Libtorch 2.10.0.dev (latest nightly) +- Libtorch 2.11.0.dev (latest nightly) - CUDA 13.0 (CUDA 12.6 on Jetson) - TensorRT 10.14.1.48 (TensorRT 10.3 on Jetson) diff --git a/cpp/include/torch_tensorrt/macros.h b/cpp/include/torch_tensorrt/macros.h index 37386d341f..55c2a70b9a 100644 --- a/cpp/include/torch_tensorrt/macros.h +++ b/cpp/include/torch_tensorrt/macros.h @@ -24,7 +24,7 @@ #define STR(x) XSTR(x) #define TORCH_TENSORRT_MAJOR_VERSION 2 -#define TORCH_TENSORRT_MINOR_VERSION 10 +#define TORCH_TENSORRT_MINOR_VERSION 11 #define TORCH_TENSORRT_PATCH_VERSION 0 #define TORCH_TENSORRT_VERSION \ STR(TORCH_TENSORRT_MAJOR_VERSION) \ diff --git a/py/requirements.txt b/py/requirements.txt index 28b7592f71..ac7133cf68 100644 --- a/py/requirements.txt +++ b/py/requirements.txt @@ -2,7 +2,7 @@ numpy packaging pybind11==2.6.2 --extra-index-url https://download.pytorch.org/whl/nightly/cu130 -torch>=2.10.0.dev,<2.11.0 +torch>=2.11.0.dev,<2.12.0 --extra-index-url https://pypi.ngc.nvidia.com pyyaml dllist diff --git a/py/torch_tensorrt/_features.py b/py/torch_tensorrt/_features.py index 03cf4256ec..3c4df0fbde 100644 --- a/py/torch_tensorrt/_features.py +++ b/py/torch_tensorrt/_features.py @@ -52,7 +52,9 @@ _WINDOWS_CROSS_COMPILE = check_cross_compile_trt_win_lib() _TRTLLM_AVAIL = load_tensorrt_llm_for_nccl() -if importlib.util.find_spec("tensorrt.plugin"): +if importlib.util.find_spec("tensorrt.plugin") and importlib.util.find_spec( + "tensorrt.plugin._lib" +): _QDP_PLUGIN_AVAIL = True else: _QDP_PLUGIN_AVAIL = False diff --git a/py/torch_tensorrt/dynamo/runtime/meta_ops/register_meta_ops.py b/py/torch_tensorrt/dynamo/runtime/meta_ops/register_meta_ops.py index b5fc3d48fa..434f434ad5 100644 --- a/py/torch_tensorrt/dynamo/runtime/meta_ops/register_meta_ops.py +++ b/py/torch_tensorrt/dynamo/runtime/meta_ops/register_meta_ops.py @@ -6,6 +6,35 @@ from torch_tensorrt.dynamo.utils import input_is_dynamic, unwrap_tensor_shape +@torch.library.register_fake("aten::cudnn_grid_sampler") # type: ignore +def fake_aten_cudnn_grid_sampler( + input: torch.Tensor, + grid: torch.Tensor, + interpolation_mode: int = 0, + padding_mode: int = 0, + align_corners: bool = True, +) -> torch.Tensor: + """ + Meta kernel for aten::cudnn_grid_sampler to enable FakeTensor/compile flows. + Shapes follow grid_sampler semantics: + - 2D: input [N, C, H_in, W_in], grid [N, H_out, W_out, 2] -> output [N, C, H_out, W_out] + - 3D: input [N, C, D_in, H_in, W_in], grid [N, D_out, H_out, W_out, 3] -> output [N, C, D_out, H_out, W_out] + """ + if grid.dim() == 4: + n, h_out, w_out, _ = grid.shape + c = input.shape[1] + out_shape = [n, c, h_out, w_out] + elif grid.dim() == 5: + n, d_out, h_out, w_out, _ = grid.shape + c = input.shape[1] + out_shape = [n, c, d_out, h_out, w_out] + else: + raise RuntimeError( + f"aten::cudnn_grid_sampler: unexpected grid rank {grid.dim()}" + ) + return torch.empty(out_shape, dtype=input.dtype, device=input.device) + + @torch.library.register_fake("tensorrt::execute_engine") # type: ignore def fake_tensorrt_execute_engine( inputs: List[torch.Tensor], fake_trt_engine: Any diff --git a/pyproject.toml b/pyproject.toml index 79736661cd..aab906b389 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ "ninja>=1.11.0", "pyyaml>=6.0", "cffi>=1.15.1", - "torch>=2.10.0.dev,<2.11.0", + "torch>=2.11.0.dev,<2.12.0", "pybind11==2.6.2", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 696f8344bd..8e9e0231c9 100644 --- a/setup.py +++ b/setup.py @@ -742,7 +742,7 @@ def get_sbsa_requirements(base_requirements): # TensorRT does not currently build wheels for Tegra, so we need to use the local tensorrt install from the tarball for thor # also due to we use sbsa torch_tensorrt wheel for thor, so when we build sbsa wheel, we need to only include tensorrt dependency. return requirements + [ - "torch>=2.10.0.dev,<2.11.0", + "torch>=2.11.0.dev,<2.12.0", "tensorrt>=10.14.1,<10.15.0", ] @@ -753,7 +753,7 @@ def get_x86_64_requirements(base_requirements): if IS_DLFW_CI: return requirements else: - requirements = requirements + ["torch>=2.10.0.dev,<2.11.0"] + requirements = requirements + ["torch>=2.11.0.dev,<2.12.0"] if USE_TRT_RTX: return requirements + [ "tensorrt_rtx>=1.2.0.54", diff --git a/tests/py/dynamo/automatic_plugin/test_automatic_plugin.py b/tests/py/dynamo/automatic_plugin/test_automatic_plugin.py index 622b88547e..ce075fb5c7 100644 --- a/tests/py/dynamo/automatic_plugin/test_automatic_plugin.py +++ b/tests/py/dynamo/automatic_plugin/test_automatic_plugin.py @@ -3,13 +3,12 @@ import torch import torch.nn as nn +import torch_tensorrt import triton import triton.language as tl from parameterized import parameterized from torch.testing._internal.common_utils import run_tests -import torch_tensorrt - from ..conversion.harness import DispatchTestCase @@ -56,15 +55,15 @@ def elementwise_mul(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: return x -if not torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx: +if torch_tensorrt.ENABLED_FEATURES.qdp_plugin: torch_tensorrt.dynamo.conversion.plugins.custom_op( "torchtrt_ex::elementwise_mul", supports_dynamic_shapes=True ) @unittest.skipIf( - torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx, - "TensorRT RTX does not support plugins", + not torch_tensorrt.ENABLED_FEATURES.qdp_plugin, + "QDP Plugin is not available", ) class TestAutomaticPlugin(DispatchTestCase): diff --git a/tests/py/dynamo/automatic_plugin/test_automatic_plugin_with_attrs.py b/tests/py/dynamo/automatic_plugin/test_automatic_plugin_with_attrs.py index 831a9f2d53..a31637eee7 100644 --- a/tests/py/dynamo/automatic_plugin/test_automatic_plugin_with_attrs.py +++ b/tests/py/dynamo/automatic_plugin/test_automatic_plugin_with_attrs.py @@ -3,13 +3,12 @@ import torch import torch.nn as nn +import torch_tensorrt import triton import triton.language as tl from parameterized import parameterized from torch.testing._internal.common_utils import run_tests -import torch_tensorrt - from ..conversion.harness import DispatchTestCase @@ -57,15 +56,15 @@ def _(x: torch.Tensor, y: torch.Tensor, b: float = 0.2, a: int = 2) -> torch.Ten return x -if not torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx: +if torch_tensorrt.ENABLED_FEATURES.qdp_plugin: torch_tensorrt.dynamo.conversion.plugins.custom_op( "torchtrt_ex::elementwise_scale_mul", supports_dynamic_shapes=True ) @unittest.skipIf( - torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx, - "TensorRT RTX does not support plugins", + not torch_tensorrt.ENABLED_FEATURES.qdp_plugin, + "QDP Plugin is not available", ) class TestAutomaticPlugin(DispatchTestCase): diff --git a/tests/py/dynamo/automatic_plugin/test_flashinfer_rmsnorm.py b/tests/py/dynamo/automatic_plugin/test_flashinfer_rmsnorm.py index 1666102070..f5432f4563 100644 --- a/tests/py/dynamo/automatic_plugin/test_flashinfer_rmsnorm.py +++ b/tests/py/dynamo/automatic_plugin/test_flashinfer_rmsnorm.py @@ -4,10 +4,9 @@ import pytest import torch import torch.nn as nn +import torch_tensorrt from parameterized import parameterized from torch.testing._internal.common_utils import run_tests - -import torch_tensorrt from torch_tensorrt._enums import dtype from ..conversion.harness import DispatchTestCase @@ -28,7 +27,7 @@ def _(input: torch.Tensor, weight: torch.Tensor, b: float = 1e-6) -> torch.Tenso return input -if not torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx: +if torch_tensorrt.ENABLED_FEATURES.qdp_plugin: torch_tensorrt.dynamo.conversion.plugins.custom_op( "flashinfer::rmsnorm", supports_dynamic_shapes=True ) @@ -37,8 +36,8 @@ def _(input: torch.Tensor, weight: torch.Tensor, b: float = 1e-6) -> torch.Tenso @unittest.skip("Not Available") @unittest.skipIf( not importlib.util.find_spec("flashinfer") - or torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx, - "flashinfer not installed or TensorRT RTX is present", + or not torch_tensorrt.ENABLED_FEATURES.qdp_plugin, + "flashinfer not installed or QDP Plugin is not available", ) class TestAutomaticPlugin(DispatchTestCase): diff --git a/version.txt b/version.txt index 1e8c33284d..f925b7d0ce 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.10.0a0 +2.11.0a0