Skip to content

Commit

Permalink
skip daso test when HEAT_TEST_USE_DEVICE set to cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanPedroGHM committed Aug 16, 2024
1 parent 2c2d9a3 commit eda45be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion heat/optim/tests/test_dp_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
class TestDASO(TestCase):

@unittest.skipUnless(
len(TestCase.get_hostnames()) >= 2 and torch.cuda.device_count() > 0,
len(TestCase.get_hostnames()) >= 2
and torch.cuda.device_count() > 1
and TestCase.device == "cuda",
f"only supported for GPUs and at least two nodes, Nodes = {TestCase.get_hostnames()}, torch.cuda.device_count() = {torch.cuda.device_count()}, rank = {ht.MPI_WORLD.rank}",
)
def test_daso(self):
import heat.nn.functional as F
import heat.optim as optim

print(
f"rank = {ht.MPI_WORLD.rank}, host = {os.uname()[1]}, torch.cuda.device_count() = {torch.cuda.device_count()}, torch.cuda.current_device() = {torch.cuda.current_device()}, NNodes = {len(TestCase.get_hostnames())}"
)

class Model(ht.nn.Module):
def __init__(self):
super(Model, self).__init__()
Expand Down

0 comments on commit eda45be

Please sign in to comment.