Skip to content

Commit

Permalink
Set _choose_auto_accelerator to staticmethod (#19822)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebotu committed Jun 5, 2024
1 parent 351bec7 commit 19f0fb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lightning/fabric/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ def _check_device_config_and_set_final_flags(self, devices: Union[List[int], str
f" using {accelerator_name} accelerator."
)

def _choose_auto_accelerator(self) -> str:
@staticmethod
def _choose_auto_accelerator() -> str:
"""Choose the accelerator type (str) based on availability when ``accelerator='auto'``."""
if XLAAccelerator.is_available():
return "tpu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ def _check_device_config_and_set_final_flags(self, devices: Union[List[int], str
f" using {accelerator_name} accelerator."
)

def _choose_auto_accelerator(self) -> str:
@staticmethod
def _choose_auto_accelerator() -> str:
"""Choose the accelerator type (str) based on availability."""
if XLAAccelerator.is_available():
return "tpu"
Expand Down

0 comments on commit 19f0fb9

Please sign in to comment.