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
2 changes: 1 addition & 1 deletion tests/comm/test_trtllm_mnnvl_allreduce_custom_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_mnnvl_allreduce_custom_communicator(

available_gpus = torch.cuda.device_count()
if world_size > available_gpus:
raise ValueError(
pytest.skip(
f"world_size {world_size} is greater than available_gpus {available_gpus}"
)
Comment on lines +253 to 255
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While using pytest.skip is the correct approach here, the message could be more descriptive to improve the clarity of the test output. A more informative message that clearly states the reason for skipping would be more helpful for developers and is more consistent with other skip messages in the test suite, such as "This test requires at least 2 MPI ranks, got {world_size}". I suggest rephrasing it to be more explicit.

Suggested change
pytest.skip(
f"world_size {world_size} is greater than available_gpus {available_gpus}"
)
pytest.skip(
f"Skipping test, requires {world_size} GPUs but only {available_gpus} are available."
)

print(f"Running test for world_size={world_size}")
Expand Down