Skip to content

Commit 4ff09dd

Browse files
LinGeLinrhdong
authored andcommitted
[fix] skip hvd test when run cpu test
1 parent 9c013e5 commit 4ff09dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/horovod_sync_train_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def get_emb_sequential_model(emb_t, opt, *args, **kwargs):
6565
return model
6666

6767

68+
is_gpu_available = test_util.is_gpu_available()
69+
70+
6871
class HorovodTest(test.TestCase):
6972

7073
@test_util.deprecated_graph_mode_only
@@ -90,6 +93,8 @@ def test_all_to_all_embedding_trainable(self):
9093
if (tf.__version__ == "2.11.0" or tf.__version__ == "2.11.1"):
9194
self.skipTest(
9295
"The save function doesn't work with TF 2.11, skip the test.")
96+
if not is_gpu_available:
97+
self.skipTest('Only test when gpu is available.')
9398
if (is_macos() and is_arm64()):
9499
self.skipTest(
95100
"Apple silicon devices don't support synchronous training based on Horovod."

0 commit comments

Comments
 (0)