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 Apr 10, 2024
1 parent 400b628 commit 29c035d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/tests_fabric/strategies/test_fsdp_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,14 @@ def test_save_sharded_and_consolidate_and_load(tmp_path):
def test_no_call_to_apply(monkeypatch):
"""Regression test to ensure we're not calling `FSDP.apply()` indirectly (see #19755)."""
monkeypatch.setattr(torch.distributed.fsdp.FullyShardedDataParallel, "apply", Mock())

fabric = Fabric(
accelerator="cuda",
strategy=FSDPStrategy(auto_wrap_policy=always_wrap_policy),
devices=2,
)
fabric.launch()

model = BoringModel()
model = fabric.setup(model)
model._forward_module.apply.assert_not_called()

0 comments on commit 29c035d

Please sign in to comment.