Skip to content

Commit

Permalink
fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul committed Dec 23, 2024
1 parent 78b0f52 commit 8c80718
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/models/test_attention_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ def test_only_cross_attention(self):


class DeprecatedAttentionBlockTests(unittest.TestCase):
@pytest.fixture(scope="session")
def is_dist_enabled(pytestconfig):
return pytestconfig.getoption("dist") == "loadfile"

@pytest.mark.xfail(
condition=torch.device(torch_device).type == "cuda",
reason="Test currently fails on our GPU CI because of `disfile`.",
condition=torch.device(torch_device).type == "cuda" and is_dist_enabled,
reason="Test currently fails on our GPU CI because of `loadfile`. Note that it only fails when the tests are distributed from `pytest ... tests/models`. If the tests are run individually, even with `loadfile` it won't fail.",
strict=True,
)
def test_conversion_when_using_device_map(self):
Expand Down

0 comments on commit 8c80718

Please sign in to comment.