Skip to content

Commit a1a655d

Browse files
authored
Reduce log output size in special tests (#7481)
1 parent 7b283e3 commit a1a655d

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

tests/callbacks/test_stochastic_weight_avg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def train_with_swa(tmpdir, batchnorm=True, accelerator=None, gpus=None, num_proc
117117

118118
trainer = Trainer(
119119
default_root_dir=tmpdir,
120+
progress_bar_refresh_rate=0,
120121
max_epochs=max_epochs,
121122
limit_train_batches=5,
122123
limit_val_batches=0,

tests/checkpointing/test_checkpoint_callback_frequency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def training_epoch_end(self, outputs) -> None:
131131
trainer = Trainer(
132132
callbacks=[callbacks.ModelCheckpoint(dirpath=tmpdir, monitor='my_loss_step', save_top_k=k, mode="max")],
133133
default_root_dir=tmpdir,
134+
progress_bar_refresh_rate=0,
134135
max_epochs=epochs,
135136
weights_summary=None,
136137
val_check_interval=val_check_interval,

tests/plugins/test_deepspeed_plugin.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,12 @@ def on_before_accelerator_backend_setup(self, trainer, pl_module) -> None:
392392

393393
model = BoringModel()
394394
trainer = Trainer(
395+
default_root_dir=tmpdir,
396+
progress_bar_refresh_rate=0,
395397
max_epochs=1,
396398
plugins=[DeepSpeedPlugin(config=deepspeed_zero_config)],
397399
precision=16,
398400
gpus=1,
399-
default_root_dir=tmpdir,
400401
callbacks=[TestCallback()]
401402
)
402403
with pytest.raises(SystemExit):
@@ -410,8 +411,8 @@ def test_deepspeed_multigpu(tmpdir, deepspeed_config):
410411
"""
411412
model = BoringModel()
412413
trainer = Trainer(
413-
plugins=[DeepSpeedPlugin(zero_optimization=False, stage=2)],
414414
default_root_dir=tmpdir,
415+
plugins=[DeepSpeedPlugin(zero_optimization=False, stage=2)],
415416
gpus=2,
416417
fast_dev_run=True,
417418
precision=16,
@@ -489,8 +490,8 @@ def test_deepspeed_multigpu_stage_3(tmpdir, deepspeed_config):
489490
"""
490491
model = ModelParallelBoringModel()
491492
trainer = Trainer(
492-
plugins=[DeepSpeedPlugin(stage=3)],
493493
default_root_dir=tmpdir,
494+
plugins=[DeepSpeedPlugin(stage=3)],
494495
gpus=2,
495496
fast_dev_run=True,
496497
precision=16,
@@ -507,9 +508,10 @@ def run_checkpoint_test(tmpdir, save_full_weights):
507508
dm = ClassifDataModule()
508509
ck = ModelCheckpoint(monitor="val_acc", mode="max", save_last=True, save_top_k=-1)
509510
trainer = Trainer(
511+
default_root_dir=tmpdir,
512+
progress_bar_refresh_rate=0,
510513
max_epochs=10,
511514
plugins=[DeepSpeedPlugin(stage=3, save_full_weights=save_full_weights)],
512-
default_root_dir=tmpdir,
513515
gpus=2,
514516
precision=16,
515517
accumulate_grad_batches=2,
@@ -525,9 +527,9 @@ def run_checkpoint_test(tmpdir, save_full_weights):
525527
assert saved_results == results
526528

527529
trainer = Trainer(
530+
default_root_dir=tmpdir,
528531
max_epochs=10,
529532
plugins=[DeepSpeedPlugin(stage=3, save_full_weights=save_full_weights)],
530-
default_root_dir=tmpdir,
531533
gpus=2,
532534
precision=16,
533535
accumulate_grad_batches=2,
@@ -579,6 +581,8 @@ def on_train_batch_start(
579581
model = ModelParallelClassificationModel()
580582
dm = ClassifDataModule()
581583
trainer = Trainer(
584+
default_root_dir=tmpdir,
585+
progress_bar_refresh_rate=0,
582586
max_epochs=5,
583587
plugins=[DeepSpeedPlugin(stage=2, cpu_offload=cpu_offload)],
584588
gpus=2,
@@ -597,8 +601,8 @@ def test_deepspeed_multigpu_test(tmpdir, deepspeed_config):
597601
"""
598602
model = ModelParallelBoringModel()
599603
trainer = Trainer(
600-
plugins=[DeepSpeedPlugin(stage=3)],
601604
default_root_dir=tmpdir,
605+
plugins=[DeepSpeedPlugin(stage=3)],
602606
gpus=2,
603607
fast_dev_run=True,
604608
precision=16,

tests/test_profiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ def test_pytorch_profiler_trainer_ddp(tmpdir, pytorch_profiler):
303303
model = BoringModel()
304304
trainer = Trainer(
305305
default_root_dir=tmpdir,
306+
progress_bar_refresh_rate=0,
306307
max_epochs=1,
307308
limit_train_batches=5,
308309
limit_val_batches=5,

0 commit comments

Comments
 (0)