Skip to content

Commit f3c88c6

Browse files
Merge pull request #3378 from Blackmist/402253-fresh
freshness
2 parents 6604652 + 96772f7 commit f3c88c6

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

articles/machine-learning/v1/how-to-deploy-and-where.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Deploy machine learning models
33
titleSuffix: Azure Machine Learning
4-
description: 'Learn how and where to deploy machine learning models. Deploy to Azure Container Instances, Azure Kubernetes Service, and FPGA.'
4+
description: 'Learn how and where to deploy machine learning models. Deploy to Azure Container Instances, and Azure Kubernetes Service.'
55
services: machine-learning
66
ms.service: azure-machine-learning
77
ms.subservice: inferencing
88
ms.reviewer: None
99
author: Blackmist
1010
ms.author: larryfr
11-
ms.date: 11/16/2022
11+
ms.date: 03/06/2025
1212
ms.topic: how-to
1313
ms.custom: UpdateFrequency5, deploy, devx-track-azurecli, mktng-kw-nov2021, cliv1, sdkv1
1414
adobe-target: true
@@ -46,13 +46,13 @@ For more information on the concepts involved in the machine learning deployment
4646
[!INCLUDE [cli10-only](../includes/machine-learning-cli-v1-deprecation.md)]
4747

4848
- 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.
5050
- A machine that can run Docker, such as a [compute instance](../how-to-create-compute-instance.md).
5151

5252
# [Python SDK](#tab/python)
5353

5454
- 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.
5656
- The [Azure Machine Learning software development kit (SDK) for Python](/python/api/overview/azure/ml/intro).
5757
- A machine that can run Docker, such as a [compute instance](../how-to-create-compute-instance.md).
5858
---
@@ -92,16 +92,16 @@ For more information on using the SDK to connect to a workspace, see the [Azure
9292
A typical situation for a deployed machine learning service is that you need the following components:
9393

9494
+ 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.
9696

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."
9898

9999
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.
100100

101101
The following examples demonstrate how to register a model.
102102

103103
> [!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.
105105
106106
# [Azure CLI](#tab/azcli)
107107

@@ -176,11 +176,11 @@ For more information, see the documentation for the [Model class](/python/api/az
176176
print(run.model_id)
177177
```
178178

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.
180180

181181
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.
182182

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).
184184

185185
---
186186

@@ -189,10 +189,10 @@ For more information, see the documentation for the [Model class](/python/api/az
189189
> You can also register a model from a local file via the Workspace UI portal.
190190
>
191191
> Currently, there are two options to upload a local model file in 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.
194194
>
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.
196196

197197
## Define a dummy entry script
198198

@@ -207,18 +207,18 @@ For your initial deployment, use a dummy entry script that prints the data it re
207207

208208
:::code language="python" source="~/azureml-examples-archive/v1/python-sdk/tutorials/deploy-local/source_dir/echo_score.py":::
209209

210-
Save this file as `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 file as `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.
211211

212212
## Define an inference configuration
213213

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.
215215

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.
217217

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.
219219

220220
> [!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**
221+
> Azure Machine Learning [inference source directory](/python/api/azureml-core/azureml.core.model.inferenceconfig?view=azure-ml-py#constructor&preserve-view=true) upload doesn't respect **.gitignore** or **.amlignore**
222222

223223
# [Azure CLI](#tab/azcli)
224224

@@ -235,7 +235,7 @@ Save this file with the name `dummyinferenceconfig.json`.
235235

236236
# [Python SDK](#tab/python)
237237

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.
239239

240240
[!Notebook-python[] (~/azureml-examples-archive/v1/python-sdk/tutorials/deploy-local/1.deploy-local.ipynb?name=inference-configuration-code)]
241241

@@ -248,9 +248,9 @@ For more information on inference configuration, see the [InferenceConfig](/pyth
248248

249249
## Define a deployment configuration
250250

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, 2 CPU cores, 1 GPU core, and that 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, 2 CPU cores, 1 GPU core, and enables autoscaling.
252252

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.
254254

255255
# [Azure CLI](#tab/azcli)
256256

@@ -282,7 +282,7 @@ The following Python demonstrates how to create a local deployment configuration
282282

283283
## Deploy your machine learning model
284284

285-
You are now ready to deploy your model.
285+
You're now ready to deploy your model.
286286

287287
# [Azure CLI](#tab/azcli)
288288

@@ -313,7 +313,7 @@ For more information, see the documentation for [Model.deploy()](/python/api/azu
313313

314314
## Call into your model
315315

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:
317317

318318
# [Azure CLI](#tab/azcli)
319319

@@ -417,7 +417,7 @@ curl -v -X POST -H "content-type:application/json" \
417417

418418
## Choose a compute target
419419

420-
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.
421421

422422
| Compute target | Used for | GPU support | Description |
423423
| ----- | ----- | ----- | ----- |
@@ -432,7 +432,7 @@ The compute target you use to host your model will affect the cost and availabil
432432

433433
## Deploy to cloud
434434

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.
436436

437437
Change your deploy configuration to correspond to the compute target you've chosen, in this case Azure Container Instances:
438438

@@ -517,20 +517,20 @@ The following table describes the different service states:
517517
| ----- | ----- | ----- |
518518
| Transitioning | The service is in the process of deployment. | No |
519519
| 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 |
521521
| Failed | The service has failed to deploy due to an error or crash. | Yes |
522522
| Healthy | The service is healthy and the endpoint is available. | Yes |
523523

524524
> [!TIP]
525525
> 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 ACR for 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).
526526

527527
> [!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:
529529
>
530530
> * [Check for Resource Health events impacting your AKS cluster](/azure/aks/aks-resource-health)
531531
> * [Azure Kubernetes Service Diagnostics](/azure/aks/concepts-diagnostics)
532532
>
533-
> If you are trying to deploy a model to an unhealthy or overloaded cluster, it is expected 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.
534534

535535
## Delete resources
536536

@@ -568,7 +568,7 @@ For more information, see the documentation for [WebService.delete()](/python/ap
568568

569569
* [Troubleshoot a failed deployment](how-to-troubleshoot-deployment.md)
570570
* [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)
572572
* [Use TLS to secure a web service through Azure Machine Learning](../how-to-secure-web-service.md)
573573
* [Monitor your Azure Machine Learning models with Application Insights](../how-to-enable-app-insights.md)
574574
* [Create event alerts and triggers for model deployments](../how-to-use-event-grid.md)

0 commit comments

Comments
 (0)