Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Skip WholeGraph Tests if GPU PyTorch Unavailable #4820

Merged
merged 16 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -32,6 +32,20 @@ def get_cudart_version():
return major * 1000 + minor * 10


pytestmark = [
pytest.mark.skipif(
isinstance(torch, MissingModule) or not torch.cuda.is_available(),
reason="PyTorch with GPU support not available",
),
pytest.mark.skipif(
isinstance(pylibwholegraph, MissingModule), reason="wholegraph not available"
),
pytest.mark.skipif(
get_cudart_version() < 11080, reason="not compatible with CUDA < 11.8"
),
]


def runtest(rank: int, world_size: int):
torch.cuda.set_device(rank)

Expand Down Expand Up @@ -69,13 +83,6 @@ def runtest(rank: int, world_size: int):


@pytest.mark.sg
@pytest.mark.skipif(isinstance(torch, MissingModule), reason="torch not available")
@pytest.mark.skipif(
isinstance(pylibwholegraph, MissingModule), reason="wholegraph not available"
)
@pytest.mark.skipif(
get_cudart_version() < 11080, reason="not compatible with CUDA < 11.8"
)
def test_feature_storage_wholegraph_backend():
world_size = torch.cuda.device_count()
print("gpu count:", world_size)
Expand All @@ -87,13 +94,6 @@ def test_feature_storage_wholegraph_backend():


@pytest.mark.mg
@pytest.mark.skipif(isinstance(torch, MissingModule), reason="torch not available")
@pytest.mark.skipif(
isinstance(pylibwholegraph, MissingModule), reason="wholegraph not available"
)
@pytest.mark.skipif(
get_cudart_version() < 11080, reason="not compatible with CUDA < 11.8"
)
def test_feature_storage_wholegraph_backend_mg():
world_size = torch.cuda.device_count()
print("gpu count:", world_size)
Expand Down
Loading