Skip to content

Commit 6744ebe

Browse files
authored
Add slow to some examples tests (#42164)
* slow * remove
1 parent 1709ed9 commit 6744ebe

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

examples/pytorch/test_accelerate_examples.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def setUpClass(cls):
7474
def tearDownClass(cls):
7575
shutil.rmtree(cls.tmpdir)
7676

77+
@slow
7778
@mock.patch.dict(os.environ, {"WANDB_MODE": "offline", "DVCLIVE_TEST": "true"})
7879
def test_run_glue_no_trainer(self):
7980
tmp_dir = self.get_auto_remove_tmp_dir()
@@ -147,6 +148,7 @@ def test_run_mlm_no_trainer(self):
147148
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "epoch_0")))
148149
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "mlm_no_trainer")))
149150

151+
@slow
150152
@mock.patch.dict(os.environ, {"WANDB_MODE": "offline", "DVCLIVE_TEST": "true"})
151153
def test_run_ner_no_trainer(self):
152154
# with so little data distributed training needs more epochs to get the score on par with 0/1 gpu
@@ -175,6 +177,7 @@ def test_run_ner_no_trainer(self):
175177
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "epoch_0")))
176178
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "ner_no_trainer")))
177179

180+
@slow
178181
@mock.patch.dict(os.environ, {"WANDB_MODE": "offline", "DVCLIVE_TEST": "true"})
179182
def test_run_squad_no_trainer(self):
180183
tmp_dir = self.get_auto_remove_tmp_dir()
@@ -203,6 +206,7 @@ def test_run_squad_no_trainer(self):
203206
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "epoch_0")))
204207
self.assertTrue(os.path.exists(os.path.join(tmp_dir, "qa_no_trainer")))
205208

209+
@slow
206210
@mock.patch.dict(os.environ, {"WANDB_MODE": "offline", "DVCLIVE_TEST": "true"})
207211
def test_run_swag_no_trainer(self):
208212
tmp_dir = self.get_auto_remove_tmp_dir()
@@ -305,6 +309,7 @@ def test_run_semantic_segmentation_no_trainer(self):
305309
result = get_results(tmp_dir)
306310
self.assertGreaterEqual(result["eval_overall_accuracy"], 0.10)
307311

312+
@slow
308313
@mock.patch.dict(os.environ, {"WANDB_MODE": "offline", "DVCLIVE_TEST": "true"})
309314
def test_run_image_classification_no_trainer(self):
310315
tmp_dir = self.get_auto_remove_tmp_dir()

examples/pytorch/test_pytorch_examples.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ def test_run_translation(self):
374374
result = get_results(tmp_dir)
375375
self.assertGreaterEqual(result["eval_bleu"], 30)
376376

377+
@slow
377378
def test_run_image_classification(self):
378379
tmp_dir = self.get_auto_remove_tmp_dir()
379380
testargs = f"""
@@ -403,6 +404,7 @@ def test_run_image_classification(self):
403404
result = get_results(tmp_dir)
404405
self.assertGreaterEqual(result["eval_accuracy"], 0.8)
405406

407+
@slow
406408
def test_run_speech_recognition_ctc(self):
407409
tmp_dir = self.get_auto_remove_tmp_dir()
408410
testargs = f"""
@@ -573,6 +575,7 @@ def test_run_vit_mae_pretraining(self):
573575
model = ViTMAEForPreTraining.from_pretrained(tmp_dir)
574576
self.assertIsNotNone(model)
575577

578+
@slow
576579
def test_run_semantic_segmentation(self):
577580
tmp_dir = self.get_auto_remove_tmp_dir()
578581
testargs = f"""
@@ -597,6 +600,7 @@ def test_run_semantic_segmentation(self):
597600
result = get_results(tmp_dir)
598601
self.assertGreaterEqual(result["eval_overall_accuracy"], 0.1)
599602

603+
@slow
600604
@patch.dict(os.environ, {"WANDB_DISABLED": "true"})
601605
def test_run_object_detection(self):
602606
tmp_dir = self.get_auto_remove_tmp_dir()
@@ -624,6 +628,7 @@ def test_run_object_detection(self):
624628
result = get_results(tmp_dir)
625629
self.assertGreaterEqual(result["test_map"], 0.1)
626630

631+
@slow
627632
@patch.dict(os.environ, {"WANDB_DISABLED": "true"})
628633
def test_run_instance_segmentation(self):
629634
tmp_dir = self.get_auto_remove_tmp_dir()

0 commit comments

Comments
 (0)