cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

What can I do to reduce the number of MLflow API calls I make?

Joseph_B
Databricks Employee
Databricks Employee

I'm fitting multiple models in parallel. For each one, I'm logging lots of params and metrics to MLflow. I'm hitting rate limits, causing problems in my jobs.

1 REPLY 1

Joseph_B
Databricks Employee
Databricks Employee

The first thing to try is to log in batches. If you are logging each param and metric separately, you're making 1 API call per param and 1 per metric. Instead, you should use the batch logging APIs; e.g. use "log_params" instead of "log_param" https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.log_params

If you're logging 10 params and metrics per model, this will cut the number of API calls you're making by a factor of 10.

If this optimization is still insufficient for you, then I'd recommend doing 2 things:

1) Short-term workaround: You can save data you wish to log to a table and log it in a follow-up process later.

2) Medium/long-term: I'd recommend working with your Databricks account team to come up with a solution to match your needs. In general, the best option is to reorganize how models are being fit or logged to do more efficient batching in logging. But different cases may have different best solutions, so working with your account team may be the best option.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now