Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reorganize Dynamo testing directories #2255

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,30 @@ commands:

# =================== Dynamo tests start ======================== #

test-dynamo-torch_compile:
description: "Test Dynamo torch_compile tests"
test-dynamo-backend:
description: "Test Dynamo backend tests"
steps:
- run:
name: Run Dynamo torch_compile tests
name: Run Dynamo backend tests
command: |
cd tests/py/dynamo/backend/
pytest --junitxml=/tmp/artifacts/test_results/dynamo/torch_compile/test_results.xml
TESTS_TO_RUN=$(circleci tests glob "test_*.py" | circleci tests split --split-by=timings)
pytest --junitxml=/tmp/artifacts/test_results/dynamo/backend/test_results.xml $TESTS_TO_RUN

- store_test_results:
path: /tmp/artifacts
- store_artifacts:
path: /tmp/testlogs

test-dynamo-shared_utilities:
description: "Test Dynamo shared utilities tests"
steps:
- run:
name: Run Dynamo lowering, partitioning, runtime tests
command: |
cd tests/py/dynamo/
TESTS_TO_RUN=$(circleci tests glob "runtime/test_*.py" "partitioning/test_*.py" "lowering/test_*.py" | circleci tests split --split-by=timings)
pytest --junitxml=/tmp/artifacts/test_results/dynamo/shared_utilities/test_results.xml $TESTS_TO_RUN

- store_test_results:
path: /tmp/artifacts
Expand Down Expand Up @@ -808,9 +824,9 @@ commands:
- run:
name: Run Dynamo converter tests
command: |
cd tests/py/dynamo/converters
cd tests/py/dynamo/conversion
TESTS_TO_RUN=$(circleci tests glob "test_*.py" | circleci tests split --split-by=timings)
pytest --junitxml=/tmp/artifacts/test_results/dynamo/converters/test_results.xml $TESTS_TO_RUN
pytest --junitxml=/tmp/artifacts/test_results/dynamo/conversion/test_results.xml $TESTS_TO_RUN

- store_test_results:
path: /tmp/artifacts
Expand Down Expand Up @@ -1103,7 +1119,8 @@ jobs:
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
- dump-test-env
- test-dynamo-converters
- test-dynamo-torch_compile
- test-dynamo-backend
- test-dynamo-shared_utilities
- test-dynamo-models_torch_compile
- test-dynamo-models_torch_export

Expand Down
Empty file added tests/py/dynamo/__init__.py
Empty file.
Empty file.
8 changes: 5 additions & 3 deletions tests/py/dynamo/backend/test_backend_compiler.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from copy import deepcopy

import torch
import torch_tensorrt
from torch.testing._internal.common_utils import TestCase, run_tests
from torch_tensorrt.dynamo.partitioning import fast_partition
from torch.testing._internal.common_utils import run_tests, TestCase
from copy import deepcopy
from utils import lower_graph_testing, DECIMALS_OF_AGREEMENT

from ..testing_utilities import DECIMALS_OF_AGREEMENT, lower_graph_testing


class TestTRTModuleNextCompilation(TestCase):
Expand Down
5 changes: 3 additions & 2 deletions tests/py/dynamo/backend/test_pre_aot_lowering.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import torch
import torch_tensorrt
from utils import lower_graph_testing
from torch.testing._internal.common_utils import run_tests, TestCase
from torch.testing._internal.common_utils import TestCase, run_tests

from ..testing_utilities import lower_graph_testing


class TestMaxPool1D(TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/py/dynamo/backend/test_specialized_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import torch
import torch_tensorrt
from torch.testing._internal.common_utils import TestCase, run_tests
from utils import lower_graph_testing

from ..testing_utilities import lower_graph_testing


class TestFakeTensors(TestCase):
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAbsConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAcosConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAcoshConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from harness import DispatchTestCase
from .harness import DispatchTestCase


class TestAdaptiveAvgPoolConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests

from .harness import DispatchTestCase


class TestAmaxConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAsinConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAsinhConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAtanConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestAtanhConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import torch
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestBatchNormConverter(DispatchTestCase):
def test_batchnorm(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Callable
import unittest
from typing import Callable

import torch
import torch.nn as nn

from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase

NEED_TEST_BOTH_CONSTANTS_CASE = True

elementwise_ops = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt.dynamo.conversion import UnsupportedOperatorException

from .harness import DispatchTestCase


class TestCloneConverter(DispatchTestCase):
def test_clone_contiguous(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import torch.nn as nn
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestCatConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestCeilConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
from parameterized import param, parameterized
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestClampConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
from parameterized import param, parameterized
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestConvolutionConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestCosConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestCoshConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
import torch.nn as nn
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestELUConverter(DispatchTestCase):
def test_elu(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import torch
import torch.nn as nn
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from parameterized import param, parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestEmbeddingConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

import torch
import torch.nn as nn
from harness import DispatchTestCase
from torch.testing._internal.common_utils import run_tests

from .harness import DispatchTestCase


# TODO: Switch this test back to self.run_test once an implementation exists
# for a converter that returns a list, such as aten.split
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestExpConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests

from .harness import DispatchTestCase


class TestExpandConverter(DispatchTestCase):
@parameterized.expand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from harness import DispatchTestCase
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestFloorConverter(DispatchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import torch
import torch.nn as nn
from torch.testing._internal.common_utils import run_tests
from harness import DispatchTestCase
from torch_tensorrt import Input

from .harness import DispatchTestCase


class TestGeLUConverter(DispatchTestCase):
def test_gelu(self):
Expand Down
Loading