Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fit start to mosaicmllogger #3467

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions composer/loggers/mosaicml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ def fit_end(self, state: State, logger: Logger) -> None:
self.log_metadata(training_progress_data)
self._flush_metadata(force_flush=True)

def fit_start(self, state: State, logger: Logger) -> None:
# Log model training started time for run events
self.log_metadata({'train_started_time': time.time()})
self._flush_metadata(force_flush=True)

def eval_end(self, state: State, logger: Logger) -> None:
self._flush_metadata(force_flush=True)

Expand Down
1 change: 1 addition & 0 deletions tests/loggers/test_mosaicml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def test_run_events_logged(monkeypatch):
assert metadata['mosaicml/training_progress'] == '[batch=4/4]'
assert 'mosaicml/training_sub_progress' not in metadata
assert isinstance(metadata['mosaicml/train_finished_time'], float)
assert isinstance(metadata['mosaicml/train_started_time'], float)


def test_token_training_progress_metrics():
Expand Down
Loading