Skip to content

Commit

Permalink
Fixed tests for cpu only platforms (#1259)
Browse files Browse the repository at this point in the history
* fixed test_4bit_warnings on cpu-only platforms

* fixed linear8bit-based tests for cpu only platforms
  • Loading branch information
galqiwi authored Jul 15, 2024
1 parent f2b2310 commit 39b42e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_linear8bitlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_linear_serialization(


@pytest.fixture
def linear8bit():
def linear8bit(requires_cuda):
linear = torch.nn.Linear(32, 96)
linear_custom = Linear8bitLt(
linear.in_features,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def test_fp8linear():
assert bgraderr < 0.00002


def test_4bit_warnings():
def test_4bit_warnings(requires_cuda):
dim1 = 64

with pytest.warns(UserWarning, match=r"inference or training"):
Expand Down

0 comments on commit 39b42e7

Please sign in to comment.