Skip to content

Commit

Permalink
docs(distributed): add distributed API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Feb 15, 2023
1 parent 1b173e6 commit c2dd3c2
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 7 deletions.
109 changes: 109 additions & 0 deletions docs/source/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,115 @@ Chain
.. autofunction:: chain


Distributed Utilities
=====================

.. currentmodule:: torchopt.distributed

Initialization and Synchronization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::

auto_init_rpc
barrier

.. autofunction:: auto_init_rpc
.. autofunction:: barrier

Process group information
~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::

get_world_info
get_world_rank
get_rank
get_world_size
get_local_rank
get_local_world_size
get_worker_id

.. autofunction:: get_world_info
.. autofunction:: get_world_rank
.. autofunction:: get_rank
.. autofunction:: get_world_size
.. autofunction:: get_local_rank
.. autofunction:: get_local_world_size
.. autofunction:: get_worker_id

Worker selection
~~~~~~~~~~~~~~~~

.. autosummary::

on_rank
not_on_rank
rank_zero_only
rank_non_zero_only

.. autofunction:: on_rank
.. autofunction:: not_on_rank
.. autofunction:: rank_zero_only
.. autofunction:: rank_non_zero_only

Remote Procedure Call (RPC)
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::

remote_async_call
remote_sync_call

.. autofunction:: remote_async_call
.. autofunction:: remote_sync_call

Predefined partitioners and reducers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::

dim_partitioner
batch_partitioner
mean_reducer
sum_reducer

.. autofunction:: dim_partitioner
.. autofunction:: batch_partitioner
.. autofunction:: mean_reducer
.. autofunction:: sum_reducer

Function parallelization wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::

parallelize
parallelize_async
parallelize_sync

.. autofunction:: parallelize
.. autofunction:: parallelize_async
.. autofunction:: parallelize_sync

Distributed Autograd
~~~~~~~~~~~~~~~~~~~~

.. currentmodule:: torchopt.distributed.autograd

.. autosummary::

context
get_gradients
backward
grad

.. autofunction:: context
.. autofunction:: get_gradients
.. autofunction:: backward
.. autofunction:: grad


General Utilities
=================

Expand Down
7 changes: 0 additions & 7 deletions docs/source/distributed/distributed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ Initialization and Synchronization

.. autosummary::


torchopt.distributed.auto_init_rpc
torchopt.distributed.barrier

Expand Down Expand Up @@ -197,7 +196,6 @@ Process group information

.. autosummary::


torchopt.distributed.get_world_info
torchopt.distributed.get_world_rank
torchopt.distributed.get_rank
Expand Down Expand Up @@ -228,7 +226,6 @@ Worker selection

.. autosummary::


torchopt.distributed.on_rank
torchopt.distributed.not_on_rank
torchopt.distributed.rank_zero_only
Expand Down Expand Up @@ -275,7 +272,6 @@ Remote Procedure Call (RPC)

.. autosummary::


torchopt.distributed.remote_async_call
torchopt.distributed.remote_sync_call

Expand Down Expand Up @@ -354,7 +350,6 @@ Predefined partitioners and reducers

.. autosummary::


torchopt.distributed.dim_partitioner
torchopt.distributed.batch_partitioner
torchopt.distributed.mean_reducer
Expand Down Expand Up @@ -439,7 +434,6 @@ Function parallelization wrappers

.. autosummary::


torchopt.distributed.parallelize
torchopt.distributed.parallelize_async
torchopt.distributed.parallelize_sync
Expand Down Expand Up @@ -490,7 +484,6 @@ Distributed Autograd

.. autosummary::


torchopt.distributed.autograd.context
torchopt.distributed.autograd.get_gradients
torchopt.distributed.autograd.backward
Expand Down

0 comments on commit c2dd3c2

Please sign in to comment.