Skip to content

Commit

Permalink
[tests] make cuda-only test work on other hardware accelerators (#3302)
Browse files Browse the repository at this point in the history
* enable on xpu

* remove require_cuda
  • Loading branch information
faaany authored Jan 22, 2025
1 parent 6535678 commit 28c171b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from accelerate import init_empty_weights
from accelerate.big_modeling import cpu_offload
from accelerate.test_utils import (
require_cuda,
require_huggingface_suite,
require_multi_device,
require_non_cpu,
Expand Down Expand Up @@ -853,7 +852,7 @@ def test_infer_auto_device_map_with_fallback_allocation_and_buffers(self):
expected_device_map = {"batchnorm": 0, "linear1": "disk", "linear2": "disk"}
assert device_map == expected_device_map

@require_cuda
@require_non_cpu
def test_get_balanced_memory(self):
model = ModelForTest()
# model has size 236: linear1 64, batchnorm 72, linear2 100
Expand Down

0 comments on commit 28c171b

Please sign in to comment.