Tuning with Optuna and MlflowSparkStudy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2026 12:24 PM
I am following the guide for tuning a model with Optuna and MlflowSparkStudy. My compute is configured with autoscaling enabled, with 1–2 Spark workers, each with 8 cores and 32 GB of memory. I set n_jobs=2 and trials=100, in mlflow_study.optimize().
I have a few questions about how MlflowSparkStudy distributes the workload:
How should I think about n_jobs in mlflow_study.optimize() vs. num_threads/n_jobs in LightGBM?
For example, with 1–2 Spark workers and 8 cores per worker, would it make sense to set mlflow_study.optimize(n_jobs=2) and LightGBM n_jobs=7? My dataset is large, so ideally I would like to run only one model-training job per Spark worker and use the remaining cores on that worker for the LightGBM training.
Does MlflowSparkStudy automatically trigger or make use of Spark autoscaling?
If I configure my cluster with a minimum of 1 worker and a maximum of 2 workers, will MlflowSparkStudy cause Spark to scale up to 2 workers as needed when running multiple trials in parallel?
What is the recommended way to make a large DataFrame available to each Spark worker?
Currently, I have a Pandas DataFrame that I pass to the objective function used by mlflow_study.optimize(). Should I broadcast the DataFrame, cache it in Spark, or use another approach to avoid repeatedly transferring the data to each worker for every trial?
Any guidance on the recommended configuration or best practices would be greatly appreciated.
#mlflow #optuna #MlflowSparkStudy
https://learn.microsoft.com/en-us/azure/databricks/machine-learning/automl-hyperparam-tuning/optuna
- Labels:
-
Model Serving
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2026 01:34 AM
@AdamIH123 Did you try this?
Convert a Spark Pandas DataFrame to a standard PySpark DataFrame.
Train distributed LightGBM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2026 03:49 AM
Great questions—especially the distinction between Optuna’s trial-level parallelism and LightGBM’s intra-trial threading. The interaction with Spark autoscaling and data locality is also something I’d love to see documented with a concrete example. Curious what configuration others have found most efficient for large datasets.