-
Notifications
You must be signed in to change notification settings - Fork 30
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
Align run name strategy between MLflowCallback
and track_in_mlflow
method
#111
Conversation
Tests are failing but i'm not sure it's related to my change i see in the logs:
|
Sorry for the confusion. I will fix the main branch. Please wait a minuite. |
The main branch has been fixed in #112. Could you merge the main branch? |
optuna_integration/mlflow.py
Outdated
@@ -207,8 +207,9 @@ def wrapper(trial: optuna.trial.Trial) -> float | Sequence[float]: | |||
study = trial.study | |||
self._initialize_experiment(study) | |||
nested = self._mlflow_kwargs.get("nested") | |||
run_name = self._mlflow_kwargs.get("run_name") or str(trial.number) |
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.
If the first value can be evaluated as False
although I think this happens very unlikely, str(trial.number)
is used, so how about using str(trial.number)
as a default?
run_name = self._mlflow_kwargs.get("run_name") or str(trial.number) | |
run_name = self._mlflow_kwargs.get("run_name", str(trial.number)) |
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.
i wanted to have the exact same behavior as in the MLFlowCallback call method but ok to change 👍
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.
Ah, right. Thank you for your comment. Maybe we can update MLFlowCallback
's part too.
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.
done :)
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.
Thanks. Sorry, the mlflow test failed due to my suggestion, let me check what was wrong...
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.
yep i updated the test because we were setting run_name at None in the test. If it's ok i adjusted it like that: 1296daa
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.
Awesome!
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.
Thanks! Personally, the change looks great to me.
This pull request has not seen any recent activity. |
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.
I have reviewed this PR. LGTM. Since the assigned reviewer is currently busy, I will proceed with merging.
MLflowCallback
and track_in_mlflow
method
Motivation
The strategy for infering the run name was not aligned between the base class
MLflowCallback
and the decoratortrack_in_mlflow
.Description of the changes
This PR aligned the strategy to get the run name from MLfowCallback and pass it to mlflow. We lookup
_mlflow_kwargs
and we fallback on trial.number if not given.