Skip to content

Commit

Permalink
Add gpu gloo tests (pytorch#1668)
Browse files Browse the repository at this point in the history
Summary:

Add GPU tests for gloo.

Reviewed By: gnahzg

Differential Revision: D53207076
  • Loading branch information
henrylhtsang authored and facebook-github-bot committed Jan 31, 2024
1 parent 8b8eeab commit 5451f4f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions torchrec/distributed/tests/test_model_parallel_gloo_gpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from torchrec.distributed.test_utils.test_model_parallel import ModelParallelBase

# GPU tests for Gloo.


class ModelParallelTestGloo(ModelParallelBase):
def setUp(self, backend: str = "gloo") -> None:
super().setUp(backend=backend)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from torchrec.distributed.test_utils.test_model_parallel_base import (
ModelParallelSparseOnlyBase,
ModelParallelStateDictBase,
)

# Single rank GPU tests for Gloo.


class ModelParallelStateDictTestGloo(ModelParallelStateDictBase):
def setUp(self, backend: str = "gloo") -> None:
super().setUp(backend=backend)


class ModelParallelSparseOnlyTestGloo(ModelParallelSparseOnlyBase):
def setUp(self, backend: str = "gloo") -> None:
super().setUp(backend=backend)

0 comments on commit 5451f4f

Please sign in to comment.