|
62 | 62 | )
|
63 | 63 | from lightning.pytorch.strategies.ddp import _DDP_FORK_ALIASES
|
64 | 64 | from lightning.pytorch.utilities.exceptions import MisconfigurationException
|
65 |
| -from lightning.pytorch.utilities.imports import ( |
66 |
| - _LIGHTNING_COLOSSALAI_AVAILABLE, |
67 |
| - _habana_available_and_importable, |
68 |
| -) |
| 65 | +from lightning.pytorch.utilities.imports import _habana_available_and_importable |
69 | 66 | from lightning.pytorch.utilities.rank_zero import rank_zero_info, rank_zero_warn
|
70 | 67 |
|
71 | 68 | log = logging.getLogger(__name__)
|
@@ -191,9 +188,6 @@ def _check_config_and_set_final_flags(
|
191 | 188 |
|
192 | 189 | self._strategy_flag = strategy
|
193 | 190 |
|
194 |
| - if strategy == "colossalai" and not _LIGHTNING_COLOSSALAI_AVAILABLE: |
195 |
| - raise ModuleNotFoundError(str(_LIGHTNING_COLOSSALAI_AVAILABLE)) |
196 |
| - |
197 | 191 | if strategy != "auto" and strategy not in self._registered_strategies and not isinstance(strategy, Strategy):
|
198 | 192 | raise ValueError(
|
199 | 193 | f"You selected an invalid strategy name: `strategy={strategy!r}`."
|
@@ -490,12 +484,6 @@ def _check_and_init_precision(self) -> Precision:
|
490 | 484 | if isinstance(self.accelerator, HPUAccelerator):
|
491 | 485 | return HPUPrecisionPlugin(self._precision_flag)
|
492 | 486 |
|
493 |
| - if _LIGHTNING_COLOSSALAI_AVAILABLE: |
494 |
| - from lightning_colossalai import ColossalAIPrecisionPlugin, ColossalAIStrategy |
495 |
| - |
496 |
| - if isinstance(self.strategy, ColossalAIStrategy): |
497 |
| - return ColossalAIPrecisionPlugin(self._precision_flag) |
498 |
| - |
499 | 487 | if isinstance(self.strategy, (SingleDeviceXLAStrategy, XLAStrategy)):
|
500 | 488 | return XLAPrecision(self._precision_flag) # type: ignore
|
501 | 489 | if isinstance(self.strategy, DeepSpeedStrategy):
|
@@ -648,13 +636,6 @@ def _set_torch_flags(
|
648 | 636 |
|
649 | 637 | def _register_external_accelerators_and_strategies() -> None:
|
650 | 638 | """Registers all known strategies in other packages."""
|
651 |
| - if _LIGHTNING_COLOSSALAI_AVAILABLE: |
652 |
| - from lightning_colossalai import ColossalAIStrategy |
653 |
| - |
654 |
| - # TODO: Prevent registering multiple times |
655 |
| - if "colossalai" not in StrategyRegistry: |
656 |
| - ColossalAIStrategy.register_strategies(StrategyRegistry) |
657 |
| - |
658 | 639 | if _habana_available_and_importable():
|
659 | 640 | from lightning_habana import HPUAccelerator, HPUParallelStrategy, SingleHPUStrategy
|
660 | 641 |
|
|
0 commit comments