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

Metrics dedup for MLflow logger #3678

Merged

Conversation

chenmoneygithub
Copy link
Contributor

@chenmoneygithub chenmoneygithub commented Oct 23, 2024

What does this PR do?

Context: MLflow has receiving lots of data... so we want to save some budget.

In this PR, if we detect that a metric has the same value as the previous step, we don't log it unless it meets one of the following 2 criteria:

  • There has been log_duplicated_metric_every_n_steps skipped since last step logging, default to 100.
  • There has been log_duplicated_metric_every_n_millis passed since last step logging, default to 600000 (10 minutes).

We put this exception for sampling purpose, otherwise it will be challenging to capture the duplicated values during sampling, despite the duplicated value occupies a significant portion of the metric history.

Tested with LLM foundry quickstart, and 3 setup: 1) no dedupping 2) log duplicated steps per 2 steps 3) log duplicated steps per 10 steps. No problem spotted. See testing result below:

image image image

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add manual test + link to run/plots!

Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But do we need to log every n steps if its a duplicated value? why not just never log it?

Edit: Discussed offline, useful for sampling

@chenmoneygithub chenmoneygithub merged commit f542250 into mosaicml:main Oct 25, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants