U
    Jºcx  ã                   @   s<   d Z ddlmZmZmZmZmZmZmZ ddl	m
Z
mZ dS )a–  
The elastic agent is the control plane of torchelastic. It is a process
that launches and manages underlying worker processes. The agent is
responsible for:

1. Working with distributed torch: the workers are started with all the
   necessary information to successfully and trivially call
   ``torch.distributed.init_process_group()``.

2. Fault tolerance: monitors workers and upon detecting worker failures
   or unhealthiness, tears down all workers and restarts everyone.

3. Elasticity: Reacts to membership changes and restarts workers with the new
   members.

The simplest agents are deployed per node and works with local processes.
A more advanced agent can launch and manage workers remotely. Agents can
be completely decentralized, making decisions based on the workers it manages.
Or can be coordinated, communicating to other agents (that manage workers
in the same job) to make a collective decision.
é   )ÚElasticAgentÚ	RunResultÚSimpleElasticAgentÚWorkerÚWorkerGroupÚ
WorkerSpecÚWorkerState)ÚTORCHELASTIC_ENABLE_FILE_TIMERÚTORCHELASTIC_TIMER_FILEN)Ú__doc__Úapir   r   r   r   r   r   r   Zlocal_elastic_agentr	   r
   © r   r   úS/tmp/pip-unpacked-wheel-gikjz4vx/torch/distributed/elastic/agent/server/__init__.pyÚ<module>	   s   $	