Skip to content

Commit ff03e14

Browse files
dstaay-fbfacebook-github-bot
authored andcommitted
Fix GPU resource check (#2659)
Summary: Pull Request resolved: #2659 Test only checks for existance of GPU, needs to check for at least 2 GPUs Reviewed By: sarckk Differential Revision: D67722949 fbshipit-source-id: 8ed02f6d4cc9fc56db0374c52ddc573f4c682401
1 parent ab27f16 commit ff03e14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/retrieval/tests/test_two_tower_retrieval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class InferTest(unittest.TestCase):
2121
@skip_if_asan
2222
# pyre-ignore[56]
2323
@unittest.skipIf(
24-
not torch.cuda.is_available(),
25-
"this test requires a GPU",
24+
torch.cuda.device_count() <= 1,
25+
"Not enough GPUs, this test requires at least two GPUs",
2626
)
2727
def test_infer_function(self) -> None:
2828
infer(

0 commit comments

Comments
 (0)