Table of Contents
Shortcuts

# 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.EventSource.WORKER, metadata={...})
    events.get_logging_handler(destination="console").info(event)

## API Methods

torch.distributed.elastic.events.record(event, destination='null')

torch.distributed.elastic.events.get_logging_handler(destination='null')
  Return type:

    Handler

## Event Objects

class torch.distributed.elastic.events.api.Event(name, source, timestamp=0, metadata=<factory>)

  The class represents the generic event that occurs during the torchelastic job execution. The event can be any kind of meaningful action.

  Parameters:

    - name (str) – event name.

    - source (EventSource) – the event producer, e.g. agent or worker

    - timestamp (int) – timestamp in milliseconds when event occurred.

    - metadata (Dict[str, Optional[Union[str, int, float, bool]]]) – additional data that is associated with the event.

class torch.distributed.elastic.events.api.EventSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

  Known identifiers of the event producers.

torch.distributed.elastic.events.api.EventMetadataValue

  alias of `Optional`[`Union`[`str`, `int`, `float`, `bool`]]

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.