Skip to content

Commit a6ce061

Browse files
committed
mypy
1 parent cf3d995 commit a6ce061

File tree

1 file changed

+4
-4
lines changed
  • src/lightning/fabric/strategies

1 file changed

+4
-4
lines changed

src/lightning/fabric/strategies/fsdp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ def _activation_checkpointing_kwargs(
621621
f"({set(classes)}))` instead."
622622
)
623623
return {"check_fn": lambda submodule: isinstance(submodule, classes)}
624-
if activation_checkpointing_policy is not None:
625-
if not _TORCH_GREATER_EQUAL_2_1:
626-
raise ValueError("`activation_checkpointing_policy` requires torch >= 2.1.0. HINT: `pip install -U torch`")
627-
return {"auto_wrap_policy": activation_checkpointing_policy}
624+
assert activation_checkpointing_policy is not None
625+
if not _TORCH_GREATER_EQUAL_2_1:
626+
raise ValueError("`activation_checkpointing_policy` requires torch >= 2.1.0. HINT: `pip install -U torch`")
627+
return {"auto_wrap_policy": activation_checkpointing_policy}
628628

629629

630630
def _setup_activation_checkpointing(module: Module, activation_checkpointing_kwargs: Dict) -> None:

0 commit comments

Comments
 (0)