Skip to content

Commit 0cf335d

Browse files
committed
Generate Python docs from pytorch/pytorch@c8532b3
1 parent 221175a commit 0cf335d

5,623 files changed

Lines changed: 18325 additions & 17246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎main/.buildinfo‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 77a2f4c65ab9d73e2da1d79c0c42ba92
3+
config: 8e5b0fd250890b9d5620b0d36d19b6e6
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

‎main/_images/RReLU.png‎

-614 Bytes
Loading

‎main/_images/ReduceLROnPlateau.png‎

-33 Bytes
Loading

‎main/_sources/distributed.md.txt‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,3 +2249,91 @@ This module is experimental and subject to change.
22492249
```{eval-rst}
22502250
.. py:module:: torch.distributed.checkpoint.state_dict
22512251
```
2252+
2253+
```{eval-rst}
2254+
2255+
One-sided tensor transports (experimental)
2256+
--------------------------------------------------
2257+
2258+
``torch.distributed._transport`` moves registered tensor byte ranges between
2259+
independently managed workers. It does not require a process group, global rank
2260+
assignment, or matching receives.
2261+
2262+
An endpoint connects to one peer. Exchange ``bind()`` bytes and remote memory
2263+
descriptors through a trusted application control plane. Exchange descriptors only with authorized peers. A write copies from a local view to the remote base; a read
2264+
copies from the remote base to a writable local view. Offsets and lengths are bytes;
2265+
shape and dtype agreement is the application's responsibility.
2266+
2267+
Synchronous reads/writes return zero; ``async_op=True`` returns
2268+
:class:`torch.distributed.Work`. Successful completion means the transfer completed,
2269+
not that the remote application consumed or acknowledged the data. Asyncio callers
2270+
can use ``read_async``, ``write_async``, or ``wait_all``. Registration remains valid
2271+
until unregistration or close, and tensors must not be resized or have their storage replaced.
2272+
2273+
CUDA stream semantics, graph capture, tracing, batching, remote slicing, and
2274+
rank-based bootstrap helpers are outside this initial API. Rank-to-endpoint
2275+
lookup belongs in a separate control-plane adapter. Descriptor classes define explicit ``serialize()``/``deserialize()`` methods.
2276+
The built-in backends declare their fields in a versioned JSON envelope; binary
2277+
metadata is base64-encoded. Unknown fields, versions, backends, and invalid field
2278+
types are rejected. Tensor contents and native handles are never serialized.
2279+
2280+
.. autofunction:: torch.distributed._transport.new_transport
2281+
.. autoclass:: torch.distributed._transport.Transport
2282+
:members:
2283+
.. autoclass:: torch.distributed._transport.Memory
2284+
:members:
2285+
.. autoclass:: torch.distributed._transport.MemoryView
2286+
:members:
2287+
.. autoclass:: torch.distributed._transport.MutableMemoryView
2288+
.. autoclass:: torch.distributed._transport.RemoteBuffer
2289+
.. autofunction:: torch.distributed._transport.wait_all
2290+
.. autofunction:: torch.distributed._transport.available_transports
2291+
.. autofunction:: torch.distributed._transport.register_transport
2292+
2293+
NIXL backend
2294+
~~~~~~~~~~~~
2295+
2296+
The initial backend is NIXL, installed separately with ``pip install nixl``.
2297+
Its default UCX plugin supports CPU and CUDA memory, subject to the installed
2298+
NIXL/UCX build and hardware.
2299+
2300+
``unregister_memory(memory)`` deregisters a local allocation without closing the
2301+
transport. Wait for local transfers first and coordinate with peers to stop remote
2302+
access; the backend cannot detect incoming DMA. All handles sharing a registration,
2303+
including previously created views and exported descriptors, become invalid.
2304+
Register again and exchange fresh descriptors before resuming transfers.
2305+
2306+
NIXL transfers return Work objects that retain their request handles until
2307+
completion. ``wait_all``, ``read_async``, and ``write_async`` await Work futures.
2308+
The NIXL adapter resolves those futures by checking native transfer status.
2309+
Each live transfer owns a distinct request handle.
2310+
Independent requests may overlap; explicitly wait before issuing dependent or
2311+
overlapping reads/writes. Completion ordering is not implicit.
2312+
2313+
NIXL's default wait timeout is 30 seconds. ``timeout`` is in seconds; ``None``
2314+
selects the backend default and zero polls without waiting. ``Work.wait`` instead
2315+
takes a ``datetime.timedelta``; its zero default selects the transfer's timeout.
2316+
Timeout and asyncio cancellation stop waiting, not DMA. The transport retains
2317+
pending requests and buffers, even if the caller drops its Work. Wait again or
2318+
successfully close before reusing buffers. Coordinate with peers before closing
2319+
exposed memory; close only drains locally submitted operations.
2320+
2321+
``NIXLTransport.close_async`` awaits pending transfers before native cleanup.
2322+
A timed-out or cancelled close rejects new work and retains resources; retry
2323+
close to finish cleanup. Registrations keep the transport alive even after its last outgoing transfer,
2324+
because peers may still access exposed memory. Forgotten registrations may retain
2325+
resources indefinitely:
2326+
call ``unregister_memory`` or ``close`` after coordinating with peers.
2327+
Checking ``is_completed`` also releases completed requests.
2328+
For pending NIXL work, ``get_future`` requires a running asyncio loop; the loop
2329+
must remain running to drive that future. Completed work needs no event loop.
2330+
2331+
Native metadata, registration, request submission, status checks, and cleanup
2332+
calls execute synchronously on the calling thread. Their timeouts bound lock
2333+
acquisition and transfer completion waits, not execution inside NIXL. Python
2334+
cannot interrupt a blocked native call, even when it releases the GIL.
2335+
2336+
.. autoclass:: torch.distributed._transport.nixl.NIXLTransport
2337+
:members: close_async
2338+
2339+
```

‎main/_sources/generated/exportdb/index.rst.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ constrain_as_size_example
729729

730730
.. note::
731731

732-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
732+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
733733

734734
Support Level: SUPPORTED
735735

@@ -796,7 +796,7 @@ constrain_as_value_example
796796

797797
.. note::
798798

799-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
799+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
800800

801801
Support Level: SUPPORTED
802802

@@ -1154,7 +1154,7 @@ dynamic_shape_map
11541154

11551155
.. note::
11561156

1157-
Tags: :doc:`torch.map <torch.map>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
1157+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.map <torch.map>`
11581158

11591159
Support Level: SUPPORTED
11601160

@@ -1469,7 +1469,7 @@ list_unpack
14691469

14701470
.. note::
14711471

1472-
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`python.control-flow <python.control-flow>`
1472+
Tags: :doc:`python.control-flow <python.control-flow>`, :doc:`python.data-structure <python.data-structure>`
14731473

14741474
Support Level: SUPPORTED
14751475

@@ -2332,7 +2332,7 @@ dynamic_shape_round
23322332

23332333
.. note::
23342334

2335-
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
2335+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
23362336

23372337
Support Level: NOT_SUPPORTED_YET
23382338

‎main/_sources/generated/exportdb/python.builtin.rst.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dynamic_shape_round
55

66
.. note::
77

8-
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
8+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
99

1010
Support Level: NOT_SUPPORTED_YET
1111

‎main/_sources/generated/exportdb/python.control-flow.rst.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ list_unpack
6262

6363
.. note::
6464

65-
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`python.control-flow <python.control-flow>`
65+
Tags: :doc:`python.control-flow <python.control-flow>`, :doc:`python.data-structure <python.data-structure>`
6666

6767
Support Level: SUPPORTED
6868

‎main/_sources/generated/exportdb/python.data-structure.rst.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ list_unpack
202202

203203
.. note::
204204

205-
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`python.control-flow <python.control-flow>`
205+
Tags: :doc:`python.control-flow <python.control-flow>`, :doc:`python.data-structure <python.data-structure>`
206206

207207
Support Level: SUPPORTED
208208

‎main/_sources/generated/exportdb/torch.dynamic-shape.rst.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ dynamic_shape_map
534534

535535
.. note::
536536

537-
Tags: :doc:`torch.map <torch.map>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
537+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.map <torch.map>`
538538

539539
Support Level: SUPPORTED
540540

@@ -599,7 +599,7 @@ dynamic_shape_round
599599

600600
.. note::
601601

602-
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
602+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
603603

604604
Support Level: NOT_SUPPORTED_YET
605605

‎main/_sources/generated/exportdb/torch.dynamic-value.rst.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ constrain_as_size_example
55

66
.. note::
77

8-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
8+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
99

1010
Support Level: SUPPORTED
1111

@@ -72,7 +72,7 @@ constrain_as_value_example
7272

7373
.. note::
7474

75-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
75+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
7676

7777
Support Level: SUPPORTED
7878

0 commit comments

Comments
 (0)