Skip to content

Commit f050b16

Browse files
pritamdamaniafacebook-github-bot
authored andcommitted
Move pytorch distributed tests to separate folder for contbuild. (pytorch#30445)
Summary: Pull Request resolved: pytorch#30445 Create distributed and rpc directories under caffe/test for better management of unit tests. Differential Revision: D18702786 fbshipit-source-id: e9daeed0cfb846ef68806f6decfcb57c0e0e3606
1 parent e735395 commit f050b16

File tree

96 files changed

+362
-349
lines changed

Some content is hidden

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

96 files changed

+362
-349
lines changed

.jenkins/pytorch/multigpu-test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131

3232
python tools/download_mnist.py --quiet -d test/cpp/api/mnist
3333
OMP_NUM_THREADS=2 TORCH_CPP_TEST_MNIST_PATH="test/cpp/api/mnist" build/bin/test_api
34-
time python test/run_test.py --verbose -i distributed
35-
time python test/run_test.py --verbose -i c10d
36-
time python test/run_test.py --verbose -i c10d_spawn
34+
time python test/run_test.py --verbose -i distributed/test_distributed
35+
time python test/run_test.py --verbose -i distributed/test_c10d
36+
time python test/run_test.py --verbose -i distributed/test_c10d_spawn
3737
assert_git_not_dirty

.jenkins/pytorch/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,22 @@ elif [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX2-* ]]; then
131131
fi
132132

133133
test_python_nn() {
134-
time python test/run_test.py --include nn --verbose
134+
time python test/run_test.py --include test_nn --verbose
135135
assert_git_not_dirty
136136
}
137137

138138
test_python_ge_config_simple() {
139-
time python test/run_test.py --include jit_simple --verbose
139+
time python test/run_test.py --include test_jit_simple --verbose
140140
assert_git_not_dirty
141141
}
142142

143143
test_python_ge_config_legacy() {
144-
time python test/run_test.py --include jit_legacy jit_fuser_legacy --verbose
144+
time python test/run_test.py --include test_jit_legacy test_jit_fuser_legacy --verbose
145145
assert_git_not_dirty
146146
}
147147

148148
test_python_all_except_nn() {
149-
time python test/run_test.py --exclude nn jit_simple jit_legacy jit_fuser_legacy --verbose --bring-to-front quantization quantized quantized_tensor quantized_nn_mods
149+
time python test/run_test.py --exclude test_nn test_jit_simple test_jit_legacy test_jit_fuser_legacy --verbose --bring-to-front test_quantization test_quantized test_quantized_tensor test_quantized_nn_mods
150150
assert_git_not_dirty
151151
}
152152

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
2-
cd test && python run_test.py --exclude nn jit_simple jit_legacy jit_fuser_legacy --verbose && cd ..
2+
cd test && python run_test.py --exclude test_nn test_jit_simple test_jit_legacy test_jit_fuser_legacy --verbose && cd ..
33
if ERRORLEVEL 1 exit /b 1

.jenkins/pytorch/win-test-helpers/test_python_nn.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ python %SCRIPT_HELPERS_DIR%\run_python_nn_smoketests.py
88
if ERRORLEVEL 1 exit /b 1
99

1010
echo Run nn tests
11-
python run_test.py --include nn --verbose
11+
python run_test.py --include test_nn --verbose
1212
if ERRORLEVEL 1 exit /b 1
1313

1414
popd

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def print_box(msg):
859859
],
860860
'caffe2': [
861861
'python/serialized_test/data/operator_test/*.zip',
862-
]
862+
],
863863
},
864864
url='https://pytorch.org/',
865865
download_url='https://github.com/pytorch/pytorch/tags',

test/test_dist_autograd_spawn.py renamed to test/distributed/rpc/test_dist_autograd_spawn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python3
22
from __future__ import absolute_import, division, print_function, unicode_literals
33

4-
from dist_autograd_test import DistAutogradTest, DistAutogradJitTest
5-
from common_distributed import MultiProcessTestCase
6-
from common_utils import TEST_WITH_ASAN, run_tests
4+
from torch.testing._internal.distributed.rpc.dist_autograd_test import DistAutogradTest, DistAutogradJitTest
5+
from torch.testing._internal.common_distributed import MultiProcessTestCase
6+
from torch.testing._internal.common_utils import TEST_WITH_ASAN, run_tests
77

88
import unittest
99

test/test_dist_optimizer_spawn.py renamed to test/distributed/rpc/test_dist_optimizer_spawn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python3
22
from __future__ import absolute_import, division, print_function, unicode_literals
33

4-
from dist_optimizer_test import DistOptimizerTest
5-
from common_distributed import MultiProcessTestCase
6-
from common_utils import TEST_WITH_ASAN, run_tests
4+
from torch.testing._internal.distributed.rpc.dist_optimizer_test import DistOptimizerTest
5+
from torch.testing._internal.common_distributed import MultiProcessTestCase
6+
from torch.testing._internal.common_utils import TEST_WITH_ASAN, run_tests
77

88
import unittest
99

test/test_rpc_spawn.py renamed to test/distributed/rpc/test_rpc_spawn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python3
22
from __future__ import absolute_import, division, print_function, unicode_literals
33

4-
from rpc_test import RpcTest
5-
from common_distributed import MultiProcessTestCase
6-
from common_utils import TEST_WITH_ASAN, run_tests
4+
from torch.testing._internal.distributed.rpc.rpc_test import RpcTest
5+
from torch.testing._internal.common_distributed import MultiProcessTestCase
6+
from torch.testing._internal.common_utils import TEST_WITH_ASAN, run_tests
77

88
import unittest
99

test/test_c10d.py renamed to test/distributed/test_c10d.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@
1919

2020
import torch
2121
from torch._six import string_classes
22-
import common_utils as common
22+
import torch.testing._internal.common_utils as common
2323
from torch import nn
2424
import torch.nn.functional as F
2525
import torch.distributed as c10d
2626
import torch.distributed as dist
2727
from torch.nn.parallel import DistributedDataParallel
2828

29-
from common_distributed import MultiProcessTestCase, \
29+
from torch.testing._internal.common_distributed import MultiProcessTestCase, \
3030
requires_gloo, requires_nccl, requires_nccl_version, \
3131
skip_if_not_multigpu, skip_if_lt_x_gpu, skip_for_known_issues, get_timeout, skip_if_rocm, \
3232
simple_sparse_reduce_tests
33-
from common_utils import TestCase, load_tests, run_tests, retry_on_address_already_in_use_error, TEST_WITH_TSAN
33+
34+
from torch.testing._internal.common_utils import TestCase, load_tests, run_tests, \
35+
retry_on_address_already_in_use_error, TEST_WITH_TSAN
3436

3537
# load_tests from common_utils is used to automatically filter tests for
3638
# sharding on sandcastle. This line silences flake warnings

test/test_c10d_spawn.py renamed to test/distributed/test_c10d_spawn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import torch.distributed as c10d
77
import torch.multiprocessing as mp
88

9-
from common_cuda import TEST_MULTIGPU
10-
from common_utils import TestCase, load_tests, run_tests
11-
from common_utils import NO_MULTIPROCESSING_SPAWN
9+
from torch.testing._internal.common_cuda import TEST_MULTIGPU
10+
from torch.testing._internal.common_utils import TestCase, load_tests, run_tests
11+
from torch.testing._internal.common_utils import NO_MULTIPROCESSING_SPAWN
1212

1313
# load_tests from common_utils is used to automatically filter tests for
1414
# sharding on sandcastle. This line silences flake warnings

0 commit comments

Comments
 (0)