Skip to content

Commit e2fd67c

Browse files
Fei Yufacebook-github-bot
authored andcommitted
add back skip CPU containter test when using cuda device
Summary: as title, missed few tests without skip decorator causing CI CPU unit test to fail, somehow previous diff didn't reveal these ones that actually failed on CI, so adding these back separately. (https://www.internalfb.com/diff/D67302872?dst_version_fbid=815631520895451&transaction_fbid=1481902306176330) Differential Revision: D82771497
1 parent aeb3ffb commit e2fd67c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

torchrec/modules/tests/test_itep_embedding_modules.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ def generate_expected_address_lookup_buffer(
190190

191191
return torch.tensor(address_lookup, dtype=torch.int64)
192192

193+
@unittest.skipIf(
194+
torch.cuda.device_count() <= 1,
195+
"Not enough GPUs, this test requires at least two GPUs",
196+
)
193197
def test_init_itep_module(self) -> None:
194198
itep_module = GenericITEPModule(
195199
table_name_to_unpruned_hash_sizes=self._table_name_to_unpruned_hash_sizes,
@@ -222,6 +226,10 @@ def test_init_itep_module(self) -> None:
222226
equal_nan=True,
223227
)
224228

229+
@unittest.skipIf(
230+
torch.cuda.device_count() <= 1,
231+
"Not enough GPUs, this test requires at least two GPUs",
232+
)
225233
def test_init_itep_module_without_pruned_table(self) -> None:
226234
itep_module = GenericITEPModule(
227235
table_name_to_unpruned_hash_sizes={},
@@ -353,6 +361,10 @@ def test_eval_forward(
353361
# Check that reset_weight_momentum is not called
354362
self.assertEqual(mock_reset_weight_momentum.call_count, 0)
355363

364+
@unittest.skipIf(
365+
torch.cuda.device_count() <= 1,
366+
"Not enough GPUs, this test requires at least two GPUs",
367+
)
356368
def test_iter_increment_per_forward(self) -> None:
357369
"""Test that the iteration counter increments correctly with each forward pass."""
358370
itep_module = GenericITEPModule(

0 commit comments

Comments
 (0)