Skip to content

Commit b9c8578

Browse files
authored
Merge pull request #2255 from pytorch/testing_reorg
fix: Reorganize Dynamo testing directories
2 parents 31d30e2 + c8c906e commit b9c8578

Some content is hidden

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

71 files changed

+289
-229
lines changed

.circleci/config.yml

+24-7
Original file line numberDiff line numberDiff line change
@@ -756,14 +756,30 @@ commands:
756756

757757
# =================== Dynamo tests start ======================== #
758758

759-
test-dynamo-torch_compile:
760-
description: "Test Dynamo torch_compile tests"
759+
test-dynamo-backend:
760+
description: "Test Dynamo backend tests"
761761
steps:
762762
- run:
763-
name: Run Dynamo torch_compile tests
763+
name: Run Dynamo backend tests
764764
command: |
765765
cd tests/py/dynamo/backend/
766-
pytest --junitxml=/tmp/artifacts/test_results/dynamo/torch_compile/test_results.xml
766+
TESTS_TO_RUN=$(circleci tests glob "test_*.py" | circleci tests split --split-by=timings)
767+
pytest --junitxml=/tmp/artifacts/test_results/dynamo/backend/test_results.xml $TESTS_TO_RUN
768+
769+
- store_test_results:
770+
path: /tmp/artifacts
771+
- store_artifacts:
772+
path: /tmp/testlogs
773+
774+
test-dynamo-shared_utilities:
775+
description: "Test Dynamo shared utilities tests"
776+
steps:
777+
- run:
778+
name: Run Dynamo lowering, partitioning, runtime tests
779+
command: |
780+
cd tests/py/dynamo/
781+
TESTS_TO_RUN=$(circleci tests glob "runtime/test_*.py" "partitioning/test_*.py" "lowering/test_*.py" | circleci tests split --split-by=timings)
782+
pytest --junitxml=/tmp/artifacts/test_results/dynamo/shared_utilities/test_results.xml $TESTS_TO_RUN
767783
768784
- store_test_results:
769785
path: /tmp/artifacts
@@ -808,9 +824,9 @@ commands:
808824
- run:
809825
name: Run Dynamo converter tests
810826
command: |
811-
cd tests/py/dynamo/converters
827+
cd tests/py/dynamo/conversion
812828
TESTS_TO_RUN=$(circleci tests glob "test_*.py" | circleci tests split --split-by=timings)
813-
pytest --junitxml=/tmp/artifacts/test_results/dynamo/converters/test_results.xml $TESTS_TO_RUN
829+
pytest --junitxml=/tmp/artifacts/test_results/dynamo/conversion/test_results.xml $TESTS_TO_RUN
814830
815831
- store_test_results:
816832
path: /tmp/artifacts
@@ -1103,7 +1119,8 @@ jobs:
11031119
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
11041120
- dump-test-env
11051121
- test-dynamo-converters
1106-
- test-dynamo-torch_compile
1122+
- test-dynamo-backend
1123+
- test-dynamo-shared_utilities
11071124
- test-dynamo-models_torch_compile
11081125
- test-dynamo-models_torch_export
11091126

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import torch
22
import torch_tensorrt
33
from torch.testing._internal.common_utils import TestCase, run_tests
4-
from utils import lower_graph_testing
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_abs_aten.py renamed to tests/py/dynamo/conversion/test_abs_aten.py

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

88

99
class TestAbsConverter(DispatchTestCase):

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

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

88

99
class TestAcosConverter(DispatchTestCase):

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

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

88

99
class TestAcoshConverter(DispatchTestCase):

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_amax_aten.py renamed to tests/py/dynamo/conversion/test_amax_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
3-
from harness import DispatchTestCase
43
from parameterized import parameterized
54
from torch.testing._internal.common_utils import run_tests
65

6+
from .harness import DispatchTestCase
7+
78

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

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

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

88

99
class TestAsinConverter(DispatchTestCase):

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

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

88

99
class TestAsinhConverter(DispatchTestCase):

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

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

88

99
class TestAtanConverter(DispatchTestCase):

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

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

88

99
class TestAtanhConverter(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_ceil_aten.py renamed to tests/py/dynamo/conversion/test_ceil_aten.py

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

88

99
class TestCeilConverter(DispatchTestCase):

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_cos_aten.py renamed to tests/py/dynamo/conversion/test_cos_aten.py

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

88

99
class TestCosConverter(DispatchTestCase):

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

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

88

99
class TestCoshConverter(DispatchTestCase):

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_exp_aten.py renamed to tests/py/dynamo/conversion/test_exp_aten.py

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

88

99
class TestExpConverter(DispatchTestCase):

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
@@ -1,9 +1,10 @@
11
import torch
22
import torch.nn as nn
3-
from harness import DispatchTestCase
43
from parameterized import parameterized
54
from torch.testing._internal.common_utils import run_tests
65

6+
from .harness import DispatchTestCase
7+
78

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

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

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

88

99
class TestFloorConverter(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):

0 commit comments

Comments
 (0)