Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent 4f7107a commit ff1beae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lightning/pytorch/strategies/ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _register_ddp_hooks(self) -> None:

def _enable_model_averaging(self) -> None:
log.debug(f"{self.__class__.__name__}: reinitializing optimizers with post localSGD")
if self._model_averaging_period is None: # type: ignore[no-untyped-def]
if self._model_averaging_period is None: # type: ignore[no-untyped-def]
raise ValueError(
"Post-localSGD algorithm is used, but model averaging period is not provided to DDP strategy."
)
Expand Down Expand Up @@ -418,7 +418,7 @@ def teardown(self) -> None:

super().teardown()

def _create_stream_context(self, device_ids=None): # type: ignore[no-untyped-def]
def _create_stream_context(self, device_ids=None): # type: ignore[no-untyped-def]
"""Create a stream context for the current device, if supported."""

torch_lib = getattr(torch, self.root_device.type)
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/pytorch/strategies/deepspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __init__(
self.min_loss_scale = min_loss_scale

try:
self.device_type = self.accelerator.get_device_type() # type: ignore[union-attr]
self.device_type = self.accelerator.get_device_type() # type: ignore[union-attr]
except Exception:
self.device_type = "cuda"
self.torch_lib = getattr(torch, self.device_type)
Expand Down

0 comments on commit ff1beae

Please sign in to comment.