From dfc94228fcdc7bebcb58b57b7a6a06fa1111a62c Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Tue, 17 Sep 2024 10:14:39 -0700 Subject: [PATCH 1/9] upgrade torch from 2.5.0.dev to 2.6.0.dev in main branch --- py/requirements.txt | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py/requirements.txt b/py/requirements.txt index 15d359fbc3..361afab365 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/cu124 -torch>=2.5.0.dev,<2.6.0 +torch>=2.6.0.dev,<2.7.0 torchvision>=0.20.0.dev,<0.21.0 --extra-index-url https://pypi.ngc.nvidia.com pyyaml diff --git a/pyproject.toml b/pyproject.toml index bc6c6b60cf..26f8e97b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ requires = [ "typing-extensions>=4.7.0", "future>=0.18.3", "tensorrt-cu12==10.3.0", - "torch >=2.5.0.dev,<2.6.0", + "torch >=2.6.0.dev,<2.7.0", "pybind11==2.6.2", "numpy", ] From b1bf274d641d19c1b6a665d5f40104260af42583 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Tue, 17 Sep 2024 10:37:38 -0700 Subject: [PATCH 2/9] test --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 26f8e97b80..c382f0195b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ keywords = [ "inference", ] dependencies = [ - "torch >=2.5.0.dev,<2.6.0", + "torch >=2.6.0.dev,<2.7.0", "tensorrt-cu12==10.3.0", "tensorrt-cu12-bindings==10.3.0", "tensorrt-cu12-libs==10.3.0", From 767826f2be36102801b9f5c2ab1a94a70e04d9aa Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Tue, 17 Sep 2024 11:30:39 -0700 Subject: [PATCH 3/9] test --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index b8feefb940..3d87ca93f8 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.5.0a0 +2.6.0a0 From 1870b297fe61057bdd3197ae83063fe30eb0214f Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Thu, 19 Sep 2024 09:18:36 -0700 Subject: [PATCH 4/9] test --- cpp/include/torch_tensorrt/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/torch_tensorrt/macros.h b/cpp/include/torch_tensorrt/macros.h index 90fab3afcc..bdb0a30115 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 5 +#define TORCH_TENSORRT_MINOR_VERSION 6 #define TORCH_TENSORRT_PATCH_VERSION 0 #define TORCH_TENSORRT_VERSION \ STR(TORCH_TENSORRT_MAJOR_VERSION) \ From 98e30bfaed79adb7695623766062810d27fe84cb Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Fri, 20 Sep 2024 16:51:51 -0700 Subject: [PATCH 5/9] test --- tests/py/dynamo/models/test_export_serde.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/py/dynamo/models/test_export_serde.py b/tests/py/dynamo/models/test_export_serde.py index 146cc2addf..b1efdd85c5 100644 --- a/tests/py/dynamo/models/test_export_serde.py +++ b/tests/py/dynamo/models/test_export_serde.py @@ -242,6 +242,9 @@ def forward(self, x): ) +@unittest.skip( + "Pending pytorch issue in torch2.6 https://github.com/pytorch/pytorch/issues/136322" +) @pytest.mark.unit def test_resnet18(ir): """ @@ -283,6 +286,9 @@ def test_resnet18(ir): ) +@unittest.skip( + "Pending pytorch issue in torch2.6 https://github.com/pytorch/pytorch/issues/136322" +) @pytest.mark.unit def test_resnet18_dynamic(ir): """ From 0ecfc2ceb8b773dc6ba261c8f1036e8c90ecaf79 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Sat, 21 Sep 2024 09:49:50 -0700 Subject: [PATCH 6/9] test --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ceb2401f06..1284e458f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ requires = [ "typing-extensions>=4.7.0", "future>=0.18.3", "tensorrt-cu12==10.3.0", - "torch >=2.6.0.dev,<2.7.0", + "torch>=2.6.0.dev,<2.7.0", "pybind11==2.6.2", "numpy", ] @@ -54,8 +54,7 @@ keywords = [ "inference", ] dependencies = [ - "torch >=2.6.0.dev,<2.7.0", - "torch>=2.5.0.dev,<2.6.0", + "torch>=2.6.0.dev,<2.7.0", "tensorrt-cu12==10.3.0", "tensorrt-cu12-bindings==10.3.0", "tensorrt-cu12-libs==10.3.0", From d8bcbd750625e11066f4d5538d169b6d307716b0 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Sat, 21 Sep 2024 16:20:11 -0700 Subject: [PATCH 7/9] test --- py/torch_tensorrt/dynamo/lowering/_decompositions.py | 5 +++-- tests/py/dynamo/models/test_export_serde.py | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/py/torch_tensorrt/dynamo/lowering/_decompositions.py b/py/torch_tensorrt/dynamo/lowering/_decompositions.py index 8c391afa5b..e6319533e5 100644 --- a/py/torch_tensorrt/dynamo/lowering/_decompositions.py +++ b/py/torch_tensorrt/dynamo/lowering/_decompositions.py @@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, List, Optional import torch -from torch._decomp import register_decomposition +from torch._decomp import _decomp_table_to_post_autograd_aten, register_decomposition from torch._ops import OpOverload from torch_tensorrt.dynamo._defaults import default_device from torch_tensorrt.dynamo.conversion.converter_utils import get_positive_dim @@ -394,4 +394,5 @@ def get_decompositions( } return {**CORE_ATEN_DECOMPOSITIONS_FILTERED, **TORCH_TRT_DECOMPOSITIONS} else: - return {**ENABLED_TORCH_DECOMPOSITIONS, **TORCH_TRT_DECOMPOSITIONS} + # changes made here due to torch2.6 changes https://github.com/pytorch/pytorch/pull/135080 + return {**_decomp_table_to_post_autograd_aten(), **TORCH_TRT_DECOMPOSITIONS} diff --git a/tests/py/dynamo/models/test_export_serde.py b/tests/py/dynamo/models/test_export_serde.py index b1efdd85c5..146cc2addf 100644 --- a/tests/py/dynamo/models/test_export_serde.py +++ b/tests/py/dynamo/models/test_export_serde.py @@ -242,9 +242,6 @@ def forward(self, x): ) -@unittest.skip( - "Pending pytorch issue in torch2.6 https://github.com/pytorch/pytorch/issues/136322" -) @pytest.mark.unit def test_resnet18(ir): """ @@ -286,9 +283,6 @@ def test_resnet18(ir): ) -@unittest.skip( - "Pending pytorch issue in torch2.6 https://github.com/pytorch/pytorch/issues/136322" -) @pytest.mark.unit def test_resnet18_dynamic(ir): """ From 4a26ee84898d72fec4d2f8247452280fd28fda8b Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Sun, 22 Sep 2024 10:33:00 -0700 Subject: [PATCH 8/9] test --- py/torch_tensorrt/dynamo/lowering/_decompositions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/torch_tensorrt/dynamo/lowering/_decompositions.py b/py/torch_tensorrt/dynamo/lowering/_decompositions.py index e6319533e5..ab3b354358 100644 --- a/py/torch_tensorrt/dynamo/lowering/_decompositions.py +++ b/py/torch_tensorrt/dynamo/lowering/_decompositions.py @@ -395,4 +395,4 @@ def get_decompositions( return {**CORE_ATEN_DECOMPOSITIONS_FILTERED, **TORCH_TRT_DECOMPOSITIONS} else: # changes made here due to torch2.6 changes https://github.com/pytorch/pytorch/pull/135080 - return {**_decomp_table_to_post_autograd_aten(), **TORCH_TRT_DECOMPOSITIONS} + return {**_decomp_table_to_post_autograd_aten(), **ENABLED_TORCH_DECOMPOSITIONS, **TORCH_TRT_DECOMPOSITIONS} From 9ec69b1cbbb404f16c9c644512ed08e43ced10bd Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Sun, 22 Sep 2024 11:20:59 -0700 Subject: [PATCH 9/9] fix lint --- py/torch_tensorrt/dynamo/lowering/_decompositions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/torch_tensorrt/dynamo/lowering/_decompositions.py b/py/torch_tensorrt/dynamo/lowering/_decompositions.py index ab3b354358..534bc3eac5 100644 --- a/py/torch_tensorrt/dynamo/lowering/_decompositions.py +++ b/py/torch_tensorrt/dynamo/lowering/_decompositions.py @@ -395,4 +395,8 @@ def get_decompositions( return {**CORE_ATEN_DECOMPOSITIONS_FILTERED, **TORCH_TRT_DECOMPOSITIONS} else: # changes made here due to torch2.6 changes https://github.com/pytorch/pytorch/pull/135080 - return {**_decomp_table_to_post_autograd_aten(), **ENABLED_TORCH_DECOMPOSITIONS, **TORCH_TRT_DECOMPOSITIONS} + return { + **ENABLED_TORCH_DECOMPOSITIONS, + **_decomp_table_to_post_autograd_aten(), + **TORCH_TRT_DECOMPOSITIONS, + }