[tests] make more tests device-agnostic (#33580)

* enable

* fix

* add xpu skip

* add marker

* skip for xpu

* add more

* enable on accelerator

* add more cases

* add more tests

* add more
This commit is contained in:
Fanli Lin
2024-09-20 17:16:43 +08:00
committed by GitHub
parent 31650a53a1
commit 8bd1f2f338
7 changed files with 24 additions and 17 deletions

View File

@@ -29,6 +29,7 @@ from transformers.testing_utils import (
require_flash_attn,
require_read_token,
require_torch,
require_torch_accelerator,
require_torch_gpu,
require_torch_sdpa,
slow,
@@ -719,14 +720,14 @@ class MistralIntegrationTest(unittest.TestCase):
@slow
@require_torch_gpu
@require_torch_accelerator
class Mask4DTestHard(unittest.TestCase):
model_name = "mistralai/Mistral-7B-v0.1"
_model = None
def tearDown(self):
gc.collect()
torch.cuda.empty_cache()
backend_empty_cache(torch_device)
@property
def model(self):