Metrics dedup for MLflow logger #3678
Merged
+81
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
log_duplicated_metric_every_n_steps
skipped since last step logging, default to 100.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:
What issue(s) does this change relate to?
Before submitting
pre-commit
on your change? (see thepre-commit
section of prerequisites)