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: 2 additions & 2 deletions tests/tests_fabric/parity/test_parity_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def train_fabric_ddp(fabric):
@pytest.mark.parametrize(
"accelerator, devices, tolerance",
[
("cpu", 2, 0.01),
pytest.param("cuda", 2, 0.005, marks=RunIf(min_cuda_gpus=2)),
("cpu", 2, 0.02),
pytest.param("cuda", 2, 0.01, marks=RunIf(min_cuda_gpus=2)),
],
)
def test_parity_ddp(accelerator, devices, tolerance):
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_fabric/parity/test_parity_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_parity_single_device(precision, accelerator):
assert is_state_dict_equal(state_dict_torch, state_dict_fabric)

# Compare the time per iteration
assert is_timing_close(timings_torch, timings_fabric, rtol=1e-3, atol=1e-3)
assert is_timing_close(timings_torch, timings_fabric, rtol=1e-2, atol=0.1)

# Compare memory usage
if accelerator == "cuda":
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_fabric/parity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def is_state_dict_equal(state0, state1):
return all(eq_fn(w0.cpu(), w1.cpu()) for w0, w1 in zip(state0.values(), state1.values()))


def is_timing_close(timings_torch, timings_fabric, rtol=1e-3, atol=1e-3):
def is_timing_close(timings_torch, timings_fabric, rtol=1e-2, atol=0.1):
# Drop measurements of the first iterations, as they may be slower than others
# The median is more robust to outliers than the mean
# Given relative and absolute tolerances, we want to satisfy: |torch – fabric| < RTOL * torch + ATOL
Expand Down