Skip to content

Commit ffdaa0f

Browse files
committed
docs(distributed): add distributed API reference
1 parent 93a6ebd commit ffdaa0f

File tree

2 files changed

+109
-7
lines changed

2 files changed

+109
-7
lines changed

docs/source/api/api.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,115 @@ Chain
285285
.. autofunction:: chain
286286

287287

288+
Distributed Utilities
289+
=====================
290+
291+
.. currentmodule:: torchopt.distributed
292+
293+
Initialization and Synchronization
294+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295+
296+
.. autosummary::
297+
298+
auto_init_rpc
299+
barrier
300+
301+
.. autofunction:: auto_init_rpc
302+
.. autofunction:: barrier
303+
304+
Process group information
305+
~~~~~~~~~~~~~~~~~~~~~~~~~
306+
307+
.. autosummary::
308+
309+
get_world_info
310+
get_world_rank
311+
get_rank
312+
get_world_size
313+
get_local_rank
314+
get_local_world_size
315+
get_worker_id
316+
317+
.. autofunction:: get_world_info
318+
.. autofunction:: get_world_rank
319+
.. autofunction:: get_rank
320+
.. autofunction:: get_world_size
321+
.. autofunction:: get_local_rank
322+
.. autofunction:: get_local_world_size
323+
.. autofunction:: get_worker_id
324+
325+
Worker selection
326+
~~~~~~~~~~~~~~~~
327+
328+
.. autosummary::
329+
330+
on_rank
331+
not_on_rank
332+
rank_zero_only
333+
rank_non_zero_only
334+
335+
.. autofunction:: on_rank
336+
.. autofunction:: not_on_rank
337+
.. autofunction:: rank_zero_only
338+
.. autofunction:: rank_non_zero_only
339+
340+
Remote Procedure Call (RPC)
341+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
342+
343+
.. autosummary::
344+
345+
remote_async_call
346+
remote_sync_call
347+
348+
.. autofunction:: remote_async_call
349+
.. autofunction:: remote_sync_call
350+
351+
Predefined partitioners and reducers
352+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353+
354+
.. autosummary::
355+
356+
dim_partitioner
357+
batch_partitioner
358+
mean_reducer
359+
sum_reducer
360+
361+
.. autofunction:: dim_partitioner
362+
.. autofunction:: batch_partitioner
363+
.. autofunction:: mean_reducer
364+
.. autofunction:: sum_reducer
365+
366+
Function parallelization wrappers
367+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
368+
369+
.. autosummary::
370+
371+
parallelize
372+
parallelize_async
373+
parallelize_sync
374+
375+
.. autofunction:: parallelize
376+
.. autofunction:: parallelize_async
377+
.. autofunction:: parallelize_sync
378+
379+
Distributed Autograd
380+
~~~~~~~~~~~~~~~~~~~~
381+
382+
.. currentmodule:: torchopt.distributed
383+
384+
.. autosummary::
385+
386+
context
387+
get_gradients
388+
backward
389+
grad
390+
391+
.. autofunction:: context
392+
.. autofunction:: get_gradients
393+
.. autofunction:: backward
394+
.. autofunction:: grad
395+
396+
288397
General Utilities
289398
=================
290399

docs/source/distributed/distributed.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ Initialization and Synchronization
142142

143143
.. autosummary::
144144

145-
146145
torchopt.distributed.auto_init_rpc
147146
torchopt.distributed.barrier
148147

@@ -197,7 +196,6 @@ Process group information
197196

198197
.. autosummary::
199198

200-
201199
torchopt.distributed.get_world_info
202200
torchopt.distributed.get_world_rank
203201
torchopt.distributed.get_rank
@@ -228,7 +226,6 @@ Worker selection
228226

229227
.. autosummary::
230228

231-
232229
torchopt.distributed.on_rank
233230
torchopt.distributed.not_on_rank
234231
torchopt.distributed.rank_zero_only
@@ -275,7 +272,6 @@ Remote Procedure Call (RPC)
275272

276273
.. autosummary::
277274

278-
279275
torchopt.distributed.remote_async_call
280276
torchopt.distributed.remote_sync_call
281277

@@ -354,7 +350,6 @@ Predefined partitioners and reducers
354350

355351
.. autosummary::
356352

357-
358353
torchopt.distributed.dim_partitioner
359354
torchopt.distributed.batch_partitioner
360355
torchopt.distributed.mean_reducer
@@ -439,7 +434,6 @@ Function parallelization wrappers
439434

440435
.. autosummary::
441436

442-
443437
torchopt.distributed.parallelize
444438
torchopt.distributed.parallelize_async
445439
torchopt.distributed.parallelize_sync
@@ -490,7 +484,6 @@ Distributed Autograd
490484

491485
.. autosummary::
492486

493-
494487
torchopt.distributed.autograd.context
495488
torchopt.distributed.autograd.get_gradients
496489
torchopt.distributed.autograd.backward

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy