You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- An Azure Machine Learning workspace. For more information, see [Create workspace resources](../quickstart-create-resources.md).
49
-
- A model. The examples in this article use a pre-trained model.
49
+
- A model. The examples in this article use a pretrained model.
50
50
- A machine that can run Docker, such as a [compute instance](../how-to-create-compute-instance.md).
51
51
52
52
# [Python SDK](#tab/python)
53
53
54
54
- An Azure Machine Learning workspace. For more information, see [Create workspace resources](../quickstart-create-resources.md).
55
-
- A model. The examples in this article use a pre-trained model.
55
+
- A model. The examples in this article use a pretrained model.
56
56
- The [Azure Machine Learning software development kit (SDK) for Python](/python/api/overview/azure/ml/intro).
57
57
- A machine that can run Docker, such as a [compute instance](../how-to-create-compute-instance.md).
58
58
---
@@ -92,16 +92,16 @@ For more information on using the SDK to connect to a workspace, see the [Azure
92
92
A typical situation for a deployed machine learning service is that you need the following components:
93
93
94
94
+ Resources representing the specific model that you want deployed (for example: a pytorch model file).
95
-
+ Code that you will be running in the service that executes the model on a given input.
95
+
+ Code that runs in the service and executes the model on a given input.
96
96
97
-
Azure Machine Learnings allows you to separate the deployment into two separate components, so that you can keep the same code, but merely update the model. We define the mechanism by which you upload a model _separately_ from your code as "registering the model".
97
+
Azure Machine Learnings allows you to separate the deployment into two separate components, so that you can keep the same code, but merely update the model. We define the mechanism by which you upload a model _separately_ from your code as "registering the model."
98
98
99
99
When you register a model, we upload the model to the cloud (in your workspace's default storage account) and then mount it to the same compute where your webservice is running.
100
100
101
101
The following examples demonstrate how to register a model.
102
102
103
103
> [!IMPORTANT]
104
-
> You should use only models that you create or obtain from a trusted source. You should treat serialized models as code, because security vulnerabilities have been discovered in a number of popular formats. Also, models might be intentionally trained with malicious intent to provide biased or inaccurate output.
104
+
> You should use only models that you create or obtain from a trusted source. You should treat serialized models as code, because security vulnerabilities have been discovered in many popular formats. Also, models might be intentionally trained with malicious intent to provide biased or inaccurate output.
105
105
106
106
# [Azure CLI](#tab/azcli)
107
107
@@ -176,11 +176,11 @@ For more information, see the documentation for the [Model class](/python/api/az
176
176
print(run.model_id)
177
177
```
178
178
179
-
In this example, the `metric`and`iteration` parameters aren't specified, so the iteration with the best primary metric will be registered. The `model_id` value returned from the run is used instead of a model name.
179
+
In this example, the `metric`and`iteration` parameters aren't specified, so the iteration with the best primary metric is registered. The `model_id` value returned from the run is used instead of a model name.
180
180
181
181
For more information, see the [AutoMLRun.register_model](/python/api/azureml-train-automl-client/azureml.train.automl.run.automlrun#register-model-model-name-none--description-none--tags-none--iteration-none--metric-none-) documentation.
182
182
183
-
To deploy a registered model from an `AutoMLRun`, we recommend doing so via the [one-click deploy button in Azure Machine Learning studio](../how-to-use-automated-ml-for-ml-models.md#deploy-your-model).
183
+
To deploy a registered model from an `AutoMLRun`, we recommend doing so via the [one-select deploy button in Azure Machine Learning studio](../how-to-use-automated-ml-for-ml-models.md#deploy-your-model).
184
184
185
185
---
186
186
@@ -189,10 +189,10 @@ For more information, see the documentation for the [Model class](/python/api/az
189
189
> You can also register a model from a local file via the Workspace UI portal.
190
190
>
191
191
> Currently, there are two options to upload a local model filein the UI:
192
-
>-**From local files**, which will register a v2 model.
193
-
>-**From local files (based on framework)**, which will register a v1 model.
192
+
>-**From local files**, which registers a v2 model.
193
+
>-**From local files (based on framework)**, which registers a v1 model.
194
194
>
195
-
>Note that only models registered via the **From local files (based on framework)** entrance (which are known as v1 models) can be deployed as webservices using SDKv1/CLIv1.
195
+
>Only models registered via the **From local files (based on framework)** entrance (which are known as v1 models) can be deployed as webservices using SDKv1/CLIv1.
196
196
197
197
## Define a dummy entry script
198
198
@@ -207,18 +207,18 @@ For your initial deployment, use a dummy entry script that prints the data it re
Save this fileas`echo_score.py` inside of a directory called `source_dir`. This dummy script returns the data you send to it, so it doesn't use the model. But it is useful for testing that the scoring script is running.
210
+
Save this fileas`echo_score.py` inside of a directory called `source_dir`. This dummy script returns the data you send to it, so it doesn't use the model. But it's useful for testing that the scoring script is running.
211
211
212
212
## Define an inference configuration
213
213
214
-
An inference configuration describes the Docker container and files to use when initializing your web service. All of the files within your source directory, including subdirectories, will be zipped up and uploaded to the cloud when you deploy your web service.
214
+
An inference configuration describes the Docker container and files to use when initializing your web service. All of the files within your source directory, including subdirectories, is zipped up and uploaded to the cloud when you deploy your web service.
215
215
216
-
The inference configuration below specifies that the machine learning deployment will use the file`echo_score.py`in the `./source_dir` directory to process incoming requests and that it will use the Docker image with the Python packages specified in the `project_environment` environment.
216
+
The following inference configuration specifies that the machine learning deployment uses the file`echo_score.py`in the `./source_dir` directory to process incoming requests and that it uses the Docker image with the Python packages specified in the `project_environment` environment.
217
217
218
-
You can use any [Azure Machine Learning inference curated environments](../concept-prebuilt-docker-images-inference.md#list-of-prebuilt-docker-images-for-inference) as the base Docker image when creating your project environment. We will install the required dependencies on top and store the resulting Docker image into the repository that is associated with your workspace.
218
+
You can use any [Azure Machine Learning inference curated environments](../concept-prebuilt-docker-images-inference.md#list-of-prebuilt-docker-images-for-inference) as the base Docker image when creating your project environment. The required dependencies are installed on top. The resulting Docker image is stored into the repository that is associated with your workspace.
219
219
220
220
> [!NOTE]
221
-
> Azure machine learning [inference source directory](/python/api/azureml-core/azureml.core.model.inferenceconfig?view=azure-ml-py#constructor&preserve-view=true) upload does not respect **.gitignore** or **.amlignore**
@@ -235,7 +235,7 @@ Save this file with the name `dummyinferenceconfig.json`.
235
235
236
236
# [Python SDK](#tab/python)
237
237
238
-
The following example demonstrates how to create a minimal environment with no pip dependencies, using the dummy scoring script you defined above.
238
+
The following example demonstrates how to create a minimal environment with no pip dependencies, using the dummy scoring script you defined previously.
@@ -248,9 +248,9 @@ For more information on inference configuration, see the [InferenceConfig](/pyth
248
248
249
249
## Define a deployment configuration
250
250
251
-
A deployment configuration specifies the amount of memory and cores your webservice needs in order to run. It also provides configuration details of the underlying webservice. For example, a deployment configuration lets you specify that your service needs 2 gigabytes of memory, 2CPU cores, 1GPU core, andthat you want to enable autoscaling.
251
+
A deployment configuration specifies the amount of memory and cores your webservice needs in order to run. It also provides configuration details of the underlying webservice. For example, a deployment configuration lets you specify that your service needs 2 gigabytes of memory, 2CPU cores, 1GPU core, andenables autoscaling.
252
252
253
-
The options available for a deployment configuration differ depending on the compute target you choose. In a local deployment, all you can specify is which port your webservice will be served on.
253
+
The options available for a deployment configuration differ depending on the compute target you choose. In a local deployment, all you can specify is which port your webservice is served on.
254
254
255
255
# [Azure CLI](#tab/azcli)
256
256
@@ -282,7 +282,7 @@ The following Python demonstrates how to create a local deployment configuration
282
282
283
283
## Deploy your machine learning model
284
284
285
-
You are now ready to deploy your model.
285
+
You're now ready to deploy your model.
286
286
287
287
# [Azure CLI](#tab/azcli)
288
288
@@ -313,7 +313,7 @@ For more information, see the documentation for [Model.deploy()](/python/api/azu
313
313
314
314
## Call into your model
315
315
316
-
Let's check that your echo model deployed successfully. You should be able to do a simple liveness request, as well as a scoring request:
316
+
Let's check that your echo model deployed successfully. You should be able to do a liveness request, and a scoring request:
The compute target you use to host your model will affect the cost and availability of your deployed endpoint. Use this table to choose an appropriate compute target.
420
+
The compute target you use to host your model affects the cost and availability of your deployed endpoint. Use this table to choose an appropriate compute target.
421
421
422
422
| Compute target | Used for|GPU support | Description |
423
423
|-----|-----|-----|-----|
@@ -432,7 +432,7 @@ The compute target you use to host your model will affect the cost and availabil
432
432
433
433
## Deploy to cloud
434
434
435
-
Once you've confirmed your service works locally and chosen a remote compute target, you are ready to deploy to the cloud.
435
+
Once you've confirmed your service works locally and chosen a remote compute target, you're ready to deploy to the cloud.
436
436
437
437
Change your deploy configuration to correspond to the compute target you've chosen, in this case Azure Container Instances:
438
438
@@ -517,20 +517,20 @@ The following table describes the different service states:
517
517
|-----|-----|-----|
518
518
| Transitioning | The service isin the process of deployment. | No |
519
519
| Unhealthy | The service has deployed but is currently unreachable. | No |
520
-
| Unschedulable | The service cannot be deployed at this time due to lack of resources. | No |
520
+
| Unschedulable | The service can't be deployed at this time due to lack of resources. | No |
521
521
| Failed | The service has failed to deploy due to an error or crash. | Yes |
522
522
| Healthy | The service is healthy and the endpoint is available. | Yes |
523
523
524
524
> [!TIP]
525
525
> When deploying, Docker images for compute targets are built and loaded from Azure Container Registry (ACR). By default, Azure Machine Learning creates an ACR that uses the *basic* service tier. Changing the ACRfor your workspace to standard or premium tier may reduce the time it takes to build and deploy images to your compute targets. For more information, see [Azure Container Registry service tiers](/azure/container-registry/container-registry-skus).
526
526
527
527
> [!NOTE]
528
-
> If you are deploying a model to Azure Kubernetes Service (AKS), we advise you enable [Azure Monitor](/azure/azure-monitor/containers/container-insights-enable-existing-clusters) for that cluster. This will help you understand overall cluster health and resource usage. You might also find the following resources useful:
528
+
> If you're deploying a model to Azure Kubernetes Service (AKS), we advise you enable [Azure Monitor](/azure/azure-monitor/containers/container-insights-enable-existing-clusters) for that cluster. This helps you understand overall cluster health and resource usage. You might also find the following resources useful:
529
529
>
530
530
>* [Check for Resource Health events impacting your AKS cluster](/azure/aks/aks-resource-health)
531
531
>* [Azure Kubernetes Service Diagnostics](/azure/aks/concepts-diagnostics)
532
532
>
533
-
> If you are trying to deploy a model to an unhealthy or overloaded cluster, itisexpected to experience issues. If you need help troubleshooting AKS cluster problems please contact AKS Support.
533
+
> If you're trying to deploy a model to an unhealthy or overloaded cluster, it's expected to experience issues. If you need help troubleshooting AKS cluster problems contact AKS Support.
534
534
535
535
## Delete resources
536
536
@@ -568,7 +568,7 @@ For more information, see the documentation for [WebService.delete()](/python/ap
568
568
569
569
* [Troubleshoot a failed deployment](how-to-troubleshoot-deployment.md)
570
570
* [Update web service](../how-to-deploy-update-web-service.md)
571
-
* [One click deployment for automated ML runs in the Azure Machine Learning studio](../how-to-use-automated-ml-for-ml-models.md#deploy-your-model)
571
+
* [One select deployment for automated ML runs in the Azure Machine Learning studio](../how-to-use-automated-ml-for-ml-models.md#deploy-your-model)
572
572
* [Use TLS to secure a web service through Azure Machine Learning](../how-to-secure-web-service.md)
573
573
* [Monitor your Azure Machine Learning models with Application Insights](../how-to-enable-app-insights.md)
574
574
* [Create event alerts and triggers for model deployments](../how-to-use-event-grid.md)
0 commit comments