Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Machine Learning Request Response latency

I have made an Azure Machine Learning Experiment which takes a small dataset (12x3 array) and some parameters and does some calculations using a few Python modules (a linear regression calculation and some more). This all works fine.

I have deployed the experiment and now want to throw data at it from the front-end of my application. The API-call goes in and comes back with correct results, but it takes up to 30 seconds to calculate a simple linear regression. Sometimes it is 20 seconds, sometimes only 1 second. I even got it down to 100 ms one time (which is what I'd like), but 90% of the time the request takes more than 20 seconds to complete, which is unacceptable.

I guess it has something to do with it still being an experiment, or it is still in a development slot, but I can't find the settings to get it to run on a faster machine.

Is there a way to speed up my execution?

Edit: To clarify: The varying timings are obtained with the same test data, simply by sending the same request multiple times. This made me conclude it must have something to do with my request being put in a queue, there is some start-up latency or I'm throttled in some other way.

like image 778
JrtPec Avatar asked Jan 25 '16 10:01

JrtPec


People also ask

Is Azure good for ML?

Azure ML offers readily available well-known algorithms that can be configured simply by drag and drop. It does not require the knowledge of data science or expertise in algorithms; you just need to know when to use them.

Can Azure ML train ML?

Azure Machine Learning provides several ways to train your models, from code-first solutions using the SDK to low-code solutions such as automated machine learning and the visual designer.

What does the Featurization setting do in automated ML?

Featurization includes automated feature engineering (when "featurization": 'auto' ) and scaling and normalization, which then impacts the selected algorithm and its hyperparameter values. AutoML supports different methods to ensure you have visibility into what was applied to your model.

What are logged metrics in Azure machine learning?

Log real-time information using both the default Python logging package and Azure Machine Learning Python SDK-specific functionality. You can log locally and send logs to your workspace in the portal. Logs can help you diagnose errors and warnings, or track performance metrics like parameters and model performance.


1 Answers

First, I am assuming you are doing your timing test on the published AML endpoint.

When a call is made to the AML the first call must warm up the container. By default a web service has 20 containers. Each container is cold, and a cold container can cause a large(30 sec) delay. In the string returned by the AML endpoint, only count requests that have the isWarm flag set to true. By smashing the service with MANY requests(relative to how many containers you have running) can get all your containers warmed.

If you are sending out dozens of requests a instance, the endpoint might be getting throttled. You can adjust the number of calls your endpoint can accept by going to manage.windowsazure.com/

  1. manage.windowsazure.com/
  2. Azure ML Section from left bar
  3. select your workspace
  4. go to web services tab
  5. Select your web service from list
  6. adjust the number of calls with slider

By enabling debugging onto your endpoint you can get logs about the execution time for each of your modules to complete. You can use this to determine if a module is not running as you intended which may add to the time.

Overall, there is an overhead when using the Execute python module, but I'd expect this request to complete in under 3 secs.

like image 58
Dan Ciborowski - MSFT Avatar answered Sep 29 '22 14:09

Dan Ciborowski - MSFT