Skip to content

Commit 58a570b

Browse files
[BT] add accelerate_test markers (huggingface#864)
* add `accelerate_test` markers * add markers
1 parent 0b1138c commit 58a570b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ markers = [
3636
"tensorflow_test",
3737
"run_in_series",
3838
"run_slow",
39+
"accelerate_test",
40+
"fp16",
3941
]

tests/bettertransformer/test_encoder.py

+4
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def test_raise_train(self, model_type: str):
209209
super()._test_raise_train(model_id)
210210

211211
@pytest.mark.gpu_test
212+
@pytest.mark.accelerate_test
212213
def test_accelerate_compatibility_cpu_gpu(self):
213214
r"""
214215
Wrapper around the `check_accelerate_compatibility_cpu_gpu` test with `keep_original_model=True`
@@ -217,6 +218,7 @@ def test_accelerate_compatibility_cpu_gpu(self):
217218
self.check_accelerate_compatibility_cpu_gpu(keep_original_model=True, max_memory=max_memory)
218219

219220
@pytest.mark.gpu_test
221+
@pytest.mark.accelerate_test
220222
def test_accelerate_compatibility_cpu_gpu_without_keeping(self):
221223
r"""
222224
Wrapper around the `check_accelerate_compatibility_cpu_gpu` test with `keep_original_model=False`
@@ -225,6 +227,7 @@ def test_accelerate_compatibility_cpu_gpu_without_keeping(self):
225227
self.check_accelerate_compatibility_cpu_gpu(keep_original_model=False, max_memory=max_memory)
226228

227229
@pytest.mark.gpu_test
230+
@pytest.mark.accelerate_test
228231
def test_accelerate_compatibility_single_gpu(self):
229232
r"""
230233
Wrapper around the `check_accelerate_compatibility_cpu_gpu` test with `keep_original_model=False`
@@ -234,6 +237,7 @@ def test_accelerate_compatibility_single_gpu(self):
234237
self.check_accelerate_compatibility_cpu_gpu(keep_original_model=True, max_memory=max_memory)
235238

236239
@pytest.mark.gpu_test
240+
@pytest.mark.accelerate_test
237241
def test_accelerate_compatibility_single_gpu_without_keeping(self):
238242
r"""
239243
Wrapper around the `check_accelerate_compatibility_cpu_gpu` test with `keep_original_model=True`

0 commit comments

Comments
 (0)