-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
MlflowLogger limit parameter value length 250 char #5893
MlflowLogger limit parameter value length 250 char #5893
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5893 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 159 159
Lines 11209 11097 -112
=======================================
- Hits 10440 9911 -529
- Misses 769 1186 +417 |
@Borda Thanks, updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to cover this line. Have a look at tests/loggers/test_mlflow.py
You can use (pseudo code):
with pytest.warns(UserWarning, match="Discard x = y")
mlflow.log_ ...
ping me if you need help :)
pytorch_lightning/loggers/mlflow.py
Outdated
@@ -150,6 +150,10 @@ def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: | |||
params = self._convert_params(params) | |||
params = self._flatten_dict(params) | |||
for k, v in params.items(): | |||
if len(str(v)) > 250: | |||
log.warning(f"Mlflow only allows parameters with up to 250 characters. Discard {k}={v}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to double check, it is actually v not k that has a limit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also let's use rank_zero_warn
here instead of log.warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awaelchli yeah, it's v, there are feature requests in mlflow about that
mlflow/mlflow#3931
mlflow/mlflow#1976
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
What does this PR do?
Fixes #5892 (issue) <- this links related issue to this PR
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃