-
Notifications
You must be signed in to change notification settings - Fork 400
/
profiler_action.py
23 lines (17 loc) · 976 Bytes
/
profiler_action.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Action states for the :class:`Profiler` that define whether or not events are being recorded to the trace file."""
from composer.utils.string_enum import StringEnum
__all__ = ['ProfilerAction']
class ProfilerAction(StringEnum):
"""Action states for the :class:`Profiler` that define whether or not events are being recorded to the trace file.
Attributes:
SKIP: Do not record new events to the trace. Any events started during ``ACTIVE`` or ``WARMUP`` will be recorded upon finish.
WARMUP: Record all events to the trace `except` those requiring a warmup period to initialize data structures (e.g., :doc:`profiler`).
ACTIVE: Record all events to the trace.
ACTIVE_AND_SAVE: Record all events and save the trace at the end of the batch.
"""
SKIP = 'skip'
WARMUP = 'warmup'
ACTIVE = 'active'
ACTIVE_AND_SAVE = 'active_and_save'