Skip to content

Commit 80902bb

Browse files
committed
destroy distributed workaround
1 parent d322e67 commit 80902bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/trainer/logging_/test_logger_connector.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import pytest
2323
import torch
24+
import torch.distributed
2425
from torch.utils.data import DataLoader
2526
from torchmetrics import Accuracy, AveragePrecision
2627

@@ -607,6 +608,8 @@ def validation_step(self, batch, batch_idx):
607608

608609
def test_metrics_reset(tmpdir):
609610
"""Tests that metrics are reset correctly after the end of the train/val/test epoch."""
611+
if torch.distributed.is_available() and torch.distributed.is_initialized():
612+
torch.distributed.destroy_process_group()
610613

611614
class TestModel(LightningModule):
612615

0 commit comments

Comments
 (0)