diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58239052892d064602f14e2a27683e055d67f827..a61e3425dd5ea14c818ca4cfb895a55b68c89a6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -523,7 +523,7 @@ jobs: ${{ env.extra_docker_args }} ${{ env.pip_cache_docker_args }} \ -e ONEFLOW_TEST_DIR=$PWD/oneflow/python/test/modules \ ${{ env.image_tag }} \ - bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test/generic_test.sh" + bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test_multi_client/generic_test.sh" - name: Dataloader API test timeout-minutes: 45 if: matrix.test_suite == 'cuda_new_interface' diff --git a/ci/test_multi_client/generic_test.sh b/ci/test_multi_client/generic_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1537bfc704ae3e236686a78a70f26b234ef738a5 --- /dev/null +++ b/ci/test_multi_client/generic_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -xe + +export PYTHONUNBUFFERED=1 + +src_dir=${ONEFLOW_SRC_DIR:-"$PWD"} +test_dir=${ONEFLOW_TEST_DIR:-"$PWD/oneflow/python/test/modules"} +test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"} + + +rm -rf $test_tmp_dir +mkdir -p $test_tmp_dir +cp -r $test_dir $test_tmp_dir +cd ${test_tmp_dir}/$(basename $test_dir) + +gpu_num=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) +export ONEFLOW_TEST_DEVICE_NUM=1 +python3 $src_dir/ci/test/parallel_run.py \ + --gpu_num=${gpu_num} \ + --dir=${PWD} \ + --timeout=1 \ + --verbose \ + --chunk=1 + +export ONEFLOW_TEST_DEVICE_NUM=2 +python3 -m oneflow.distributed.launch --nproc_per_node 2 -m unittest discover ${PWD} --failfast --verbose + +export ONEFLOW_TEST_DEVICE_NUM=4 +python3 -m oneflow.distributed.launch --nproc_per_node 4 -m unittest discover ${PWD} --failfast --verbose diff --git a/oneflow/python/framework/unittest.py b/oneflow/python/framework/unittest.py index 76146efe057c7017f96fe656415b7ce6d6ab9242..26bb73369f615d719a49ec1a35a69ba6676b9b7c 100644 --- a/oneflow/python/framework/unittest.py +++ b/oneflow/python/framework/unittest.py @@ -124,6 +124,8 @@ def node_size(): @oneflow_export("unittest.env.has_world_size") def has_world_size(): + if oneflow.distributed.is_multi_client(): + return True if os.getenv("ONEFLOW_TEST_WORLD_SIZE"): assert os.getenv( "ONEFLOW_TEST_WORLD_SIZE" @@ -135,6 +137,8 @@ def has_world_size(): @oneflow_export("unittest.env.world_size") def world_size(): + if oneflow.distributed.is_multi_client(): + return oneflow.distributed.get_world_size() return int(os.getenv("ONEFLOW_TEST_WORLD_SIZE")) diff --git a/oneflow/python/test/modules/test_abs.py b/oneflow/python/test/modules/test_abs.py index 990022fd3f46686270b116e01780e9cb8ef14201..14a5e6a8b571023aafac7a113261dd95edc0b209 100644 --- a/oneflow/python/test/modules/test_abs.py +++ b/oneflow/python/test/modules/test_abs.py @@ -59,6 +59,7 @@ def _test_abs_tensor_function_backward(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestAbs(flow.unittest.TestCase): def test_cosh(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_acos.py b/oneflow/python/test/modules/test_acos.py index 64a1298a98def25fa64636d55d5286a0f3fd0aef..7d96154838a394b46c296501468b64d023ac6536 100644 --- a/oneflow/python/test/modules/test_acos.py +++ b/oneflow/python/test/modules/test_acos.py @@ -39,6 +39,7 @@ def _test_acos_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestAcos(flow.unittest.TestCase): def test_acos(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_acosh.py b/oneflow/python/test/modules/test_acosh.py index 54f8e02ce7c55b32817f42e5d28034d83cadeacc..91c559e0021500cbddbfc9409690a045ad3d977f 100644 --- a/oneflow/python/test/modules/test_acosh.py +++ b/oneflow/python/test/modules/test_acosh.py @@ -41,6 +41,7 @@ def _test_acosh_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestAcosh(flow.unittest.TestCase): def test_acosh(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_activation.py b/oneflow/python/test/modules/test_activation.py index d62a8278312cd91ed03a67861c4e351d37253371..1416bc41938b4e232424f41d2ff418696ef3dbd2 100644 --- a/oneflow/python/test/modules/test_activation.py +++ b/oneflow/python/test/modules/test_activation.py @@ -53,6 +53,7 @@ def _test_relu_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out > 0, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestReLUModule(flow.unittest.TestCase): def test_relu(test_case): arg_dict = OrderedDict() @@ -91,6 +92,7 @@ def _test_relu6_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestReLU6Module(flow.unittest.TestCase): def test_relu6(test_case): arg_dict = OrderedDict() @@ -141,6 +143,7 @@ def _test_tanh_function_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestTanh(flow.unittest.TestCase): def test_tanh(test_case): arg_dict = OrderedDict() @@ -190,6 +193,7 @@ def _test_elu_function_impl(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestELUModule(flow.unittest.TestCase): def test_elu(test_case): arg_dict = OrderedDict() @@ -230,6 +234,7 @@ def _test_gelu_impl(test_case, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestGelu(flow.unittest.TestCase): def test_gelu(test_case): arg_dict = OrderedDict() @@ -302,6 +307,7 @@ def _test_sigmoid_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), x_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSigmoid(flow.unittest.TestCase): def test_sigmoid(test_case): arg_dict = OrderedDict() @@ -405,6 +411,7 @@ def _test_softmax_backward_1_dim(test_case, device): test_case.assertTrue(np.allclose(a.grad.numpy(), a_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSoftmax(flow.unittest.TestCase): def test_softmax(test_case): arg_dict = OrderedDict() @@ -439,6 +446,7 @@ def _test_hardsigmoid_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestHardsigmoidModule(flow.unittest.TestCase): def test_hardsigmoid(test_case): arg_dict = OrderedDict() @@ -581,6 +589,7 @@ def _test_logsoftmax_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), x_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestLogSoftmax(flow.unittest.TestCase): def test_log_softmax(test_case): arg_dict = OrderedDict() @@ -614,6 +623,7 @@ def _test_logsigmoid(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestLogSigmoidModule(flow.unittest.TestCase): def test_logsigmoid(test_case): arg_dict = OrderedDict() @@ -670,6 +680,7 @@ def _test_softplus_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSoftplusModule(flow.unittest.TestCase): def test_softplus(test_case): arg_dict = OrderedDict() @@ -711,6 +722,7 @@ def _test_hardswish_impl(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestHardswishModule(flow.unittest.TestCase): def test_hardswish(test_case): arg_dict = OrderedDict() @@ -750,6 +762,7 @@ def _test_hardtanh_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestHardtanhModule(flow.unittest.TestCase): def test_hardtanh(test_case): arg_dict = OrderedDict() @@ -775,6 +788,7 @@ def _test_leakyrelu_impl(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestLeakyReLUModule(flow.unittest.TestCase): def test_leaky_relu(test_case): arg_dict = OrderedDict() @@ -816,6 +830,7 @@ def _test_mish_backward(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestMishModule(flow.unittest.TestCase): def test_mish(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_adaptive_pool.py b/oneflow/python/test/modules/test_adaptive_pool.py index 1447ef1a2475047589dafa3dcf4121180496d1a2..b7521147d2a1b1cc4719cf53d951bb21d7798a3d 100644 --- a/oneflow/python/test/modules/test_adaptive_pool.py +++ b/oneflow/python/test/modules/test_adaptive_pool.py @@ -188,6 +188,7 @@ def _test_adaptive_avgpool2d_hw_backward(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestAdaptiveAvgPool2d(flow.unittest.TestCase): def test_adaptive_avgpool2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_add.py b/oneflow/python/test/modules/test_add.py index b37fd4cc7f1375ed7515137c40153f5327c39cb3..268039afd783e75f8522a7ba30648f15b71d497b 100644 --- a/oneflow/python/test/modules/test_add.py +++ b/oneflow/python/test/modules/test_add.py @@ -152,6 +152,7 @@ def _test_inplace_add(test_case, shape, device): test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestAddModule(flow.unittest.TestCase): def test_add(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_addmm.py b/oneflow/python/test/modules/test_addmm.py index 28278adf295f97dad91e0647ff70c86efb2b6435..787a0303309c79267628e696dfacc618541f0241 100644 --- a/oneflow/python/test/modules/test_addmm.py +++ b/oneflow/python/test/modules/test_addmm.py @@ -51,6 +51,7 @@ def _test_addmm_backward(test_case, shape, alpha, beta, device): ) +@flow.unittest.skip_unless_1n1d() class TestAddmm(flow.unittest.TestCase): def test_addmm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_allreduce.py b/oneflow/python/test/modules/test_allreduce.py new file mode 100644 index 0000000000000000000000000000000000000000..840cffe8e300cdb40f668e0697ce80d25d85287b --- /dev/null +++ b/oneflow/python/test/modules/test_allreduce.py @@ -0,0 +1,49 @@ +""" +Copyright 2020 The OneFlow Authors. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import unittest +import oneflow.experimental as flow + +import numpy as np + + +@flow.unittest.skip_unless_1n2d() +class TestAllReduce(flow.unittest.TestCase): + def test_all_reduce(test_case): + arr_rank1 = np.array([1, 2]) + arr_rank2 = np.array([3, 4]) + if flow.distributed.get_rank() == 0: + x = flow.Tensor([1, 2]) + elif flow.distributed.get_rank() == 1: + x = flow.Tensor([3, 4]) + else: + raise ValueError + x = x.to(f"cuda:{flow.distributed.get_local_rank()}") + + nccl_allreduce_op = ( + flow.builtin_op("eager_nccl_all_reduce") + .Input("in") + .Output("out") + .Attr("parallel_conf", f'device_tag: "gpu", device_name: "0:0-1"',) + .Build() + ) + + y = nccl_allreduce_op(x)[0] + + test_case.assertTrue(np.allclose(y.numpy(), arr_rank1 + arr_rank2)) + + +if __name__ == "__main__": + unittest.main() diff --git a/oneflow/python/test/modules/test_arange.py b/oneflow/python/test/modules/test_arange.py index 441805c6db5c3f39b6f12fd3c3020ac93650c120..5466fc72c93bdd004945c30ee575800ad68871d0 100644 --- a/oneflow/python/test/modules/test_arange.py +++ b/oneflow/python/test/modules/test_arange.py @@ -49,6 +49,7 @@ def _test_arange_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np.ones(13), 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestArange(flow.unittest.TestCase): def test_transpose(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_argmax.py b/oneflow/python/test/modules/test_argmax.py index d266ad0f4d36ac5ba15112488018bb45ea9b5171..2f6e97661d6adf0677afe950e239b03a88c32db5 100644 --- a/oneflow/python/test/modules/test_argmax.py +++ b/oneflow/python/test/modules/test_argmax.py @@ -75,6 +75,7 @@ def _test_argmax_dim_equal_none(test_case, device): test_case.assertTrue(np.array_equal(of_out.numpy().flatten(), np_out.flatten())) +@flow.unittest.skip_unless_1n1d() class TestArgmax(flow.unittest.TestCase): def test_argmax(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_argsort.py b/oneflow/python/test/modules/test_argsort.py index 2e8c51b46ca730ba080275045385e327db2a1009..88c44be03c97ccc9f05385087e153968cbb5933a 100644 --- a/oneflow/python/test/modules/test_argsort.py +++ b/oneflow/python/test/modules/test_argsort.py @@ -47,6 +47,7 @@ def _test_tensor_argsort(test_case, data_shape, axis, descending, data_type, dev test_case.assertTrue(np.array_equal(of_out.numpy().flatten(), np_out.flatten())) +@flow.unittest.skip_unless_1n1d() class TestArgsort(flow.unittest.TestCase): def test_argsort(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_argwhere.py b/oneflow/python/test/modules/test_argwhere.py index 1dcd4dd43b86003a4d0d4fd67153d82160f02602..dfcbe189e133d00a43aaca19a2487e0cc60af11a 100644 --- a/oneflow/python/test/modules/test_argwhere.py +++ b/oneflow/python/test/modules/test_argwhere.py @@ -31,6 +31,7 @@ def _test_argwhere(test_case, shape, device): test_case.assertTrue(np.array_equal(of_out.numpy().shape, np_out.shape)) +@flow.unittest.skip_unless_1n1d() class TestArgwhere(flow.unittest.TestCase): def test_argwhere(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_atan.py b/oneflow/python/test/modules/test_atan.py index 1f824a0593b80e30208e6d3812aa6bd165c36828..29f9a695bcca90670e2023f089880c74765b65d1 100644 --- a/oneflow/python/test/modules/test_atan.py +++ b/oneflow/python/test/modules/test_atan.py @@ -64,6 +64,7 @@ def _test_arctan(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestAtan(flow.unittest.TestCase): def test_atan(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_atan2.py b/oneflow/python/test/modules/test_atan2.py index 466989031718067e06108c6fc8a4bf6132e57712..5617fe90fa28c0705e0af78c136145385902635f 100644 --- a/oneflow/python/test/modules/test_atan2.py +++ b/oneflow/python/test/modules/test_atan2.py @@ -102,6 +102,7 @@ def _test_atan2_backward(test_case, device): test_y_grad() +@flow.unittest.skip_unless_1n1d() class TestAtan2(flow.unittest.TestCase): def test_atan2_forward(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_atanh.py b/oneflow/python/test/modules/test_atanh.py index 21a669e39487a4858889158917c8c01c165d7499..701d6cc40e85bb0f5e59546042ddec46c82951d9 100644 --- a/oneflow/python/test/modules/test_atanh.py +++ b/oneflow/python/test/modules/test_atanh.py @@ -62,6 +62,7 @@ def _test_arctanh_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestAtanh(flow.unittest.TestCase): def test_atanh(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_autograd.py b/oneflow/python/test/modules/test_autograd.py index 8812b9fdea5c4c9cbe68ac63374f761d51e2ff2a..7e84ccbcce050f7068ddf8e8b631d0fa45a15704 100644 --- a/oneflow/python/test/modules/test_autograd.py +++ b/oneflow/python/test/modules/test_autograd.py @@ -80,6 +80,7 @@ def _test_autograd_grad(test_case, shape, device): # TODO(wyg): create_graph +@flow.unittest.skip_unless_1n1d() class TestAutograd(flow.unittest.TestCase): def test_autograd_interface(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_avgpool.py b/oneflow/python/test/modules/test_avgpool.py index 275c891a476ceb2b71edff2396946db1d693f386..c3f6bf7e95241de857d382e87265fa703aa8b797 100644 --- a/oneflow/python/test/modules/test_avgpool.py +++ b/oneflow/python/test/modules/test_avgpool.py @@ -592,6 +592,7 @@ def _test_avgpool3d_special_kernel_size_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), numpy_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestPoolingModule(flow.unittest.TestCase): def test_avgpool3d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_avgpool2d.py b/oneflow/python/test/modules/test_avgpool2d.py index bf160e50f800e5a68ea299879482eeb85e4b26a7..6d06de0f55b546d24fe24e41eadd33412f8d9e80 100644 --- a/oneflow/python/test/modules/test_avgpool2d.py +++ b/oneflow/python/test/modules/test_avgpool2d.py @@ -412,6 +412,7 @@ g_samples = [ ] +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_AvgPool2d(test_case): global g_samples diff --git a/oneflow/python/test/modules/test_batchnorm.py b/oneflow/python/test/modules/test_batchnorm.py index a58650fdf33a36fa5563e0e64678f67ab9e550e4..70416a886cfc0fe248a0331172e1d4ad8a215a46 100644 --- a/oneflow/python/test/modules/test_batchnorm.py +++ b/oneflow/python/test/modules/test_batchnorm.py @@ -483,6 +483,7 @@ def _test_batchnorm2d_backward(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestBatchNorm(flow.unittest.TestCase): def test_batchnorm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_bce_loss.py b/oneflow/python/test/modules/test_bce_loss.py index e741bf8c37d639cfe04900f785abe34e4dcbd701..c51aff4ba23c5f1e3e2d253aeecf6e4915dacafd 100644 --- a/oneflow/python/test/modules/test_bce_loss.py +++ b/oneflow/python/test/modules/test_bce_loss.py @@ -145,6 +145,7 @@ def _test_bceloss_impl(test_case, device, reduction): test_case.assertTrue(np.allclose(input_none.grad.numpy(), np_grad_none, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestBCELossModule(flow.unittest.TestCase): def test_bceloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_bcewithlogitsloss.py b/oneflow/python/test/modules/test_bcewithlogitsloss.py index 6bc78457dd68f675293bc5b0c1fe925f2772d9aa..77eb94b3e445f36f821e413b981183212d272d54 100644 --- a/oneflow/python/test/modules/test_bcewithlogitsloss.py +++ b/oneflow/python/test/modules/test_bcewithlogitsloss.py @@ -103,6 +103,7 @@ def _test_bcewithlogitsloss_impl(test_case, device, shape, reduction): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestBCEWithLogitsLossModule(flow.unittest.TestCase): def test_bcewithlogitsloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_bernoulli.py b/oneflow/python/test/modules/test_bernoulli.py index 39e531a06493ae9750cf02efb61b6931864302c3..df0e41067a9cd0b245372062427f8c793493eeae 100644 --- a/oneflow/python/test/modules/test_bernoulli.py +++ b/oneflow/python/test/modules/test_bernoulli.py @@ -40,6 +40,7 @@ def _test_bernoulli_with_generator(test_case, shape): test_case.assertTrue(np.allclose(y_1.numpy(), y_2.numpy())) +@flow.unittest.skip_unless_1n1d() class TestBernoulli(flow.unittest.TestCase): def test_bernoulli(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_bmm.py b/oneflow/python/test/modules/test_bmm.py index 1afcf9dab8e44c4fd03592355f7b3a76f5c608f2..96155b0d773ae1b3a669ac335ac28af70f1f5a0e 100644 --- a/oneflow/python/test/modules/test_bmm.py +++ b/oneflow/python/test/modules/test_bmm.py @@ -85,6 +85,7 @@ def _test_bmm_backward(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_bmm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_broadcast_like.py b/oneflow/python/test/modules/test_broadcast_like.py index 9e3d539f59f35e7f42f9fd7e472943c00d67ce41..8198727b1784ded020907b54eaf2e38bdbc48041 100644 --- a/oneflow/python/test/modules/test_broadcast_like.py +++ b/oneflow/python/test/modules/test_broadcast_like.py @@ -90,6 +90,7 @@ def _test_broadcast_like_backward(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestBroadCastLike(flow.unittest.TestCase): def test_broadcast_like(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_cast.py b/oneflow/python/test/modules/test_cast.py index 9c5e4208f8b654efd2ed94cf12816e86b3a37ab2..186581e24dc8f1fa4244cea5fa85820e5e19cb4a 100644 --- a/oneflow/python/test/modules/test_cast.py +++ b/oneflow/python/test/modules/test_cast.py @@ -50,6 +50,7 @@ def _test_cast_backward(test_case, device, shape): test_case.assertTrue(np.array_equal(x.grad.numpy(), np.ones(shape=shape))) +@flow.unittest.skip_unless_1n1d() class TestCast(flow.unittest.TestCase): def test_cast(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_ceil.py b/oneflow/python/test/modules/test_ceil.py index 765e2d63a61991996b92c9b4d47c9512588cd2d5..17fd1ee16f5fae7d577a9b8775c0318cbb3c6c9f 100644 --- a/oneflow/python/test/modules/test_ceil.py +++ b/oneflow/python/test/modules/test_ceil.py @@ -34,6 +34,7 @@ def _test_ceil_impl(test_case, device, shape): test_case.assertTrue(np.allclose(x.grad.numpy(), np.zeros(shape), 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestCeilModule(flow.unittest.TestCase): def test_ceil(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_chunk.py b/oneflow/python/test/modules/test_chunk.py index 1c7d11bf3370a26e6db9d3303b97cac014a412c2..2c759830c8f62eccf490c4c0073e48c09f80beba 100644 --- a/oneflow/python/test/modules/test_chunk.py +++ b/oneflow/python/test/modules/test_chunk.py @@ -185,6 +185,7 @@ def _test_chunk_backward(test_case, device): test_case.assertTrue(np.array_equal(input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestChunk(flow.unittest.TestCase): def test_chunk(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_clamp.py b/oneflow/python/test/modules/test_clamp.py index 7f914581ed618aad477cdc42ea7947e97b38c810..4c0a671deaa26caad10fcba4856fc5cfd47ed87c 100644 --- a/oneflow/python/test/modules/test_clamp.py +++ b/oneflow/python/test/modules/test_clamp.py @@ -85,6 +85,7 @@ def _test_clamp_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestClampModule(flow.unittest.TestCase): def test_clamp(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_concat.py b/oneflow/python/test/modules/test_concat.py index 78cc61c547bd93d1ecad4f42816d871773738b6e..d0b2f5af8eebfff5a7d2749e6b88105de60c95fc 100644 --- a/oneflow/python/test/modules/test_concat.py +++ b/oneflow/python/test/modules/test_concat.py @@ -120,6 +120,7 @@ def _test_concat_grad_and_no_grad(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_concat(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_constant.py b/oneflow/python/test/modules/test_constant.py index 88de42cd763bdfe84aa0602990de4bb3f8d537c5..caf582641f162c96047236cd47355ae4cdbeb8b4 100644 --- a/oneflow/python/test/modules/test_constant.py +++ b/oneflow/python/test/modules/test_constant.py @@ -109,6 +109,7 @@ def _test_new_ones(test_case, device, shape): test_case.assertTrue(np.array_equal(np.ones_like(x.numpy()), x.grad.numpy())) +@flow.unittest.skip_unless_1n1d() class TestConstantModule(flow.unittest.TestCase): def test_cast(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_constantpad2d.py b/oneflow/python/test/modules/test_constantpad2d.py index 573cdc42a6e69d130442454e3dda3f9f722f58f7..d3a42eb45e956e1a47169cd7425efc6787742de1 100644 --- a/oneflow/python/test/modules/test_constantpad2d.py +++ b/oneflow/python/test/modules/test_constantpad2d.py @@ -97,6 +97,7 @@ def _test_ConstantPad2d(test_case, shape, padding, value, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestConstantPad2dModule(flow.unittest.TestCase): def test_ConstantPad2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_conv.py b/oneflow/python/test/modules/test_conv.py index c65613b37564f52706cb9510ae8fc367b88760bb..1b179112780bb98c63499205f5f7d9bd8e5fb165 100644 --- a/oneflow/python/test/modules/test_conv.py +++ b/oneflow/python/test/modules/test_conv.py @@ -1591,6 +1591,7 @@ def _test_conv2d_large_out_channel(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-6, 1e-6)) +@flow.unittest.skip_unless_1n1d() class TestConv2d(flow.unittest.TestCase): def test_conv2d_default_init(test_case): for device in ["cuda", "cpu"]: diff --git a/oneflow/python/test/modules/test_conv1d.py b/oneflow/python/test/modules/test_conv1d.py index 33954f86027b7fbdb6acb488cb31da92aaea4819..a0e70002934fb0bde88006de1ca6d29a043a5c31 100644 --- a/oneflow/python/test/modules/test_conv1d.py +++ b/oneflow/python/test/modules/test_conv1d.py @@ -416,6 +416,7 @@ def _test_conv1d_compilcate(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-6, 1e-6)) +@flow.unittest.skip_unless_1n1d() class TestConv1d(flow.unittest.TestCase): def test_conv1d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_crossentropyloss.py b/oneflow/python/test/modules/test_crossentropyloss.py index fddc608e0f78d2f79a9b46511521397d45604445..454a22e49f0b9ea46383a18dd4d2034ebff5e452 100644 --- a/oneflow/python/test/modules/test_crossentropyloss.py +++ b/oneflow/python/test/modules/test_crossentropyloss.py @@ -96,6 +96,7 @@ g_test_samples = [ ] +@flow.unittest.skip_unless_1n1d() class TestCrossEntropyLossModule(flow.unittest.TestCase): def test_CrossEntropyLoss(test_case): global g_test_samples diff --git a/oneflow/python/test/modules/test_crossentropyloss_grad.py b/oneflow/python/test/modules/test_crossentropyloss_grad.py index b1c2d8aff1ec6519e0b131f0a76900422df21294..0430fc1397720bc0c45688190679504da982304e 100644 --- a/oneflow/python/test/modules/test_crossentropyloss_grad.py +++ b/oneflow/python/test/modules/test_crossentropyloss_grad.py @@ -212,6 +212,7 @@ def _test_CrossEntropyLoss_mean_with_random_input_with_ignore_index(test_case, d ) +@flow.unittest.skip_unless_1n1d() class TestCrossEntropyLossModuleGrad(flow.unittest.TestCase): def test_crossentropyloss_grad(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_ctc_loss.py b/oneflow/python/test/modules/test_ctc_loss.py index 1eb8163d80a8f9e4d52a0a93a81ce5cdee6aeb4b..5dd4fbffb5acadd853564d09a09f996f1975df29 100644 --- a/oneflow/python/test/modules/test_ctc_loss.py +++ b/oneflow/python/test/modules/test_ctc_loss.py @@ -301,6 +301,7 @@ def gen_arg_list(): return GenArgList(arg_dict) +@flow.unittest.skip_unless_1n1d() class TestCTCLoss1n1d(flow.unittest.TestCase): def test_ctc_loss(test_case): for arg in gen_arg_list(): diff --git a/oneflow/python/test/modules/test_dataset.py b/oneflow/python/test/modules/test_dataset.py index 5d693e95bce80329d4cdd5a3954e9c931969be82..533559c0469f1f17c9e301fd6467a03aa28439f9 100644 --- a/oneflow/python/test/modules/test_dataset.py +++ b/oneflow/python/test/modules/test_dataset.py @@ -23,6 +23,7 @@ import numpy as np import oneflow.experimental as flow +@flow.unittest.skip_unless_1n1d() class TestOFRecordModule(flow.unittest.TestCase): def test_record(test_case): batch_size = 1 @@ -254,6 +255,7 @@ def _segm_poly_list_to_tensor(img_segm_poly_list): return poly_array_list, poly_index_array_list +@flow.unittest.skip_unless_1n1d() @flow.unittest.skip_unless_1n1d() class TestCocoReader(flow.unittest.TestCase): def test_coco_reader(test_case): diff --git a/oneflow/python/test/modules/test_deconv.py b/oneflow/python/test/modules/test_deconv.py index b7a48df44d3cb13ac2ac89356b60c93fcfe95830..f93572de10bc42dfac5d549cf324c4f25d55a8dd 100644 --- a/oneflow/python/test/modules/test_deconv.py +++ b/oneflow/python/test/modules/test_deconv.py @@ -853,6 +853,7 @@ def _test_deconv_group_large_in_channel(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-6, 1e-6)) +@flow.unittest.skip_unless_1n1d() class TestDeconv2d(flow.unittest.TestCase): def test_deconv2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_diag.py b/oneflow/python/test/modules/test_diag.py index c91b334827f1d53bdd59417381f2f6d48f47b49d..a1ff854a3397f78449f5e790ac9645e011ce8afd 100644 --- a/oneflow/python/test/modules/test_diag.py +++ b/oneflow/python/test/modules/test_diag.py @@ -132,6 +132,7 @@ def _test_diag_other_dim_non_square_backward(test_case, diagonal, device): ) +@flow.unittest.skip_unless_1n1d() class TestDiag(flow.unittest.TestCase): def test_diag_forward(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_div.py b/oneflow/python/test/modules/test_div.py index 59dab7707c1b783e3609aa9e3108558a09ef6145..860276c4e7b45c3b79a24f42b7646551b495b5ea 100644 --- a/oneflow/python/test/modules/test_div.py +++ b/oneflow/python/test/modules/test_div.py @@ -67,6 +67,7 @@ def _test_div_impl(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad_x, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestDiv(flow.unittest.TestCase): def test_div(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_dropout.py b/oneflow/python/test/modules/test_dropout.py index c28a2563f4075f4ea53d12d916ce3fb0bff3f8bf..3135c06b316efe9b2a1cffd648f27cb48584eea4 100644 --- a/oneflow/python/test/modules/test_dropout.py +++ b/oneflow/python/test/modules/test_dropout.py @@ -89,6 +89,7 @@ def _test_dropout_with_generator(test_case, shape, device): test_case.assertTrue(np.allclose(y_1.numpy(), y_2.numpy())) +@flow.unittest.skip_unless_1n1d() class TestDropout(flow.unittest.TestCase): def test_transpose(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_eq.py b/oneflow/python/test/modules/test_eq.py index 34c3a31e65ba21c9d659bcf3214c7d4931336af3..99c94f4f24ab1d3fe5b9d81edfea99f69b4169ab 100644 --- a/oneflow/python/test/modules/test_eq.py +++ b/oneflow/python/test/modules/test_eq.py @@ -82,6 +82,7 @@ def _test_tensor_eq_operator_float(test_case, shape, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestEq(flow.unittest.TestCase): def test_eq(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_erf.py b/oneflow/python/test/modules/test_erf.py index 8908b069f7489f0dd0b8bf89d4d58039a36a2d35..cd1d2df6cfc6f1ba7f50eb0894e9f29e08dabecd 100644 --- a/oneflow/python/test/modules/test_erf.py +++ b/oneflow/python/test/modules/test_erf.py @@ -66,6 +66,7 @@ def _test_tensor_erf_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestErfModule(flow.unittest.TestCase): def test_erf(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_erfc.py b/oneflow/python/test/modules/test_erfc.py index 29b819753bed27e21fe45ce72c4b5efe55c18548..28f776e92560ffeab138f2626c1969cbe39fcbf0 100644 --- a/oneflow/python/test/modules/test_erfc.py +++ b/oneflow/python/test/modules/test_erfc.py @@ -66,6 +66,7 @@ def _test_tensor_erfc_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestErfcModule(flow.unittest.TestCase): def test_erfc(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_exp.py b/oneflow/python/test/modules/test_exp.py index 4e2dc64599aea7bdc211a05497e839f8c6626b5b..5584a1e0c9ec952eece87b0b0b19818175f307f1 100644 --- a/oneflow/python/test/modules/test_exp.py +++ b/oneflow/python/test/modules/test_exp.py @@ -37,6 +37,7 @@ def _test_exp_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestExp(flow.unittest.TestCase): def test_exp(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_expand.py b/oneflow/python/test/modules/test_expand.py index c8bcd9d70a340ab6ae770a53ff4ab1af448c5066..a8afdf819af2661c12c40f8e3c5355fd70d21a18 100644 --- a/oneflow/python/test/modules/test_expand.py +++ b/oneflow/python/test/modules/test_expand.py @@ -184,6 +184,7 @@ def _test_expand_backward(test_case, device): test_case.assertTrue(np.array_equal(of_input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_expand(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_expm1.py b/oneflow/python/test/modules/test_expm1.py index 598cbab42e2f9802fbd25a548bef90c17437658c..e98606eac112cfd0aa938d0373f20b27b31c356f 100644 --- a/oneflow/python/test/modules/test_expm1.py +++ b/oneflow/python/test/modules/test_expm1.py @@ -38,6 +38,7 @@ def _test_expm1_impl(test_case, device, shape): test_case.assertTrue(np.allclose(x.grad.numpy(), np.exp(x.numpy()), 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestExpm1Module(flow.unittest.TestCase): def test_expm1(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_flatten.py b/oneflow/python/test/modules/test_flatten.py index 0bff48562bbed08892386f43203b198b5e55b934..44cc76685c5079cb47356fda214198d085dee50e 100644 --- a/oneflow/python/test/modules/test_flatten.py +++ b/oneflow/python/test/modules/test_flatten.py @@ -58,6 +58,7 @@ def _test_flatten_backward(test_case, device): test_case.assertTrue(np.array_equal(np.ones(shape=(2, 3, 4, 5)), x.grad.numpy())) +@flow.unittest.skip_unless_1n1d() class TestFlattenModule(flow.unittest.TestCase): def test_cast(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_floor.py b/oneflow/python/test/modules/test_floor.py index 58658a8aca5879e51ed35ee25a373a6a582a968d..092713ac056a3c04bf8077a23de0e99eb28c4cd6 100644 --- a/oneflow/python/test/modules/test_floor.py +++ b/oneflow/python/test/modules/test_floor.py @@ -43,6 +43,7 @@ def _test_floor(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestFloor(flow.unittest.TestCase): def test_floor(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_functional_docstr.py b/oneflow/python/test/modules/test_functional_docstr.py index 9af1847e58fb4f182db36d66547fb5cfe7359514..8202d6bd77da3bf5299252b501e39f66ad19383b 100644 --- a/oneflow/python/test/modules/test_functional_docstr.py +++ b/oneflow/python/test/modules/test_functional_docstr.py @@ -52,6 +52,7 @@ def _run_functional_doctest( runner.run(test) +@flow.unittest.skip_unless_1n1d() class TestFunctionalDocstrModule(flow.unittest.TestCase): def test_functional_docstr(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_gather.py b/oneflow/python/test/modules/test_gather.py index 29baf1615d232ce680f470f7af23983ecaedac4e..c4c5add7d74a40f42f27ba5ef77423c0d6a76e62 100644 --- a/oneflow/python/test/modules/test_gather.py +++ b/oneflow/python/test/modules/test_gather.py @@ -102,6 +102,7 @@ def _test_gather_backward(test_case, device): test_case.assertTrue(np.array_equal(of_input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestGather(flow.unittest.TestCase): def test_gather(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_gather_nd.py b/oneflow/python/test/modules/test_gather_nd.py index 80a1b5945c062e71f1a79a44d77b7ec9a9f19288..4677de7e6a43be1b8db7b64f46aa4d1ffeec67e7 100644 --- a/oneflow/python/test/modules/test_gather_nd.py +++ b/oneflow/python/test/modules/test_gather_nd.py @@ -82,6 +82,7 @@ def _test_gather_nd_backward_t(test_case, device): test_case.assertTrue(np.array_equal(of_input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestGather_nd(flow.unittest.TestCase): def test_gather_nd(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_greater.py b/oneflow/python/test/modules/test_greater.py index 995d7bb46851d849cb52aca743a32ff3ed747b38..9816d2c535f24e49001d04fa34cfe9805708408f 100644 --- a/oneflow/python/test/modules/test_greater.py +++ b/oneflow/python/test/modules/test_greater.py @@ -81,6 +81,7 @@ def _test_greater_float_scalar(test_case, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestGreater(flow.unittest.TestCase): def test_greter(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_greater_equal.py b/oneflow/python/test/modules/test_greater_equal.py index b0225d508b29a05be1f82a1029004673388a510b..e5435feca516580a47ab4bb6fa5f3e258be4dca2 100644 --- a/oneflow/python/test/modules/test_greater_equal.py +++ b/oneflow/python/test/modules/test_greater_equal.py @@ -81,6 +81,7 @@ def _test_greater_equal_float_scalar(test_case, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestGreaterEqual(flow.unittest.TestCase): def test_greter_equal(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_groupnorm.py b/oneflow/python/test/modules/test_groupnorm.py index 2a6e987d01f3669258bd6e10753cd85f987249da..eaec60b0065f6caa46b7b954e64194a3e13eacd5 100644 --- a/oneflow/python/test/modules/test_groupnorm.py +++ b/oneflow/python/test/modules/test_groupnorm.py @@ -323,6 +323,7 @@ def _test_groupnorm_backward_3d(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestGroupNorm(flow.unittest.TestCase): def test_groupnorm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_in_top_k.py b/oneflow/python/test/modules/test_in_top_k.py index 5c76c05be2f154e9df062e313d21eb4f0c46ebc3..7e5107f279eb098c29c3e0e22ed63def19f670b3 100644 --- a/oneflow/python/test/modules/test_in_top_k.py +++ b/oneflow/python/test/modules/test_in_top_k.py @@ -99,6 +99,7 @@ def _test_in_top_k_impl(test_case, shape, k, device): ) +@flow.unittest.skip_unless_1n1d() class TestInTopK(flow.unittest.TestCase): def test_in_top_k(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_instancenorm.py b/oneflow/python/test/modules/test_instancenorm.py index c369b68025bfa266f8088dced28320729a87f7e1..57e5cf454f8ba98ae1b7df1251d28a1dd52bf3dd 100644 --- a/oneflow/python/test/modules/test_instancenorm.py +++ b/oneflow/python/test/modules/test_instancenorm.py @@ -409,6 +409,7 @@ def _test_instancenorm3d_backward(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestInstanceNorm(flow.unittest.TestCase): def test_instancenorm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_instruction_replay.py b/oneflow/python/test/modules/test_instruction_replay.py index fdf8643a21e02ce2c49537f923a53a01c60462e6..a12572fb4b73b1baa6576fab1f4f6382c1fde135 100644 --- a/oneflow/python/test/modules/test_instruction_replay.py +++ b/oneflow/python/test/modules/test_instruction_replay.py @@ -44,6 +44,7 @@ def _test_instruction_replay_impl(test_case, device, shape): oneflow._oneflow_internal.debug.clear_recorded_instructions() +@flow.unittest.skip_unless_1n1d() class TestIntructionReplay(flow.unittest.TestCase): def test_instruction_replay(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_interpolate.py b/oneflow/python/test/modules/test_interpolate.py index 521b43c0602c972d58d1f1cd45c057003cae8999..6fa232616599671a20d80e590632312bdafae94b 100644 --- a/oneflow/python/test/modules/test_interpolate.py +++ b/oneflow/python/test/modules/test_interpolate.py @@ -368,6 +368,7 @@ def _test_interpolate_trilinear_3d_align_corners(test_case, device): not flow.unittest.env.eager_execution_enabled(), ".numpy() doesn't work in lazy mode", ) +@flow.unittest.skip_unless_1n1d() class TestUpsample2d(flow.unittest.TestCase): def test_upsample2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_kldivloss.py b/oneflow/python/test/modules/test_kldivloss.py index 5a87621fddae4d5d2a1ce55c7b0633696a2726e9..75513010ceb3b39a4c027015d7e3af917e85c310 100644 --- a/oneflow/python/test/modules/test_kldivloss.py +++ b/oneflow/python/test/modules/test_kldivloss.py @@ -89,6 +89,7 @@ def _test_kldivloss_backward(test_case, device, shape, reduction, log_target): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestKLDivLossModule(flow.unittest.TestCase): def test_kldivloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_l1loss.py b/oneflow/python/test/modules/test_l1loss.py index f400fa811e6d9478df8b06514c640d26b9c1e650..a79384ceab7253b77a3abf7aab7f28550474a3ff 100644 --- a/oneflow/python/test/modules/test_l1loss.py +++ b/oneflow/python/test/modules/test_l1loss.py @@ -68,6 +68,7 @@ def _test_l1loss_impl(test_case, device, shape, reduction): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestL1LossModule(flow.unittest.TestCase): def test_l1loss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_less.py b/oneflow/python/test/modules/test_less.py index fa880abaddf2662cba83e23d9edbc8879ccfe660..b480639afa2fa0355e68d2085e8eafb811149114 100644 --- a/oneflow/python/test/modules/test_less.py +++ b/oneflow/python/test/modules/test_less.py @@ -77,6 +77,7 @@ def _test_less_float_scalar(test_case, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestLess(flow.unittest.TestCase): def test_less(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_less_equal.py b/oneflow/python/test/modules/test_less_equal.py index 90dd2cd5421e743ef4476b595a19918ff095eb4f..b59f0a955b04efe06dcebc0fac9d696795c7e91c 100644 --- a/oneflow/python/test/modules/test_less_equal.py +++ b/oneflow/python/test/modules/test_less_equal.py @@ -77,6 +77,7 @@ def _test_less_equal_float_scalar(test_case, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestLessEqual(flow.unittest.TestCase): def test_less_equal(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_linear.py b/oneflow/python/test/modules/test_linear.py index 3141f089c1e1b4c8fe8222b03ddbf0ad9698a50f..b6896f9beb823eb75c3c6280e74f1dc013459847 100644 --- a/oneflow/python/test/modules/test_linear.py +++ b/oneflow/python/test/modules/test_linear.py @@ -155,6 +155,7 @@ def _test_linear_backward_with_bias(test_case, device): test_case.assertTrue(np.allclose(np_grad, x.grad.numpy(), 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestLinear(flow.unittest.TestCase): def test_linear_forward(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_log1p.py b/oneflow/python/test/modules/test_log1p.py index 0c9a4b3ff388665b25bd27ed5a4817fbc1581920..5e60d9783060c186f1ec941ba2eeffedbf393bfb 100644 --- a/oneflow/python/test/modules/test_log1p.py +++ b/oneflow/python/test/modules/test_log1p.py @@ -61,6 +61,7 @@ def _test_log1p_tensor_function(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestLog1p(flow.unittest.TestCase): def test_log1p(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_lr_scheduler.py b/oneflow/python/test/modules/test_lr_scheduler.py index a93b002fbf35e2a7ea1a9145b6d8e6e431509b78..e1d6d57ced1766a91d4a8268aa175325519d2c02 100644 --- a/oneflow/python/test/modules/test_lr_scheduler.py +++ b/oneflow/python/test/modules/test_lr_scheduler.py @@ -21,6 +21,7 @@ import oneflow.experimental as flow from oneflow.python.nn.parameter import Parameter +@flow.unittest.skip_unless_1n1d() class TestLrScheduler(flow.unittest.TestCase): base_lr = 1.0 diff --git a/oneflow/python/test/modules/test_marginrankingloss.py b/oneflow/python/test/modules/test_marginrankingloss.py index c18cc69802ab8d6107231cc2b64f1b88692f934b..d8733a789bd4fb98450665af08a38b7d0f174b4a 100644 --- a/oneflow/python/test/modules/test_marginrankingloss.py +++ b/oneflow/python/test/modules/test_marginrankingloss.py @@ -151,6 +151,7 @@ def _test_marginrankingloss_grad(test_case, shape, margin, device): test_case.assertTrue(np.allclose(input2.grad.numpy(), np_out_grad2, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestMarginRankingLossModule(flow.unittest.TestCase): def test_margin_ranking_loss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_masked_fill.py b/oneflow/python/test/modules/test_masked_fill.py index 75e20f41f654e1ab914d5d08340b198bfb40529d..56272068a02a5bced31bd9742a4d234549caff9f 100644 --- a/oneflow/python/test/modules/test_masked_fill.py +++ b/oneflow/python/test/modules/test_masked_fill.py @@ -21,6 +21,7 @@ import oneflow.experimental as flow from automated_test_util import * +@flow.unittest.skip_unless_1n1d() class TestMaskedFill(flow.unittest.TestCase): def test_masked_fill_aginst_pytorch(test_case): import numpy as np diff --git a/oneflow/python/test/modules/test_masked_select.py b/oneflow/python/test/modules/test_masked_select.py index f28a6e1ac2634de11a17fa46880a2453412fd156..8e9c8f5bab460c8f8d8074fb12e9937b041ffa45 100644 --- a/oneflow/python/test/modules/test_masked_select.py +++ b/oneflow/python/test/modules/test_masked_select.py @@ -80,6 +80,7 @@ def _test_masked_select_broadcast(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestAbs(flow.unittest.TestCase): def test_cosh(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_math_ops.py b/oneflow/python/test/modules/test_math_ops.py index 2afe078bc7ec5f8b8ba261120fd9cfccec38bd1f..f6b5e49bda84e9a0a97dfb6022c60fbb7407d3ec 100644 --- a/oneflow/python/test/modules/test_math_ops.py +++ b/oneflow/python/test/modules/test_math_ops.py @@ -61,6 +61,7 @@ def _test_variance_backward(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestVariance(flow.unittest.TestCase): def test_variance(test_case): arg_dict = OrderedDict() @@ -91,6 +92,7 @@ def _test_sinh_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_x_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class Testsinh(flow.unittest.TestCase): def test_sinh(test_case): arg_dict = OrderedDict() @@ -149,6 +151,7 @@ def _test_inplace_sin(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestSin(flow.unittest.TestCase): def test_sin(test_case): arg_dict = OrderedDict() @@ -186,6 +189,7 @@ def _test_cos_backward(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestCos(flow.unittest.TestCase): def test_cos(test_case): arg_dict = OrderedDict() @@ -235,6 +239,7 @@ def _test_log_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestLog(flow.unittest.TestCase): def test_log(test_case): arg_dict = OrderedDict() @@ -269,6 +274,7 @@ def _test_std_negative_dim(test_case, shape, device): test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestStd(flow.unittest.TestCase): def test_std(test_case): arg_dict = OrderedDict() @@ -308,6 +314,7 @@ def _test_sqrt_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestSqrt(flow.unittest.TestCase): def test_sqrt(test_case): arg_dict = OrderedDict() @@ -342,6 +349,7 @@ def _test_rsqrt_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestRsqrt(flow.unittest.TestCase): def test_rsqrt(test_case): arg_dict = OrderedDict() @@ -375,6 +383,7 @@ def _test_square_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestSquare(flow.unittest.TestCase): def test_square(test_case): arg_dict = OrderedDict() @@ -412,6 +421,7 @@ def _test_pow_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestPow(flow.unittest.TestCase): def test_pow(test_case): arg_dict = OrderedDict() @@ -460,6 +470,7 @@ def _test_arcsin(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestAsin(flow.unittest.TestCase): def test_asin(test_case): arg_dict = OrderedDict() @@ -528,6 +539,7 @@ def _test_arcsinh(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestAsinh(flow.unittest.TestCase): def test_asinh(test_case): arg_dict = OrderedDict() @@ -701,6 +713,7 @@ def _test_topk_original(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestPow(flow.unittest.TestCase): def test_pow(test_case): input = flow.Tensor(np.array([1, 2, 3, 4, 5, 6]), dtype=flow.float32) @@ -715,6 +728,7 @@ class TestPow(flow.unittest.TestCase): test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestTopk(flow.unittest.TestCase): def test_topk(test_case): arg_dict = OrderedDict() @@ -748,6 +762,7 @@ def arccosh_input_tensor(shape): not flow.unittest.env.eager_execution_enabled(), ".numpy() doesn't work in lazy mode", ) +@flow.unittest.skip_unless_1n1d() class TestArccosh(flow.unittest.TestCase): def test_arccosh_flow_with_random_data(test_case): for device in ["cpu", "cuda"]: @@ -807,6 +822,7 @@ def acosh_input_tensor(shape): not flow.unittest.env.eager_execution_enabled(), ".numpy() doesn't work in lazy mode", ) +@flow.unittest.skip_unless_1n1d() class TestAcosh(flow.unittest.TestCase): def test_acosh(test_case): arg_dict = OrderedDict() @@ -919,6 +935,7 @@ def _test_atan2_backward(test_case, device): not flow.unittest.env.eager_execution_enabled(), ".numpy() doesn't work in lazy mode", ) +@flow.unittest.skip_unless_1n1d() class TestAtan2(flow.unittest.TestCase): def test_atan2_forward(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_matmul.py b/oneflow/python/test/modules/test_matmul.py index 18d628973f8ad6837bb07a58d7297ebce0cb7ba8..4ad3ab582958928a41f80678f521fd393cc81c9e 100644 --- a/oneflow/python/test/modules/test_matmul.py +++ b/oneflow/python/test/modules/test_matmul.py @@ -315,6 +315,7 @@ def _test_batch_matmul_backward(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_matmul(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_mean.py b/oneflow/python/test/modules/test_mean.py index b43dede0c025060c1270d54d1d908a4fec5832b4..a43adea37019643b545818f5f1a7ab208213b056 100644 --- a/oneflow/python/test/modules/test_mean.py +++ b/oneflow/python/test/modules/test_mean.py @@ -63,6 +63,7 @@ def _test_mean_backward(test_case, shape, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestMean(flow.unittest.TestCase): def test_mean(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_meshgrid.py b/oneflow/python/test/modules/test_meshgrid.py index 2b8b30f3e454a7b6c212536bb3e73aea377ba0fd..e4a9612f1fb83b33645c6f6b787f9f39fa589b3a 100644 --- a/oneflow/python/test/modules/test_meshgrid.py +++ b/oneflow/python/test/modules/test_meshgrid.py @@ -66,6 +66,7 @@ def _test_meshgrid_forawd_3tensor(test_case, device): test_case.assertTrue(np.allclose(of_z.numpy(), np_z, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestMeshGrid(flow.unittest.TestCase): def test_meshgrid(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_module_to.py b/oneflow/python/test/modules/test_module_to.py index 8c445720a69e3b4cc9109bdf732d57671321d9ea..eb170e0cabe22dd7c2bdbb0539133f623812245a 100644 --- a/oneflow/python/test/modules/test_module_to.py +++ b/oneflow/python/test/modules/test_module_to.py @@ -87,6 +87,7 @@ def _test_dummy_module_to(test_case): test_case.assertEqual(m.dummy_para.grad.device, gpu0_device) +@flow.unittest.skip_unless_1n1d() class TestModuleTo(flow.unittest.TestCase): def test_module_to(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_mseloss.py b/oneflow/python/test/modules/test_mseloss.py index d6746d5f676e0d1df00b66cfa9a64fea2f534372..bc505c1d6df29c205d48c4579441304fd6d75a04 100644 --- a/oneflow/python/test/modules/test_mseloss.py +++ b/oneflow/python/test/modules/test_mseloss.py @@ -66,6 +66,7 @@ def _test_mseloss_impl(test_case, device, shape, reduction): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestMSELossModule(flow.unittest.TestCase): def test_mseloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_mul.py b/oneflow/python/test/modules/test_mul.py index 44c1efdf63508c1ad668cf64779c3ddc6edb7699..58cd05ce84f4c3564ff94b4d575dbffa28be4cc0 100644 --- a/oneflow/python/test/modules/test_mul.py +++ b/oneflow/python/test/modules/test_mul.py @@ -98,6 +98,7 @@ def _test_mul_impl(test_case, device): test_case.assertTrue(np.allclose(y.grad.numpy(), x.numpy(), 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestMulModule(flow.unittest.TestCase): def test_mul(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_ne.py b/oneflow/python/test/modules/test_ne.py index 98409707a417ee8939b5ce01b34adefca5b2db33..4ba9839afdb7264c5b34288f824379da7b8d6787 100644 --- a/oneflow/python/test/modules/test_ne.py +++ b/oneflow/python/test/modules/test_ne.py @@ -82,6 +82,7 @@ def _test_tensor_ne_operator_float(test_case, shape, device): test_case.assertTrue(np.array_equal(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestNe(flow.unittest.TestCase): def test_ne(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_negative.py b/oneflow/python/test/modules/test_negative.py index d2162377ca6b14d33746409d29884b3c9fba4bf4..af06e774d756459bbb9a2f7fbc8e48066f8eadc0 100644 --- a/oneflow/python/test/modules/test_negative.py +++ b/oneflow/python/test/modules/test_negative.py @@ -60,6 +60,7 @@ def _test_negative_backward(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestNegativeModule(flow.unittest.TestCase): def test_negative(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_nllloss.py b/oneflow/python/test/modules/test_nllloss.py index c273ac37018bbbd83cfe7f0cd6a0aa56b95621be..2038af18667ed245fbbc5edc5c2ddefcfa6b0f96 100644 --- a/oneflow/python/test/modules/test_nllloss.py +++ b/oneflow/python/test/modules/test_nllloss.py @@ -316,6 +316,7 @@ def _test_nllloss_bert_sum(test_case, device): test_case.assertTrue(np.allclose(of_out.numpy(), np_out)) +@flow.unittest.skip_unless_1n1d() class TestNLLLossModule(flow.unittest.TestCase): def test_nllloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_nllloss_grad.py b/oneflow/python/test/modules/test_nllloss_grad.py index 224cfd1e7040b8efc2f96f852786afa27aea33df..b511d694f7a5dc73e0e75fdbd4500c84e264b77b 100644 --- a/oneflow/python/test/modules/test_nllloss_grad.py +++ b/oneflow/python/test/modules/test_nllloss_grad.py @@ -436,6 +436,7 @@ def _test_nllloss_bert_sum_backward_with_ignore_index(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, atol=1e-5, rtol=1e-5)) +@flow.unittest.skip_unless_1n1d() class TestNLLLossModule(flow.unittest.TestCase): def test_nllloss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_norm.py b/oneflow/python/test/modules/test_norm.py index 9cbf6b8af6869e31f5b8a2106250c51d5917f40e..a7bd456b98b2e8992ed6c85b4e4edb084556fcdf 100644 --- a/oneflow/python/test/modules/test_norm.py +++ b/oneflow/python/test/modules/test_norm.py @@ -241,6 +241,7 @@ def _test_2d_digits_order_norm_backward(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_out_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestNormModule(flow.unittest.TestCase): def test_norm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_normalization.py b/oneflow/python/test/modules/test_normalization.py index a0c59b59d8d54aa68b2923993f6a252f44cbd892..be67e90c3535f1dead93abeab24ba64c780130d5 100644 --- a/oneflow/python/test/modules/test_normalization.py +++ b/oneflow/python/test/modules/test_normalization.py @@ -123,6 +123,7 @@ def _test_layernorm_backward(test_case, device): ) +@flow.unittest.skip_unless_1n1d() class TestLayerNorm(flow.unittest.TestCase): def test_layernorm(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_ones_like.py b/oneflow/python/test/modules/test_ones_like.py index de93cb8c2180219627beb8f0626b370ab9c9cf18..08402115052f665b0d6248f43d6972bf2256609f 100644 --- a/oneflow/python/test/modules/test_ones_like.py +++ b/oneflow/python/test/modules/test_ones_like.py @@ -44,6 +44,7 @@ def _test_ones_like_int(test_case, shape, device): test_case.assertTrue(np.array_equal(y.numpy(), y_numpy)) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_ones_like(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_optim_adam.py b/oneflow/python/test/modules/test_optim_adam.py index 147a2a79a05ea68b5cb9c6cc20b6611d73d7d2e2..a5a893f798a2f95716bca2013ba19195465e3c99 100644 --- a/oneflow/python/test/modules/test_optim_adam.py +++ b/oneflow/python/test/modules/test_optim_adam.py @@ -95,6 +95,7 @@ def compare_with_numpy_adam( ) +@flow.unittest.skip_unless_1n1d() class TestAdam(flow.unittest.TestCase): def test_adam(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_optim_adamw.py b/oneflow/python/test/modules/test_optim_adamw.py index 722cb1c34dc27e83408f44d852f9aaf2690e8275..a6e5799d42737c78d725b4d59ef5b3e8a6ee1d76 100644 --- a/oneflow/python/test/modules/test_optim_adamw.py +++ b/oneflow/python/test/modules/test_optim_adamw.py @@ -88,6 +88,7 @@ def compare_with_numpy_adamw( ) +@flow.unittest.skip_unless_1n1d() class TestAdamW(flow.unittest.TestCase): def test_adamw(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_optim_rmsprop.py b/oneflow/python/test/modules/test_optim_rmsprop.py index a5aa676d2f85f314c56a6dc00131fe6993565389..76a4716b2f4a8281c5c7c9b3d22fc03695f1bba7 100644 --- a/oneflow/python/test/modules/test_optim_rmsprop.py +++ b/oneflow/python/test/modules/test_optim_rmsprop.py @@ -108,6 +108,7 @@ def compare_with_numpy_rmsprop( ) +@flow.unittest.skip_unless_1n1d() class TestRMSProp(flow.unittest.TestCase): def test_rmsprop(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_optim_sgd.py b/oneflow/python/test/modules/test_optim_sgd.py index afb4c329c05a79de3d736070af9135edcbc456cc..7c9e284d914d73066ae5541f06679e731419c7cc 100644 --- a/oneflow/python/test/modules/test_optim_sgd.py +++ b/oneflow/python/test/modules/test_optim_sgd.py @@ -72,6 +72,7 @@ def compare_with_numpy_sgd( ) +@flow.unittest.skip_unless_1n1d() class TestOptimizers(flow.unittest.TestCase): def test_sgd(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_permute.py b/oneflow/python/test/modules/test_permute.py index 8baf8aaacc7c3b8df2975297a7453e05ca3decee..d4d86f23d460d2f3d8b439d80aede2b91f83a175 100644 --- a/oneflow/python/test/modules/test_permute.py +++ b/oneflow/python/test/modules/test_permute.py @@ -38,6 +38,7 @@ def _test_permute_impl(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestPermute(flow.unittest.TestCase): def test_permute(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_pixel_shuffle.py b/oneflow/python/test/modules/test_pixel_shuffle.py index d1936bbf47173eb1a67306a2fc61f12db58850df..bff71dc6c5ee5c3a6d3e1461d40cf699c535ba73 100644 --- a/oneflow/python/test/modules/test_pixel_shuffle.py +++ b/oneflow/python/test/modules/test_pixel_shuffle.py @@ -68,6 +68,7 @@ def _test_pixel_shuffle_impl( test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestPixelShuffleModule(flow.unittest.TestCase): def test_pixel_shuffle(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_pooling.py b/oneflow/python/test/modules/test_pooling.py index 83b3d01c65f51f0e4436ba0541c96611172ca861..29301e1d40441c457b0e21ec487bd067d2a557db 100644 --- a/oneflow/python/test/modules/test_pooling.py +++ b/oneflow/python/test/modules/test_pooling.py @@ -612,6 +612,7 @@ def _test_maxpool3d_negative_input_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), numpy_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestPooling(flow.unittest.TestCase): def test_maxpool1d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_pow.py b/oneflow/python/test/modules/test_pow.py index 7e68d4baeb9c962f0976fe0b63867d0aa5cf9124..6680acda8c0ea5e9b18cd19c03d5bb010152a306 100644 --- a/oneflow/python/test/modules/test_pow.py +++ b/oneflow/python/test/modules/test_pow.py @@ -90,6 +90,7 @@ def _test_pow_backward_impl(test_case, device): test_x_grad_scalar() +@flow.unittest.skip_unless_1n1d() class TestPow(flow.unittest.TestCase): def test_pow_forward(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_prelu.py b/oneflow/python/test/modules/test_prelu.py index 249823381ab93679b9c09f8aa2167bc973eb8a5d..1cce91288a51c6731b5d90451e9b932f5fd8866e 100644 --- a/oneflow/python/test/modules/test_prelu.py +++ b/oneflow/python/test/modules/test_prelu.py @@ -74,6 +74,7 @@ def _test_prelu_grad(test_case, shape, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestPReLU(flow.unittest.TestCase): def test_prelu(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_reciprocal.py b/oneflow/python/test/modules/test_reciprocal.py index 1f9e202acd01bba41e141f2c4ca11c3b85aa6523..e37602e9742f6ba2b70e0d7aa077726b341209c1 100644 --- a/oneflow/python/test/modules/test_reciprocal.py +++ b/oneflow/python/test/modules/test_reciprocal.py @@ -31,6 +31,7 @@ def _test_reciprocal_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestReciprocalModule(flow.unittest.TestCase): def test_reciprocal(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_reduce_ops.py b/oneflow/python/test/modules/test_reduce_ops.py index c626888a06a7f3b3a48f6d22793623775f1e7efd..32a8ea6a6b1eddd0c0da644ca15d48abfff3ec23 100644 --- a/oneflow/python/test/modules/test_reduce_ops.py +++ b/oneflow/python/test/modules/test_reduce_ops.py @@ -67,6 +67,7 @@ def _test_min_tensor_function(test_case, device, shape, dim, keepdims): test_case.assertTrue(np.allclose(x.grad.numpy(), np_out_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestMinModule(flow.unittest.TestCase): def test_min(test_case): arg_dict = OrderedDict() @@ -130,6 +131,7 @@ def _test_max_tensor_function(test_case, device, shape, dim, keepdims): test_case.assertTrue(np.allclose(x.grad.numpy(), np_out_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestMaxModule(flow.unittest.TestCase): def test_max(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_reflection_pad2d.py b/oneflow/python/test/modules/test_reflection_pad2d.py index 28223b874daa9aeb8b060d1134f9d5c03fac24f1..bf2568118a8445d789f9365ba95115d157c41a0d 100644 --- a/oneflow/python/test/modules/test_reflection_pad2d.py +++ b/oneflow/python/test/modules/test_reflection_pad2d.py @@ -109,6 +109,7 @@ def _test_reflection_pad2d(test_case, shape, padding, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestReflectionPad2dModule(flow.unittest.TestCase): def test_reflection_pad2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_repeat.py b/oneflow/python/test/modules/test_repeat.py index f34fc62667cec14498713267539c9effaca2bba3..09c9ccff182767259d4fce5ad856049cac51dc50 100644 --- a/oneflow/python/test/modules/test_repeat.py +++ b/oneflow/python/test/modules/test_repeat.py @@ -128,6 +128,7 @@ def _test_repeat_same_dim_backward(test_case, device): test_case.assertTrue(np.array_equal(input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestRepeat(flow.unittest.TestCase): def test_repeat(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_replicationpad2d.py b/oneflow/python/test/modules/test_replicationpad2d.py index 1d6914d48c111a989987ccb364f98b13b14dad4b..66685cac08467bb067b6b938927456499a3a0755 100644 --- a/oneflow/python/test/modules/test_replicationpad2d.py +++ b/oneflow/python/test/modules/test_replicationpad2d.py @@ -105,6 +105,7 @@ def _test_ReplicationPad2d(test_case, shape, padding, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out_grad, 1e-3, 1e-3)) +@flow.unittest.skip_unless_1n1d() class TestReplicationPad2dModule(flow.unittest.TestCase): def test_ReplicationPad2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_reshape.py b/oneflow/python/test/modules/test_reshape.py index f26e67f27d15453bc5ccf32e8366f281f033a09c..0ff62a03c1725c996a1119eeaf3f36eae1871885 100644 --- a/oneflow/python/test/modules/test_reshape.py +++ b/oneflow/python/test/modules/test_reshape.py @@ -70,6 +70,7 @@ def _test_reshape_backward(test_case, device): test_case.assertTrue(np.allclose(np_grad, input.grad.numpy(), 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_reshape(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_resnet50_with_bn.py b/oneflow/python/test/modules/test_resnet50_with_bn.py index 46fafc4dac14cc4ca6edec755a4a5f8ee88dc832..80b0dabe71a087b0c466b99325e1af8883d22768 100644 --- a/oneflow/python/test/modules/test_resnet50_with_bn.py +++ b/oneflow/python/test/modules/test_resnet50_with_bn.py @@ -19,6 +19,7 @@ import oneflow.experimental as flow from resnet50_model import resnet50 +@flow.unittest.skip_unless_1n1d() @flow.unittest.skip_unless_1n1d() class TestResNet50(flow.unittest.TestCase): def test_resnet50_with_batchnorm(test_case): diff --git a/oneflow/python/test/modules/test_resnet50_without_bn.py b/oneflow/python/test/modules/test_resnet50_without_bn.py index d0cae3cfafb37668b3fc6faf60f6ea55102bb0a3..2f3a9d3ac316ede2dcc675044277c6b29f6602fc 100644 --- a/oneflow/python/test/modules/test_resnet50_without_bn.py +++ b/oneflow/python/test/modules/test_resnet50_without_bn.py @@ -22,6 +22,7 @@ import oneflow.experimental as flow from resnet50_model import resnet50, FakeBN +@flow.unittest.skip_unless_1n1d() @flow.unittest.skip_unless_1n1d() class TestResNet50(flow.unittest.TestCase): def test_resnet50_without_batchnorm(test_case): diff --git a/oneflow/python/test/modules/test_round.py b/oneflow/python/test/modules/test_round.py index 216356d55343c348b67ebadca4293d1123fe2f15..d7e81fe3c6f6dffdba981d0dc2d30092176037b2 100644 --- a/oneflow/python/test/modules/test_round.py +++ b/oneflow/python/test/modules/test_round.py @@ -40,6 +40,7 @@ def _test_round_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestRound(flow.unittest.TestCase): def test_round(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_scatter_nd.py b/oneflow/python/test/modules/test_scatter_nd.py index cf4dc1700311e0d52dd4578db735f0a9e36357f1..cecc8cedd3081d6093165fb01e00de8d21305bd9 100644 --- a/oneflow/python/test/modules/test_scatter_nd.py +++ b/oneflow/python/test/modules/test_scatter_nd.py @@ -84,6 +84,7 @@ def _test_scatter_nd_backward(test_case, device): test_case.assertTrue(np.array_equal(of_update.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestScatter_nd(flow.unittest.TestCase): def test_scatter_nd(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_sign.py b/oneflow/python/test/modules/test_sign.py index 0a64e4035211eb1281e12f94aabf1c62ff205cfc..6d3d6c66ecd0b96c08ea4fe1de7d30981df44b9d 100644 --- a/oneflow/python/test/modules/test_sign.py +++ b/oneflow/python/test/modules/test_sign.py @@ -38,6 +38,7 @@ def _test_sign_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestSign(flow.unittest.TestCase): def test_sign(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_slice.py b/oneflow/python/test/modules/test_slice.py index 869c9d4a92751fbcf02bf71fcf616a339634c964..5f7cb3497ecf6461f56330969d41906a8bfbb777 100644 --- a/oneflow/python/test/modules/test_slice.py +++ b/oneflow/python/test/modules/test_slice.py @@ -125,6 +125,7 @@ def _test_slice_backward(test_case, device): test_case.assertTrue(np.array_equal(x.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestSlice(flow.unittest.TestCase): def test_slice(test_case): arg_dict = OrderedDict() @@ -143,6 +144,7 @@ class TestSlice(flow.unittest.TestCase): arg[0](test_case, *arg[1:]) +@flow.unittest.skip_unless_1n1d() class TestSliceUpdate(flow.unittest.TestCase): def test_slice_update(test_case): x = np.array([1, 1, 1, 1, 1]).astype(np.float32) @@ -153,6 +155,7 @@ class TestSliceUpdate(flow.unittest.TestCase): test_case.assertTrue(np.array_equal(y.numpy(), output)) +@flow.unittest.skip_unless_1n1d() class TestLogicalSliceAssign(flow.unittest.TestCase): # this is an in-place operation, so requires_grad should be False(no grad in backward) def test_logical_slice_assign(test_case): diff --git a/oneflow/python/test/modules/test_smoothl1loss.py b/oneflow/python/test/modules/test_smoothl1loss.py index c740241a19dabce3ddf9d8e515c109f4fcb1f38e..e9689e3a1a45ff70798d72b3517af30d949ab591 100644 --- a/oneflow/python/test/modules/test_smoothl1loss.py +++ b/oneflow/python/test/modules/test_smoothl1loss.py @@ -95,6 +95,7 @@ def _test_smoothl1loss_impl(test_case, device, shape, data_type, reduction, beta test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSmoothL1LossModule(flow.unittest.TestCase): def test_smoothl1loss(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_softplus.py b/oneflow/python/test/modules/test_softplus.py index 28383e98ac479aa014e7685a1f969f417a8995c2..d18e3b20754391854c053c547865666574c6b6ed 100644 --- a/oneflow/python/test/modules/test_softplus.py +++ b/oneflow/python/test/modules/test_softplus.py @@ -38,6 +38,7 @@ def _test_softplus_impl(test_case, shape, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_x_grad, 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class Testsoftplus(flow.unittest.TestCase): def test_softplus(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_sort.py b/oneflow/python/test/modules/test_sort.py index 483a813bffd0ccf3239d5d55b9d26f2dbc11e134..f27bd58e58c671a2f03baf3a7091f733de444b88 100644 --- a/oneflow/python/test/modules/test_sort.py +++ b/oneflow/python/test/modules/test_sort.py @@ -60,6 +60,7 @@ def _test_tensor_sort(test_case, data_shape, axis, descending, data_type, device ) +@flow.unittest.skip_unless_1n1d() class TestSort(flow.unittest.TestCase): def test_sort(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_sparse.py b/oneflow/python/test/modules/test_sparse.py index 0443b825803ca11451aff3823793fd632af3ca9d..351b64f33c40f09d9d8018c23b4a18363b034d49 100644 --- a/oneflow/python/test/modules/test_sparse.py +++ b/oneflow/python/test/modules/test_sparse.py @@ -84,6 +84,7 @@ def _test_embedding_impl(test_case, device): test_case.assertTrue(np.allclose(m.weight.grad.numpy(), weight_grad_np, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestEmbedding(flow.unittest.TestCase): def test_embedding(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_squeeze.py b/oneflow/python/test/modules/test_squeeze.py index 15445168dd6a2778ba9658b6b2631add4daa0de5..3e1e4ee9c828c3e8a4a6473f92e7cdf8f64d26d8 100644 --- a/oneflow/python/test/modules/test_squeeze.py +++ b/oneflow/python/test/modules/test_squeeze.py @@ -84,6 +84,7 @@ def _test_squeeze_backward(test_case, device): test_case.assertTrue(np.array_equal(input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestSqueeze(flow.unittest.TestCase): def test_squeeze(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_stack.py b/oneflow/python/test/modules/test_stack.py index 4ab27dac8b8e51a77920e2b5c498376989da0e5e..9fbeda76567a9e95c3bfef6d88f399e081de7484 100644 --- a/oneflow/python/test/modules/test_stack.py +++ b/oneflow/python/test/modules/test_stack.py @@ -82,6 +82,7 @@ def _test_stack_multi_input(test_case, device, shape): test_case.assertTrue(np.allclose(out_np, out_of.numpy(), 1e-05, 1e-05)) +@flow.unittest.skip_unless_1n1d() class TestStack(flow.unittest.TestCase): def test_stack(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_sub.py b/oneflow/python/test/modules/test_sub.py index c5f6338d2f8d95d579a50c8aaca4303e63df83ea..b5e3c85f44e633d242a37d87cdcad38fd5412b4e 100644 --- a/oneflow/python/test/modules/test_sub.py +++ b/oneflow/python/test/modules/test_sub.py @@ -77,6 +77,7 @@ def _test_sub_impl(test_case, shape, device): test_case.assertTrue(np.allclose(y.grad.numpy(), np_grad_y, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSubModule(flow.unittest.TestCase): def test_sub(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_sum.py b/oneflow/python/test/modules/test_sum.py index bccf8f63191a7bac4b1194a354f36a504d88c30a..0f82d7de8476171d5869a9666cb97c94223b2b17 100644 --- a/oneflow/python/test/modules/test_sum.py +++ b/oneflow/python/test/modules/test_sum.py @@ -62,6 +62,7 @@ def _test_sum_impl(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestSumModule(flow.unittest.TestCase): def test_sum(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_tan.py b/oneflow/python/test/modules/test_tan.py index 896b0df5ec84769f4536e75b70a2228c0b5efed0..cf76dddb56672b4226639b5f3b21d569fde8b133 100644 --- a/oneflow/python/test/modules/test_tan.py +++ b/oneflow/python/test/modules/test_tan.py @@ -42,6 +42,7 @@ def _test_tan_impl(test_case, shape, device): ) +@flow.unittest.skip_unless_1n1d() class TestTan(flow.unittest.TestCase): def test_tan(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_tensor_buffer.py b/oneflow/python/test/modules/test_tensor_buffer.py index 5f5df53df6b1d14871096b88cc5b011d3fc37f31..dbe8553e17d24638e0a3a0912dc703599bd39e88 100644 --- a/oneflow/python/test/modules/test_tensor_buffer.py +++ b/oneflow/python/test/modules/test_tensor_buffer.py @@ -34,6 +34,7 @@ def _test_tensor_buffer_convert(test_case, device): test_case.assertTrue(np.array_equal(input.numpy(), orig_tensor.numpy())) +@flow.unittest.skip_unless_1n1d() class TestTensorBufferOps(flow.unittest.TestCase): def test_tensor_buffer_convert(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_tensor_ops.py b/oneflow/python/test/modules/test_tensor_ops.py index b1d55f2aafecceba4f882c9e63ac1207b30a2b3b..31325c2a2a13eb7336becc7f4496093edd582fe4 100644 --- a/oneflow/python/test/modules/test_tensor_ops.py +++ b/oneflow/python/test/modules/test_tensor_ops.py @@ -37,6 +37,7 @@ def _test_long(test_case, shape, device, dtype): test_case.assertEqual(input.dtype, flow.int64) +@flow.unittest.skip_unless_1n1d() class TestTensorOps(flow.unittest.TestCase): def test_type_as(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_tensor_to.py b/oneflow/python/test/modules/test_tensor_to.py index 4c91b91a496b5bcf0b5a998007e2660b1b08ec9f..946c14383e139d266a94c70af0c675162374e9eb 100644 --- a/oneflow/python/test/modules/test_tensor_to.py +++ b/oneflow/python/test/modules/test_tensor_to.py @@ -20,6 +20,7 @@ import numpy as np import oneflow.experimental as flow +@flow.unittest.skip_unless_1n1d() class TestTo(flow.unittest.TestCase): def test_tensor_to_h2d(test_case): input = flow.Tensor(np.random.randn(2, 3, 4, 5)) diff --git a/oneflow/python/test/modules/test_tile.py b/oneflow/python/test/modules/test_tile.py index 2690397b078c5fa8d13fb599a2a0262756a97547..b26656b6b75bd06217a405e6ba5243adc87dfe85 100644 --- a/oneflow/python/test/modules/test_tile.py +++ b/oneflow/python/test/modules/test_tile.py @@ -153,6 +153,7 @@ def _test_tile_same_dim_backward(test_case, device): test_case.assertTrue(np.array_equal(input.grad.numpy(), np_grad)) +@flow.unittest.skip_unless_1n1d() class TestTile(flow.unittest.TestCase): def test_tile(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_transpose.py b/oneflow/python/test/modules/test_transpose.py index 127d938dbab4f6eedf5bcb66f7c4298f5a900694..2206b8c5f0aea0f668f81809619e054f0beec91b 100644 --- a/oneflow/python/test/modules/test_transpose.py +++ b/oneflow/python/test/modules/test_transpose.py @@ -73,6 +73,7 @@ def _test_transpose_backward_v2(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np.ones((2, 3, 4, 5)), 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestTranspose(flow.unittest.TestCase): def test_transpose(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_triu.py b/oneflow/python/test/modules/test_triu.py index 253157b6e03712a2479fd86531abf4f264f988a8..3595e1b658f87aaab1af10bc9e69244b5ddd1acf 100644 --- a/oneflow/python/test/modules/test_triu.py +++ b/oneflow/python/test/modules/test_triu.py @@ -39,6 +39,7 @@ def _test_triu(test_case, diagonal, device): test_case.assertTrue(np.allclose(input_tensor.grad.numpy(), np_grad, 1e-6, 1e-6)) +@flow.unittest.skip_unless_1n1d() class TestTriu(flow.unittest.TestCase): def test_triu(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_unsqueeze.py b/oneflow/python/test/modules/test_unsqueeze.py index 6eb023c8e3f68355acc814e5c82850a22ed3ea0c..4aed31818681c585a539ad22b4fccdfeda6069b5 100644 --- a/oneflow/python/test/modules/test_unsqueeze.py +++ b/oneflow/python/test/modules/test_unsqueeze.py @@ -55,6 +55,7 @@ def _test_unsqueeze_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), np.ones((2, 3, 4, 5)), 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestUnsqueeze(flow.unittest.TestCase): def test_unsqueeze(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_upsample2d.py b/oneflow/python/test/modules/test_upsample2d.py index 525daff6f8635895d3b42a8fa69f265c348841be..49406d3bf56a9c5bbe3f9d9611850b29fcbf5217 100644 --- a/oneflow/python/test/modules/test_upsample2d.py +++ b/oneflow/python/test/modules/test_upsample2d.py @@ -374,6 +374,7 @@ def _test_upsample_bilinear_align_corners(test_case, device): test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestUpsample2d(flow.unittest.TestCase): def test_upsample2d(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_view.py b/oneflow/python/test/modules/test_view.py index 0b1a5c6b280765f4762de2f5c14a7b4b6994cdbb..297020ae3c8405bbcdf708aa3e45ab017e9cbebf 100644 --- a/oneflow/python/test/modules/test_view.py +++ b/oneflow/python/test/modules/test_view.py @@ -71,6 +71,7 @@ def _test_view_backward(test_case, device): test_case.assertTrue(np.allclose(np_grad, input.grad.numpy(), 1e-4, 1e-4)) +@flow.unittest.skip_unless_1n1d() class TestModule(flow.unittest.TestCase): def test_view(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_where.py b/oneflow/python/test/modules/test_where.py index b875d24ccc37f17994b818e99564e2399e38d721..4624213d2e1a27786a80671c7b4ee466188cd59a 100644 --- a/oneflow/python/test/modules/test_where.py +++ b/oneflow/python/test/modules/test_where.py @@ -172,6 +172,7 @@ def _test_where_broadcast_x_backward(test_case, device): test_case.assertTrue(np.allclose(x.grad.numpy(), x_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestWhere(flow.unittest.TestCase): def test_where(test_case): arg_dict = OrderedDict() diff --git a/oneflow/python/test/modules/test_zeropad2d.py b/oneflow/python/test/modules/test_zeropad2d.py index 334bc631249ee53f4b6da1459b9317893ae9feb8..6becbaa38550b0161aab86b02fe2039d0dd22c3b 100644 --- a/oneflow/python/test/modules/test_zeropad2d.py +++ b/oneflow/python/test/modules/test_zeropad2d.py @@ -96,6 +96,7 @@ def _test_ZeroPad2d(test_case, shape, padding, value, device): test_case.assertTrue(np.allclose(of_input.grad.numpy(), np_out_grad, 1e-5, 1e-5)) +@flow.unittest.skip_unless_1n1d() class TestZeroPad2dModule(flow.unittest.TestCase): def test_ConstantPad2d(test_case): arg_dict = OrderedDict()