Skip to content

Commit 6aecdaf

Browse files
committed
fix: Repair import error for legacy TS testing
- Wrap Dynamo import in version check - Temporarily enable Legacy TS testing on CI
1 parent b5dbc11 commit 6aecdaf

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,3 +1597,22 @@ workflows:
15971597
trt-version-short: << pipeline.parameters.trt-version-short >>
15981598
cudnn-version: << pipeline.parameters.cudnn-version >>
15991599
python-version: << pipeline.parameters.python-version >>
1600+
1601+
# Temporary, for CI run
1602+
- build-x86_64-linux:
1603+
name: build-x86_64-linux-legacy
1604+
torch-build: << pipeline.parameters.torch-build-legacy >>
1605+
torchvision-build: << pipeline.parameters.torchvision-build-legacy >>
1606+
torch-build-index: << pipeline.parameters.torch-build-index-legacy >>
1607+
python-version: << pipeline.parameters.python-version >>
1608+
legacy: << pipeline.parameters.enable-legacy >>
1609+
1610+
- test-py-ts-x86_64-linux:
1611+
name: test-py-ts-x86_64-linux-legacy
1612+
torch-build: << pipeline.parameters.torch-build-legacy >>
1613+
torchvision-build: << pipeline.parameters.torchvision-build-legacy >>
1614+
torch-build-index: << pipeline.parameters.torch-build-index-legacy >>
1615+
trt-version-long: << pipeline.parameters.trt-version-long >>
1616+
python-version: << pipeline.parameters.python-version >>
1617+
requires:
1618+
- build-x86_64-linux-legacy

py/torch_tensorrt/dynamo/backend/backends.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from typing import Sequence
33
import torch
44
from functools import partial
5-
import torch._dynamo as td
5+
6+
if not torch.__version__.startswith("1"):
7+
import torch._dynamo as td
68

79
from torch_tensorrt.dynamo.backend._settings import CompilationSettings
810
from torch_tensorrt.dynamo.backend.lowering._decompositions import (

0 commit comments

Comments
 (0)