Skip to content

Commit

Permalink
[distributed_test]Enable disabled ROCm tests. (pytorch#50421)
Browse files Browse the repository at this point in the history
Summary:
Signed-off-by: Jagadish Krishnamoorthy <jagdish.krishna@gmail.com>

Pull Request resolved: pytorch#50421

Reviewed By: ejguan

Differential Revision: D26006844

Pulled By: zhaojuanmao

fbshipit-source-id: aa6ac5ee2d37f354d52328c72eb2cd23f5665f53
  • Loading branch information
jaglinux authored and facebook-github-bot committed Jan 22, 2021
1 parent aa3c28a commit eb0fe70
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions torch/testing/_internal/distributed/distributed_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,6 @@ def test_reduce_sum(self):

@unittest.skipIf(BACKEND != "nccl", "Only Nccl supports CUDA reduce")
@skip_if_no_gpu
@skip_if_rocm
def test_reduce_sum_cuda(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -1256,7 +1255,6 @@ def test_reduce_sum_twice(self):

@unittest.skipIf(BACKEND != "nccl", "Only Nccl supports CUDA reduce")
@skip_if_no_gpu
@skip_if_rocm
def test_reduce_sum_cuda_twice(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -1635,7 +1633,6 @@ def test_sparse_all_reduce_sum(self):

@unittest.skipIf(BACKEND != "gloo", "Only Gloo backend support sparse all reduce")
@skip_if_no_gpu
@skip_if_rocm
def test_sparse_all_reduce_sum_cuda(self):
self._test_sparse_all_reduce_sum(lambda t: t.clone().cuda())

Expand Down Expand Up @@ -2227,7 +2224,6 @@ def test_all_to_all_single_equal_split(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
def test_all_to_all_single_equal_split_cuda(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand All @@ -2250,7 +2246,6 @@ def test_all_to_all_single_unequal_split(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
def test_all_to_all_single_unequal_split_cuda(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -2286,7 +2281,6 @@ def test_all_to_all_single_equal_split_group(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
@skip_if_small_worldsize
def test_all_to_all_single_equal_split_group_cuda(self):
group, group_id, rank = self._init_group_test()
Expand All @@ -2311,7 +2305,6 @@ def test_all_to_all_single_unequal_split_group(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
@skip_if_small_worldsize
def test_all_to_all_single_unequal_split_group_cuda(self):
group, group_id, rank = self._init_global_test()
Expand Down Expand Up @@ -2356,7 +2349,6 @@ def test_all_to_all_single_equal_split_full_group(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
def test_all_to_all_single_equal_split_full_group_cuda(self):
group, group_id, rank = self._init_full_group_test()
rank_to_GPU = self._init_multigpu_helper()
Expand All @@ -2379,7 +2371,6 @@ def test_all_to_all_single_unequal_split_full_group(self):
BACKEND != "nccl", "Only Nccl supports CUDA all_to_all_single"
)
@skip_if_no_gpu
@skip_if_rocm
def test_all_to_all_single_unequal_split_full_group_cuda(self):
group, group_id, rank = self._init_full_group_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -2443,7 +2434,6 @@ def test_barrier_cuda(self):
@skip_if_small_worldsize
@skip_if_no_gpu
@unittest.skipIf(BACKEND == "mpi", "MPI doesn't supports GPU barrier")
@skip_if_rocm
def test_barrier_group_cuda(self):
group, group_id, rank = self._init_group_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -2583,7 +2573,6 @@ def _test_reduce_multigpu_helper(

@unittest.skipIf(BACKEND != "nccl", "Only Nccl backend supports reduce multigpu")
@skip_if_no_gpu
@skip_if_rocm
def test_reduce_multigpu(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -2820,7 +2809,6 @@ def test_DistributedDataParallel_requires_grad(self):
"Only NCCL and GLOO backend support DistributedDataParallel",
)
@skip_if_lt_x_gpu(int(os.environ["WORLD_SIZE"]))
@skip_if_rocm
def test_DistributedDataParallel_non_default_stream(self):
stream = torch.cuda.Stream(self.rank)
rank = self.rank
Expand Down Expand Up @@ -2896,7 +2884,6 @@ def test_DistributedDataParallel_powerSGD_ddp_comm_hook(self):
@unittest.skipIf(BACKEND != 'nccl' and BACKEND != 'gloo',
"Only Nccl & Gloo backend support DistributedDataParallel")
@skip_if_no_gpu
@skip_if_rocm
def test_DistributedDataParallel(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand All @@ -2913,7 +2900,6 @@ def test_DistributedDataParallel(self):
@unittest.skipIf(BACKEND != 'nccl' and BACKEND != 'gloo',
"Only Nccl & Gloo backend support DistributedDataParallel")
@skip_if_no_gpu
@skip_if_rocm
def test_DistributedDataParallel_with_grad_is_view(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -3070,7 +3056,6 @@ def test_DistributedDataParallel_SyncBatchNorm_2D_Input(self):
"Only Nccl & Gloo backend support DistributedDataParallel")
@skip_if_no_gpu
@require_world_size(2)
@skip_if_rocm
def test_DistributedDataParallel_SyncBatchNorm_Single_Input_Per_Process(self):
group, group_id, rank = self._init_global_test()
rank_to_GPU = self._init_multigpu_helper()
Expand Down Expand Up @@ -3197,7 +3182,6 @@ def _run_reduction_test(
@require_backend({"nccl"})
@require_backends_available({"nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_nccl_backend_bool_allreduce(self):
torch.cuda.set_device(self.rank)
# Run all_reduce with PRODUCT
Expand Down Expand Up @@ -3228,7 +3212,6 @@ def test_nccl_backend_bool_allreduce(self):
@require_backend({"nccl"})
@require_backends_available({"nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_nccl_backend_bool_allgather(self):
torch.cuda.set_device(self.rank)
inp = {0: [True, True], 1: [False, True]}
Expand All @@ -3252,7 +3235,6 @@ def test_nccl_backend_bool_allgather(self):
@require_backend({"nccl"})
@require_backends_available({"nccl"})
@skip_if_lt_x_gpu(int(os.environ["WORLD_SIZE"]))
@skip_if_rocm
def test_nccl_backend_bool_reduce(self):
torch.cuda.set_device(self.rank)
inp = {0: [True, True], 1: [False, False]}
Expand Down Expand Up @@ -3285,7 +3267,6 @@ def test_nccl_backend_bool_reduce(self):
@require_backend({"nccl"})
@require_backends_available({"nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_nccl_backend_bool_broadcast(self):
tensor_size = 10
bcast_tensor = torch.tensor(
Expand Down Expand Up @@ -3481,7 +3462,6 @@ def validate_net_equivalence(self, net):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_sync_params_and_buffers(self):
# Test that after calling _sync_params_and_buffers, models across ranks
# are the same and are equal to the model on the input rank.
Expand Down Expand Up @@ -3523,7 +3503,6 @@ def test_ddp_sync_params_and_buffers(self):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_grad_div_uneven_inputs(self):
# Test gradient division during training with join() API. If
# divide_by_initial_world_size=False, we scale by the effective world
Expand Down Expand Up @@ -3577,7 +3556,6 @@ def test_ddp_grad_div_uneven_inputs(self):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_join_model_equivalence(self):
# Verifies equivalence with model training locally and with DDP under
# the join context manager.
Expand Down Expand Up @@ -3681,7 +3659,6 @@ def _run_uneven_inputs_test(
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_uneven_inputs(self):
class DDPUnevenTestInput(NamedTuple):
name: str
Expand Down Expand Up @@ -3839,7 +3816,6 @@ def forward(self, x, rank):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_uneven_input_join_disable(self):
# tests that if net.join() with enable=False is specified, DDP works as
# expected with even inputs.
Expand Down Expand Up @@ -3874,7 +3850,6 @@ def test_ddp_uneven_input_join_disable(self):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_uneven_input_exception(self):
# Tests that exceptions during training are correctly propagated by the
# context manager.
Expand Down Expand Up @@ -3902,7 +3877,6 @@ def forward(self, _):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(4)
@skip_if_rocm
def test_ddp_uneven_inputs_replicated_error(self):
# Tests that the context manager errors out in SPMD mode.
group = dist.new_group([0, 1])
Expand Down Expand Up @@ -3952,7 +3926,6 @@ def test_broadcast_object_list(self):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_ignore_params_arg(self):
class TestModel(nn.Module):
def __init__(self, rank):
Expand Down Expand Up @@ -4040,7 +4013,6 @@ def forward(self, x):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_unused_params_rebuild_buckets_exception(self):
class ToyModel(nn.Module):
def __init__(self):
Expand Down Expand Up @@ -4071,7 +4043,6 @@ def forward(self, x):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_shared_grad_acc_unused_params(self):
# When find_unused_parameters=True, ensure we mark unused parameters
# even if they share gradient accumulators.
Expand Down Expand Up @@ -4104,7 +4075,6 @@ def forward(self, x):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_device(self):
m = nn.Linear(10, 10).to(self.rank)
expected_len = 2
Expand Down Expand Up @@ -4210,7 +4180,6 @@ def train_iter(inp, input_type):
@require_backend({"gloo", "nccl"})
@require_backends_available({"gloo", "nccl"})
@skip_if_lt_x_gpu(2)
@skip_if_rocm
def test_ddp_namedtuple(self):
batch = 5
dim = 10
Expand Down

0 comments on commit eb0fe70

Please sign in to comment.