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 Dec 20, 2024
1 parent ee8935e commit bdb81d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lightning/fabric/strategies/ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _determine_ddp_device_ids(self) -> Optional[list[int]]:

def _create_stream_context(self, device_ids=None):
"""Create a stream context for the current device, if supported."""

torch_lib = getattr(torch, self.root_device.type)
# Check if the device type supports streams and has the necessary attributes.
if hasattr(torch_lib, "Stream") and hasattr(torch_lib, "stream") and device_ids is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/pytorch/strategies/ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def teardown(self) -> None:

def _create_stream_context(self, device_ids=None):
"""Create a stream context for the current device, if supported."""

torch_lib = getattr(torch, self.root_device.type)
# Check if the device type supports streams and has the necessary attributes.
if hasattr(torch_lib, "Stream") and hasattr(torch_lib, "stream") and device_ids is not None:
Expand Down

0 comments on commit bdb81d4

Please sign in to comment.