Skip to content

Commit a53fcab

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4077b3a commit a53fcab

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/lightning/fabric/strategies/launchers/multiprocessing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def _check_bad_xpu_fork() -> None:
202202
203203
The error message replaces PyTorch's 'Cannot re-initialize XPU in forked subprocess' with helpful advice for
204204
Lightning users.
205+
205206
"""
206207
if not XPUAccelerator.is_xpu_initialized():
207208
return

src/lightning/fabric/utilities/device_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def _normalize_parse_gpu_string_input(s: Union[int, str, List[int]]) -> Union[in
118118
return int(s.strip())
119119

120120

121-
def _sanitize_gpu_ids(gpus: List[int], include_cuda: bool = False, include_mps: bool = False, include_xpu: bool = False) -> List[int]:
121+
def _sanitize_gpu_ids(
122+
gpus: List[int], include_cuda: bool = False, include_mps: bool = False, include_xpu: bool = False
123+
) -> List[int]:
122124
"""Checks that each of the GPUs in the list is actually available. Raises a MisconfigurationException if any of the
123125
GPUs is not available.
124126

src/lightning/pytorch/trainer/setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
XLAProfiler,
2929
)
3030
from lightning.pytorch.utilities.exceptions import MisconfigurationException
31-
from lightning.pytorch.utilities.imports import _lightning_graphcore_available, _lightning_habana_available, _LIGHTNING_XPU_AVAILABLE
31+
from lightning.pytorch.utilities.imports import (
32+
_lightning_graphcore_available,
33+
_lightning_habana_available,
34+
_LIGHTNING_XPU_AVAILABLE,
35+
)
3236
from lightning.pytorch.utilities.rank_zero import rank_zero_info, rank_zero_warn
3337

3438

0 commit comments

Comments
 (0)