File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/lightning/fabric/strategies Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
630630def _setup_activation_checkpointing (module : Module , activation_checkpointing_kwargs : Dict ) -> None :
You can’t perform that action at this time.
0 commit comments