optuna-integration icon indicating copy to clipboard operation
optuna-integration copied to clipboard

Parent run missing in MLFlow when using nested trials

Open EvenAR opened this issue 1 year ago • 3 comments

Expected behavior

Using MLflowCallback(mlflow_kwargs={"nested": True}) I expect each trial to be grouped under a parent run in MLFlow tracker UI.

Environment

  • Optuna version: 3.4.0
  • Python version: 3.10.13
  • OS: Ubuntu 20.04.6 LTS
  • MLflow version: 2.9.1

Error messages, stack traces, or logs

N/A

Steps to reproduce

mflow_callback = MLflowCallback(
    tracking_uri="http://mlflow-container:1992",
    mlflow_kwargs={"nested": True},
    create_experiment=True
)

@mflow_callback.track_in_mlflow()
def objective(trial):
    # ....

study = optuna.create_study(study_name="My experiment", direction='minimize')
study.optimize(objective, n_trials=2, callbacks=[mflow_callback])

Additional context (optional)

Perhaps my setup is missing something? Or is this there a different recommended way to group hyperparameter runs?

As you can see, each trial appear as individual runs: image

Thanks!

EvenAR avatar Dec 12 '23 16:12 EvenAR