Skip to content

Commit

Permalink
Timer PR parts 1 and 2 from #146 (#174)
Browse files Browse the repository at this point in the history
Added the `Time` class, `Timer` class, conversion function, and test cases and docstrings for these classes. This functionality encompasses parts 1 and 2 from #146, with the following changes:

1. `tokens` will be 0 (instead of None) if not being tracked.

Also, modified the `StringEnum` class to relax the requirement that the lowercase name be the value, since this does not hold for our timing abbreviations.

Other PRs will integrate the Timer into the training loop.
  • Loading branch information
ravi-mosaicml authored Dec 28, 2021
1 parent 0db92b9 commit 9943f8a
Show file tree
Hide file tree
Showing 10 changed files with 497 additions and 8 deletions.
3 changes: 3 additions & 0 deletions composer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
from composer.core import Event as Event
from composer.core import Logger as Logger
from composer.core import State as State
from composer.core import Time as Time
from composer.core import Timer as Timer
from composer.core import TimeUnit as TimeUnit
from composer.core import types as types
from composer.trainer import Trainer as Trainer
3 changes: 3 additions & 0 deletions composer/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
from composer.core.event import Event as Event
from composer.core.logging import Logger as Logger
from composer.core.state import State as State
from composer.core.time import Time as Time
from composer.core.time import Timer as Timer
from composer.core.time import TimeUnit as TimeUnit
Loading

0 comments on commit 9943f8a

Please sign in to comment.