Events
Module contains events processing mechanisms that are integrated with the standard python logging.
Example of usage:
from torch.distributed.elastic import events
event = events.Event(
name="test_event", source=events.
Module contains events processing mechanisms that are integrated with the standard python logging.
Example of usage:
from torch.distributed.elastic import events
event = events.Event(
name="test_event", source=events.
Initialize rendezvous event object and record its operations.
run_id (str) – The run id of the rendezvous.
message (str) – The message describing the event.
node_state (NodeState) – The state of the node (INIT, RUNNING, SUCCEEDED, FAILED).
name (str) – Event name. (E.g. Current action being performed).
hostname (str) – Hostname of the node.
pid () – The process id of the node.
The class represents the generic event that occurs during the torchelastic job execution.
The event can be any kind of meaningful action.
Known identifiers of the event producers.
The states that a node can be in rendezvous.
master_endpoint (str) – The master endpoint for the rendezvous store, if known.
local_id (Optional[int]) – The local_id of the node, if defined in dynamic_rendezvous.py
rank (Optional[int]) – The rank of the node, if known.
None
None
>>> # See DynamicRendezvousHandler class
>>> def _record(
... self,
... message: str,
... node_state: NodeState = NodeState.RUNNING,
... rank: Optional[int] = None,
... ) -> None:
... construct_and_record_rdzv_event(
... name=f"{self.__class__.__name__}.{get_method_name()}",
... run_id=self._settings.run_id,
... message=message,
... node_state=node_state,
... hostname=self._this_node.addr,
... pid=self._this_node.pid,
... local_id=self._this_node.local_id,
... rank=rank,
... )