Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb146ca7

Browse files
dvrogozhpytorchmergebot
authored andcommitted
docs: add get_default_backend_for_device to distributed documentation (#156783)
`torch.distributed.get_default_backend_for_device()` API was added to torch 2.6, but is still missing in distributed documentation. This commit addresses the gap.CC:@guangyey,@EikanWangPull Requestresolved:#156783Approved by:https://github.com/guangyey,https://github.com/malfet
1 parenteddddea commitb146ca7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎docs/source/distributed.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ inconsistent 'UUID' assignment across ranks, and to prevent races during initial
224224
.. autofunction:: is_torchelastic_launched
225225
```
226226

227+
```{eval-rst}
228+
.. autofunction:: get_default_backend_for_device
229+
```
230+
227231
______________________________________________________________________
228232

229233
Currently three initialization methods are supported:

‎torch/distributed/distributed_c10d.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def get_default_backend_for_device(device: Union[str, torch.device]) -> str:
13791379
Return the default backend for the given device.
13801380
13811381
Args:
1382-
Union[str, torch.device]: The device to get the default backend for.
1382+
device (Union[str, torch.device]): The device to get the default backend for.
13831383
13841384
Returns:
13851385
The default backend for the given device as a lower case string.
@@ -1584,6 +1584,8 @@ def init_process_group(
15841584
process must have exclusive access to every GPU it uses, as sharing
15851585
GPUs between processes can result in deadlock or NCCL invalid usage.
15861586
``ucc`` backend is experimental.
1587+
Default backend for the device can be queried with
1588+
:func:`get_default_backend_for_device`.
15871589
init_method (str, optional): URL specifying how to initialize the
15881590
process group. Default is "env://" if no
15891591
``init_method`` or ``store`` is specified.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp