Skip to content

Commit 9bd42d0

Browse files
committed
fix: Reorganize testing directories
1 parent c5975fb commit 9bd42d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+111
-61
lines changed

.circleci/config.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -754,14 +754,30 @@ commands:
754754

755755
# =================== Dynamo tests start ======================== #
756756

757-
test-dynamo-torch_compile:
758-
description: "Test Dynamo torch_compile tests"
757+
test-dynamo-backend:
758+
description: "Test Dynamo backend tests"
759759
steps:
760760
- run:
761-
name: Run Dynamo torch_compile tests
761+
name: Run Dynamo backend tests
762762
command: |
763763
cd tests/py/dynamo/backend/
764-
pytest --junitxml=/tmp/artifacts/test_results/dynamo/torch_compile/test_results.xml
764+
TESTS_TO_RUN=$(circleci tests glob "test_*.py" | circleci tests split --split-by=timings)
765+
pytest --junitxml=/tmp/artifacts/test_results/dynamo/backend/test_results.xml $TESTS_TO_RUN
766+
767+
- store_test_results:
768+
path: /tmp/artifacts
769+
- store_artifacts:
770+
path: /tmp/testlogs
771+
772+
test-dynamo-shared_utilities:
773+
description: "Test Dynamo shared utilities tests"
774+
steps:
775+
- run:
776+
name: Run Dynamo lowering, partitioning, runtime tests
777+
command: |
778+
cd tests/py/dynamo/
779+
TESTS_TO_RUN=$(circleci tests glob "runtime/test_*.py" "partitioning/test_*.py" "lowering/test_*.py" | circleci tests split --split-by=timings)
780+
pytest --junitxml=/tmp/artifacts/test_results/dynamo/shared_utilities/test_results.xml $TESTS_TO_RUN
765781
766782
- store_test_results:
767783
path: /tmp/artifacts
@@ -1079,7 +1095,8 @@ jobs:
10791095
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
10801096
- dump-test-env
10811097
- test-dynamo-converters
1082-
- test-dynamo-torch_compile
1098+
- test-dynamo-backend
1099+
- test-dynamo-shared_utilities
10831100
- test-dynamo-models_torch_compile
10841101
- test-dynamo-models_torch_export
10851102

tests/py/dynamo/__init__.py

Whitespace-only changes.

tests/py/dynamo/backend/__init__.py

Whitespace-only changes.

tests/py/dynamo/backend/test_backend_compiler.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
from copy import deepcopy
2+
13
import torch
24
import torch_tensorrt
5+
from torch.testing._internal.common_utils import TestCase, run_tests
36
from torch_tensorrt.dynamo.partitioning import fast_partition
4-
from torch.testing._internal.common_utils import run_tests, TestCase
5-
from copy import deepcopy
6-
from utils import lower_graph_testing, DECIMALS_OF_AGREEMENT
7+
8+
from ..testing_utilities import DECIMALS_OF_AGREEMENT, lower_graph_testing
79

810

911
class TestTRTModuleNextCompilation(TestCase):

tests/py/dynamo/backend/test_pre_aot_lowering.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import torch
22
import torch_tensorrt
3-
from utils import lower_graph_testing
4-
from torch.testing._internal.common_utils import run_tests, TestCase
3+
from torch.testing._internal.common_utils import TestCase, run_tests
4+
5+
from ..testing_utilities import lower_graph_testing
56

67

78
class TestMaxPool1D(TestCase):

tests/py/dynamo/backend/test_specialized_models.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from utils import lower_graph_testing
2-
from torch.testing._internal.common_utils import run_tests, TestCase
31
import torch
42
import torch_tensorrt
3+
from torch.testing._internal.common_utils import TestCase, run_tests
4+
5+
from ..testing_utilities import lower_graph_testing
56

67

78
class TestFakeTensors(TestCase):

tests/py/dynamo/conversion/__init__.py

Whitespace-only changes.

tests/py/dynamo/converters/test_adaptive_avgpool_aten.py renamed to tests/py/dynamo/conversion/test_adaptive_avgpool_aten.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from torch.testing._internal.common_utils import run_tests
44
from torch_tensorrt import Input
55

6-
from harness import DispatchTestCase
6+
from .harness import DispatchTestCase
77

88

99
class TestAdaptiveAvgPoolConverter(DispatchTestCase):

tests/py/dynamo/converters/test_batchnorm_aten.py renamed to tests/py/dynamo/conversion/test_batchnorm_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import torch
22
from torch.testing._internal.common_utils import run_tests
3-
from harness import DispatchTestCase
43
from torch_tensorrt import Input
54

5+
from .harness import DispatchTestCase
6+
67

78
class TestBatchNormConverter(DispatchTestCase):
89
def test_batchnorm(self):

tests/py/dynamo/converters/test_binary_ops_aten.py renamed to tests/py/dynamo/conversion/test_binary_ops_aten.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from typing import Callable
21
import unittest
2+
from typing import Callable
33

44
import torch
55
import torch.nn as nn
6-
76
from parameterized import parameterized
87
from torch.testing._internal.common_utils import run_tests
9-
from harness import DispatchTestCase
108
from torch_tensorrt import Input
119

10+
from .harness import DispatchTestCase
11+
1212
NEED_TEST_BOTH_CONSTANTS_CASE = True
1313

1414
elementwise_ops = [

tests/py/dynamo/converters/test_casts.py renamed to tests/py/dynamo/conversion/test_casts.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
3-
from harness import DispatchTestCase
43
from torch.testing._internal.common_utils import run_tests
54
from torch_tensorrt.dynamo.conversion import UnsupportedOperatorException
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestCloneConverter(DispatchTestCase):
910
def test_clone_contiguous(self):

tests/py/dynamo/converters/test_cat_aten.py renamed to tests/py/dynamo/conversion/test_cat_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import torch.nn as nn
33
from parameterized import parameterized
44
from torch.testing._internal.common_utils import run_tests
5-
from harness import DispatchTestCase
65
from torch_tensorrt import Input
76

7+
from .harness import DispatchTestCase
8+
89

910
class TestCatConverter(DispatchTestCase):
1011
@parameterized.expand(

tests/py/dynamo/converters/test_clamp_aten.py renamed to tests/py/dynamo/conversion/test_clamp_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
from parameterized import param, parameterized
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestClampConverter(DispatchTestCase):
910
@parameterized.expand(

tests/py/dynamo/converters/test_convolution_aten.py renamed to tests/py/dynamo/conversion/test_convolution_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
from parameterized import param, parameterized
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestConvolutionConverter(DispatchTestCase):
910
@parameterized.expand(

tests/py/dynamo/converters/test_elu_aten.py renamed to tests/py/dynamo/conversion/test_elu_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestELUConverter(DispatchTestCase):
910
def test_elu(self):

tests/py/dynamo/converters/test_embedding_aten.py renamed to tests/py/dynamo/conversion/test_embedding_aten.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import torch
22
import torch.nn as nn
3-
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
53
from parameterized import param, parameterized
4+
from torch.testing._internal.common_utils import run_tests
65
from torch_tensorrt import Input
76

7+
from .harness import DispatchTestCase
8+
89

910
class TestEmbeddingConverter(DispatchTestCase):
1011
@parameterized.expand(

tests/py/dynamo/converters/test_evaluators.py renamed to tests/py/dynamo/conversion/test_evaluators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import torch
55
import torch.nn as nn
6-
from harness import DispatchTestCase
76
from torch.testing._internal.common_utils import run_tests
87

8+
from .harness import DispatchTestCase
9+
910

1011
# TODO: Switch this test back to self.run_test once an implementation exists
1112
# for a converter that returns a list, such as aten.split

tests/py/dynamo/converters/test_expand_aten.py renamed to tests/py/dynamo/conversion/test_expand_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import torch.nn as nn
33
from parameterized import parameterized
44
from torch.testing._internal.common_utils import run_tests
5-
from harness import DispatchTestCase
5+
6+
from .harness import DispatchTestCase
67

78

89
class TestExpandConverter(DispatchTestCase):

tests/py/dynamo/converters/test_gelu_aten.py renamed to tests/py/dynamo/conversion/test_gelu_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestGeLUConverter(DispatchTestCase):
910
def test_gelu(self):

tests/py/dynamo/converters/test_hardtanh_aten.py renamed to tests/py/dynamo/conversion/test_hardtanh_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestHardTanHConverter(DispatchTestCase):
910
def test_hardtanh(self):

tests/py/dynamo/converters/test_layer_norm_aten.py renamed to tests/py/dynamo/conversion/test_layer_norm_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import torch
22
from torch.testing._internal.common_utils import run_tests
3-
from harness import DispatchTestCase
43
from torch_tensorrt import Input
54

5+
from .harness import DispatchTestCase
6+
67

78
class TestLayerNormConverter(DispatchTestCase):
89
def test_layer_norm(self):

tests/py/dynamo/converters/test_leaky_relu_aten.py renamed to tests/py/dynamo/conversion/test_leaky_relu_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestLeakyReLUConverter(DispatchTestCase):
910
def test_leaky_relu(self):

tests/py/dynamo/converters/test_linear_aten.py renamed to tests/py/dynamo/conversion/test_linear_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import torch
22
from parameterized import parameterized
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
4+
5+
from .harness import DispatchTestCase
56

67

78
class TestLinearConverter(DispatchTestCase):

tests/py/dynamo/converters/test_matmul_aten.py renamed to tests/py/dynamo/conversion/test_matmul_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import torch.nn as nn
33
from parameterized import parameterized
44
from torch.testing._internal.common_utils import run_tests
5-
from harness import DispatchTestCase
5+
6+
from .harness import DispatchTestCase
67

78

89
class TestMatMulConverter(DispatchTestCase):

tests/py/dynamo/converters/test_mean_aten.py renamed to tests/py/dynamo/conversion/test_mean_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestMeanDimConverter(DispatchTestCase):
910
def test_mean_dim_keepdims(self):

tests/py/dynamo/converters/test_permutation_aten.py renamed to tests/py/dynamo/conversion/test_permutation_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import torch.nn as nn
33
from parameterized import parameterized
44
from torch.testing._internal.common_utils import run_tests
5-
from harness import DispatchTestCase
65
from torch_tensorrt import Input
76

7+
from .harness import DispatchTestCase
8+
89

910
class TestPermuteConverter(DispatchTestCase):
1011
@parameterized.expand(

tests/py/dynamo/converters/test_relu_aten.py renamed to tests/py/dynamo/conversion/test_relu_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestReLUConverter(DispatchTestCase):
910
def test_relu(self):

tests/py/dynamo/converters/test_reshape_aten.py renamed to tests/py/dynamo/conversion/test_reshape_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import torch
55
from parameterized import parameterized
66
from torch.testing._internal.common_utils import run_tests
7-
from harness import DispatchTestCase
87
from torch_tensorrt import Input
98

9+
from .harness import DispatchTestCase
10+
1011

1112
class TestReshapeConverter(DispatchTestCase):
1213
@parameterized.expand(

tests/py/dynamo/converters/test_rsqrt_aten.py renamed to tests/py/dynamo/conversion/test_rsqrt_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import torch.nn as nn
33
from parameterized import parameterized
44
from torch.testing._internal.common_utils import run_tests
5-
from harness import DispatchTestCase
65
from torch_tensorrt import Input
76

7+
from .harness import DispatchTestCase
8+
89

910
class TestRSqrtConverter(DispatchTestCase):
1011
@parameterized.expand(

tests/py/dynamo/converters/test_select_aten.py renamed to tests/py/dynamo/conversion/test_select_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
from parameterized import parameterized
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestSelectConverterOne(DispatchTestCase):
910
@parameterized.expand(

tests/py/dynamo/converters/test_selu_aten.py renamed to tests/py/dynamo/conversion/test_selu_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestSeLUConverter(DispatchTestCase):
910
def test_selu(self):

tests/py/dynamo/converters/test_sigmoid_aten.py renamed to tests/py/dynamo/conversion/test_sigmoid_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestSigmoidConverter(DispatchTestCase):
910
def test_sigmoid(self):

tests/py/dynamo/converters/test_slice_aten.py renamed to tests/py/dynamo/conversion/test_slice_aten.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import torch
22
from parameterized import parameterized
33
from torch.testing._internal.common_utils import run_tests
4-
from harness import DispatchTestCase
54
from torch_tensorrt import Input
65

6+
from .harness import DispatchTestCase
7+
78

89
class TestSelectConverterImplicitBatch(DispatchTestCase):
910
@parameterized.expand(

0 commit comments

Comments
 (0)