Skip to content

Commit 84d2e47

Browse files
BordaSkafteNicki
andauthored
Apply suggestions from code review
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
1 parent 20e6fe6 commit 84d2e47

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/lightning/fabric/utilities/distributed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def _destroy_dist_connection() -> None:
319319

320320

321321
def _get_default_process_group_backend_for_device(device: torch.device) -> str:
322+
"""Return corresponding distributed backend for a given device."""
322323
device_backend_map = torch.distributed.Backend.default_device_backend_map
323324
if device.type in device_backend_map:
324325
return device_backend_map[device.type]

tests/tests_fabric/utilities/test_distributed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def test_init_dist_connection_registers_destruction_handler(_, atexit_mock):
245245

246246

247247
def test_get_default_process_group_backend_for_device():
248+
"""Test that each device type maps to its correct default process group backend."""
248249
# register a custom backend for test
249250
torch.utils.rename_privateuse1_backend("pcu")
250251

0 commit comments

Comments
 (0)