Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 11, 2023
1 parent a900787 commit 6e07148
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/tests_pytorch/strategies/test_fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,17 @@ def test_fsdp_checkpoint_multi_gpus(tmpdir, model, strategy, strategy_cfg):
@RunIf(min_cuda_gpus=1, skip_windows=True, standalone=True)
@pytest.mark.parametrize("use_orig_params", [None, False, True])
def test_invalid_parameters_in_optimizer(use_orig_params):
fsdp_kwargs = {}
fsdp_kwargs = {}
if _TORCH_GREATER_EQUAL_2_0 and use_orig_params is not None:
fsdp_kwargs = {"use_orig_params": use_orig_params}

trainer = Trainer(
strategy=FSDPStrategy(**fsdp_kwargs),
accelerator="cuda",
devices=1,
fast_dev_run=1,
)

error_context = (
nullcontext()
if _TORCH_GREATER_EQUAL_2_0 and (_TORCH_GREATER_EQUAL_2_1 or use_orig_params is not False)
Expand All @@ -391,7 +391,6 @@ def configure_optimizers(self):
layer = torch.nn.Linear(4, 5)
return torch.optim.Adam(layer.parameters(), lr=1e-2)


error_context = (
nullcontext()
if _TORCH_GREATER_EQUAL_2_0 and use_orig_params is not False
Expand Down

0 comments on commit 6e07148

Please sign in to comment.