From 2f21670fd83af32821d7fe6fef23268c39761f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Tue, 10 Oct 2023 14:45:30 +0200 Subject: [PATCH] Fix registry descriptions (#18766) --- src/lightning/fabric/accelerators/cpu.py | 2 +- src/lightning/fabric/accelerators/cuda.py | 2 +- src/lightning/fabric/accelerators/mps.py | 2 +- src/lightning/fabric/accelerators/xla.py | 2 +- src/lightning/fabric/strategies/dp.py | 2 +- src/lightning/fabric/strategies/single_xla.py | 2 +- src/lightning/fabric/strategies/xla.py | 2 +- src/lightning/fabric/strategies/xla_fsdp.py | 2 +- src/lightning/pytorch/accelerators/cpu.py | 2 +- src/lightning/pytorch/accelerators/cuda.py | 2 +- src/lightning/pytorch/accelerators/mps.py | 2 +- src/lightning/pytorch/accelerators/xla.py | 2 +- src/lightning/pytorch/strategies/single_device.py | 2 +- src/lightning/pytorch/strategies/single_xla.py | 2 +- src/lightning/pytorch/strategies/xla.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lightning/fabric/accelerators/cpu.py b/src/lightning/fabric/accelerators/cpu.py index 3b1e5005aeaf8..0ab242eb7505a 100644 --- a/src/lightning/fabric/accelerators/cpu.py +++ b/src/lightning/fabric/accelerators/cpu.py @@ -60,7 +60,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "cpu", cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/fabric/accelerators/cuda.py b/src/lightning/fabric/accelerators/cuda.py index 2d7a91d067d8a..0634bd323464b 100644 --- a/src/lightning/fabric/accelerators/cuda.py +++ b/src/lightning/fabric/accelerators/cuda.py @@ -68,7 +68,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "cuda", cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/fabric/accelerators/mps.py b/src/lightning/fabric/accelerators/mps.py index 44cf082129670..efc825261a167 100644 --- a/src/lightning/fabric/accelerators/mps.py +++ b/src/lightning/fabric/accelerators/mps.py @@ -70,7 +70,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "mps", cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/fabric/accelerators/xla.py b/src/lightning/fabric/accelerators/xla.py index 7b73fd7af6d98..45169f2ce8ee7 100644 --- a/src/lightning/fabric/accelerators/xla.py +++ b/src/lightning/fabric/accelerators/xla.py @@ -95,7 +95,7 @@ def is_available() -> bool: @classmethod def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> None: - accelerator_registry.register("tpu", cls, description=cls.__class__.__name__) + accelerator_registry.register("tpu", cls, description=cls.__name__) # PJRT support requires this minimum version diff --git a/src/lightning/fabric/strategies/dp.py b/src/lightning/fabric/strategies/dp.py index 65495d17e5aa5..ea9794972d36b 100644 --- a/src/lightning/fabric/strategies/dp.py +++ b/src/lightning/fabric/strategies/dp.py @@ -98,4 +98,4 @@ def load_module_state_dict( @classmethod def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: - strategy_registry.register("dp", cls, description=cls.__class__.__name__) + strategy_registry.register("dp", cls, description=cls.__name__) diff --git a/src/lightning/fabric/strategies/single_xla.py b/src/lightning/fabric/strategies/single_xla.py index b6eb12370c30e..7a97989106f80 100644 --- a/src/lightning/fabric/strategies/single_xla.py +++ b/src/lightning/fabric/strategies/single_xla.py @@ -62,4 +62,4 @@ def checkpoint_io(self, io: CheckpointIO) -> None: @classmethod def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: - strategy_registry.register("single_xla", cls, description=cls.__class__.__name__) + strategy_registry.register("single_xla", cls, description=cls.__name__) diff --git a/src/lightning/fabric/strategies/xla.py b/src/lightning/fabric/strategies/xla.py index 96151fae8a474..805f28a4453d6 100644 --- a/src/lightning/fabric/strategies/xla.py +++ b/src/lightning/fabric/strategies/xla.py @@ -264,4 +264,4 @@ def save_checkpoint( @classmethod def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: - strategy_registry.register("xla", cls, description=cls.__class__.__name__) + strategy_registry.register("xla", cls, description=cls.__name__) diff --git a/src/lightning/fabric/strategies/xla_fsdp.py b/src/lightning/fabric/strategies/xla_fsdp.py index 348fe1894c488..492e30d123183 100644 --- a/src/lightning/fabric/strategies/xla_fsdp.py +++ b/src/lightning/fabric/strategies/xla_fsdp.py @@ -594,7 +594,7 @@ def load_checkpoint( @classmethod def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: - strategy_registry.register("xla_fsdp", cls, description=cls.__class__.__name__) + strategy_registry.register("xla_fsdp", cls, description=cls.__name__) def _parse_fsdp_kwargs(self) -> Dict: # this needs to be delayed because `self.precision` isn't available at init diff --git a/src/lightning/pytorch/accelerators/cpu.py b/src/lightning/pytorch/accelerators/cpu.py index c12bd0afe0574..51ff57afc4d93 100644 --- a/src/lightning/pytorch/accelerators/cpu.py +++ b/src/lightning/pytorch/accelerators/cpu.py @@ -68,7 +68,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "cpu", cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/pytorch/accelerators/cuda.py b/src/lightning/pytorch/accelerators/cuda.py index b1d621ad07785..b158eb05729bc 100644 --- a/src/lightning/pytorch/accelerators/cuda.py +++ b/src/lightning/pytorch/accelerators/cuda.py @@ -100,7 +100,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "cuda", cls, - description=f"{cls.__class__.__name__}", + description=cls.__name__, ) diff --git a/src/lightning/pytorch/accelerators/mps.py b/src/lightning/pytorch/accelerators/mps.py index 43b249e441e2a..5b0a09028641b 100644 --- a/src/lightning/pytorch/accelerators/mps.py +++ b/src/lightning/pytorch/accelerators/mps.py @@ -75,7 +75,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No accelerator_registry.register( "mps", cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/pytorch/accelerators/xla.py b/src/lightning/pytorch/accelerators/xla.py index e1ef449e79310..f9c3957782e19 100644 --- a/src/lightning/pytorch/accelerators/xla.py +++ b/src/lightning/pytorch/accelerators/xla.py @@ -48,4 +48,4 @@ def get_device_stats(self, device: _DEVICE) -> Dict[str, Any]: @classmethod def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> None: - accelerator_registry.register("tpu", cls, description=cls.__class__.__name__) + accelerator_registry.register("tpu", cls, description=cls.__name__) diff --git a/src/lightning/pytorch/strategies/single_device.py b/src/lightning/pytorch/strategies/single_device.py index a9809abe7c430..6736201dc8ace 100644 --- a/src/lightning/pytorch/strategies/single_device.py +++ b/src/lightning/pytorch/strategies/single_device.py @@ -92,5 +92,5 @@ def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: strategy_registry.register( cls.strategy_name, cls, - description=cls.__class__.__name__, + description=cls.__name__, ) diff --git a/src/lightning/pytorch/strategies/single_xla.py b/src/lightning/pytorch/strategies/single_xla.py index e51775853fb46..0520e8e95f329 100644 --- a/src/lightning/pytorch/strategies/single_xla.py +++ b/src/lightning/pytorch/strategies/single_xla.py @@ -78,7 +78,7 @@ def setup(self, trainer: "pl.Trainer") -> None: @classmethod def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: - strategy_registry.register("single_xla", cls, description=cls.__class__.__name__) + strategy_registry.register("single_xla", cls, description=cls.__name__) def teardown(self) -> None: super().teardown() diff --git a/src/lightning/pytorch/strategies/xla.py b/src/lightning/pytorch/strategies/xla.py index 4b0de545239f9..fa8b59513d804 100644 --- a/src/lightning/pytorch/strategies/xla.py +++ b/src/lightning/pytorch/strategies/xla.py @@ -312,7 +312,7 @@ def register_strategies(cls, strategy_registry: _StrategyRegistry) -> None: strategy_registry.register( cls.strategy_name, cls, - description=f"{cls.__class__.__name__}", + description=cls.__name__, ) def _pod_progress_bar_force_stdout(self) -> None: