Skip to content
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
8 changes: 8 additions & 0 deletions tests/comm/test_trtllm_alltoall.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
import torch

import flashinfer.comm.trtllm_alltoall as tllm_alltoall
from flashinfer.utils import get_compute_capability

# Skip all tests on SM110 (Thor) devices - these tests hang indefinitely on this architecture
pytestmark = pytest.mark.skipif(
torch.cuda.is_available()
and get_compute_capability(torch.device("cuda:0"))[0] == 11,
reason="Tests hang indefinitely on SM110 (Thor) devices",
)
Comment on lines +23 to +28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation correctly skips tests on Thor devices. However, if CUDA is not available, the skipif condition evaluates to false, causing the tests to run and subsequently fail because they require CUDA. It is better practice for tests to be skipped if their environmental requirements are not met.

This suggestion refactors the logic to also skip all tests in this file if CUDA is not available. This provides a clearer result for developers running tests in a non-GPU environment and makes the skipping logic more robust and easier to read.

Suggested change
# Skip all tests on SM110 (Thor) devices - these tests hang indefinitely on this architecture
pytestmark = pytest.mark.skipif(
torch.cuda.is_available()
and get_compute_capability(torch.device("cuda:0"))[0] == 11,
reason="Tests hang indefinitely on SM110 (Thor) devices",
)
# Skip all tests on SM110 (Thor) devices and if CUDA is not available
_skip_reason = None
if not torch.cuda.is_available():
_skip_reason = "CUDA not available, skipping trtllm_alltoall tests"
elif get_compute_capability(torch.device("cuda:0"))[0] == 11:
_skip_reason = "Tests hang indefinitely on SM110 (Thor) devices"
pytestmark = pytest.mark.skipif(_skip_reason is not None, reason=_skip_reason)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUDA will always be available when we test FlashInfer


has_setup_max_sm_count = False

Expand Down
Loading