Skip to content

Commit

Permalink
Disable strategy check
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbro committed Dec 28, 2023
1 parent 7e0b1a1 commit 93ab23c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lightning/pytorch/utilities/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def _maybe_unwrap_optimized(model: object) -> "pl.LightningModule":
def _verify_strategy_supports_compile(model: "pl.LightningModule", strategy: Strategy) -> None:
if model._compiler_ctx is not None:
supported_strategies = (SingleDeviceStrategy, DDPStrategy, FSDPStrategy)
if not isinstance(strategy, supported_strategies):
supported_strategy_names = ", ".join(s.__name__ for s in supported_strategies)
raise RuntimeError(
f"Using a compiled model is incompatible with the current strategy: `{type(strategy).__name__}`."
f" Only {supported_strategy_names} support compilation. Either switch to one of the supported"
" strategies or avoid passing in compiled model."
)
# if not isinstance(strategy, supported_strategies):
# supported_strategy_names = ", ".join(s.__name__ for s in supported_strategies)
# raise RuntimeError(
# f"Using a compiled model is incompatible with the current strategy: `{type(strategy).__name__}`."
# f" Only {supported_strategy_names} support compilation. Either switch to one of the supported"
# " strategies or avoid passing in compiled model."
# )

0 comments on commit 93ab23c

Please sign in to comment.