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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

MlflowLogger limit parameter value length 250 char #5893

Merged
merged 8 commits into from Feb 16, 2021
Merged

MlflowLogger limit parameter value length 250 char #5893

merged 8 commits into from Feb 16, 2021

Conversation

ducthienbui97
Copy link
Contributor

@ducthienbui97 ducthienbui97 commented Feb 10, 2021

What does this PR do?

Fixes #5892 (issue) <- this links related issue to this PR

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

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:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Check that target branch and milestone match!

Did you have fun?

Make sure you had fun coding 馃檭

@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #5893 (00abf28) into master (6d1e055) will decrease coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #5893    +/-   ##
=======================================
- Coverage      93%     89%    -4%     
=======================================
  Files         159     159            
  Lines       11209   11097   -112     
=======================================
- Hits        10440    9911   -529     
- Misses        769    1186   +417     

@Borda Borda added feature Is an improvement or enhancement logger Related to the Loggers labels Feb 10, 2021
@Borda Borda changed the base branch from master to release/1.2-dev February 10, 2021 12:34
@Borda
Copy link
Member

Borda commented Feb 10, 2021

@ducthienbui97 pls rebase on feat 1.2 see
https://pytorch-lightning.readthedocs.io/en/latest/CONTRIBUTING.html#how-to-fix-pr-with-mixed-base-and-target-branches

@mergify mergify bot removed the has conflicts label Feb 10, 2021
@ducthienbui97
Copy link
Contributor Author

@Borda Thanks, updated

Copy link
Member

@awaelchli awaelchli left a 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 :)

@@ -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}")
Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor Author

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

@SkafteNicki SkafteNicki added the ready PRs ready to be merged label Feb 11, 2021
Base automatically changed from release/1.2-dev to master February 11, 2021 14:32
@carmocca carmocca enabled auto-merge (squash) February 12, 2021 14:13
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

@carmocca carmocca merged commit a0494ab into Lightning-AI:master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement logger Related to the Loggers ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MlflowLogger fail when logging long parameters
6 participants