Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/metrics/regression/test_ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def _sk_metric(preds, target, data_range, multichannel):
class TestSSIM(MetricTester):
atol = 6e-5

# TODO: for some reason this test hangs with ddp=True
# @pytest.mark.parametrize("ddp", [True, False])
@pytest.mark.parametrize("ddp", [False])
@pytest.mark.parametrize("ddp", [True, False])
@pytest.mark.parametrize("dist_sync_on_step", [True, False])
def test_ssim(self, preds, target, multichannel, ddp, dist_sync_on_step):
self.run_class_metric_test(
Expand Down
10 changes: 6 additions & 4 deletions tests/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

from pytorch_lightning.metrics import Metric

try:
set_start_method("spawn")
except RuntimeError:
pass

NUM_PROCESSES = 2
NUM_BATCHES = 10
BATCH_SIZE = 32
Expand Down Expand Up @@ -165,10 +170,7 @@ def setup_class(self):
"""Setup the metric class. This will spawn the pool of workers that are
used for metric testing and setup_ddp
"""
try:
set_start_method("spawn")
except RuntimeError:
pass

self.poolSize = NUM_PROCESSES
self.pool = Pool(processes=self.poolSize)
self.pool.starmap(setup_ddp, [(rank, self.poolSize) for rank in range(self.poolSize)])
Expand Down