pytorch/docs/source/elastic/timer.rst
Kiuk Chung a80b215a9a [1/n][torch/elastic] Move torchelastic docs *.rst (#148)
Summary:
Pull Request resolved: https://github.com/pytorch/elastic/pull/148

Pull Request resolved: https://github.com/pytorch/pytorch/pull/56811

Moves docs sphinx `*.rst` files from the torchelastic repository to torch. Note: only moves the rst files the next step is to link it to the main pytorch `index.rst` and write new `examples.rst`

Reviewed By: H-Huang

Differential Revision: D27974751

fbshipit-source-id: 8ff9f242aa32e0326c37da3916ea0633aa068fc5
2021-05-04 00:57:56 -07:00

42 lines
1.1 KiB
ReStructuredText

Expiration Timers
==================
.. automodule:: torch.distributed.elastic.timer
.. currentmodule:: torch.distributed.elastic.timer
Client Methods
---------------
.. autofunction:: torch.distributed.elastic.timer.configure
.. autofunction:: torch.distributed.elastic.timer.expires
Server/Client Implementations
------------------------------
Below are the timer server and client pairs that are provided by torchelastic.
.. note:: Timer server and clients always have to be implemented and used
in pairs since there is a messaging protocol between the server
and client.
.. autoclass:: LocalTimerServer
.. autoclass:: LocalTimerClient
Writing a custom timer server/client
--------------------------------------
To write your own timer server and client extend the
``torch.distributed.elastic.timer.TimerServer`` for the server and
``torch.distributed.elastic.timer.TimerClient`` for the client. The
``TimerRequest`` object is used to pass messages between
the server and client.
.. autoclass:: TimerRequest
:members:
.. autoclass:: TimerServer
:members:
.. autoclass:: TimerClient
:members: