Skip to content

Commit a47ed34

Browse files
committed
skip fsdp if cpu
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
1 parent dac9de0 commit a47ed34

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

tests/test_linear4bit.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,7 @@ def test_params4bit_quant_state_attr_access(device, quant_type, compress_statist
569569
assert w.bnb_quantized is True
570570

571571

572-
@pytest.mark.skipif(
573-
not (
574-
(hasattr(torch, "accelerator") and torch.accelerator.is_available())
575-
or torch.cuda.is_available()
576-
or (hasattr(torch, "xpu") and torch.xpu.is_available())
577-
),
578-
reason="FSDP requires an accelerator device",
579-
)
572+
@pytest.mark.skipif(not get_available_devices(no_cpu=True), reason="FSDP requires an accelerator device")
580573
def test_fsdp_state_dict_save_4bit():
581574
"""Integration test: FSDP get_model_state_dict with cpu_offload on a 4-bit model (#1405).
582575

0 commit comments

Comments
 (0)