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
After you train machine learning models or pipelines, or you found models from our model catalog that suit your needs, you need to deploy them to production so that others can use them for _inference_. Inference is the process of applying new input data to the machine learning model or pipeline to generate outputs. While these outputs are typically referred to as "predictions," inferencing can be used to generate outputs for other machine learning tasks, such as classification and clustering. In Azure Machine Learning, you perform inferencing by using __endpoints__.
25
+
Once you've trained machine learning models or pipelines, or you've found models from the model catalog that suit your needs, you need to deploy them to production so that others can use them for _inference_. Inference is the process of applying new input data to a machine learning model or pipeline to generate outputs. While these outputs are typically referred to as "predictions," inferencing can be used to generate outputs for other machine learning tasks, such as classification and clustering. In Azure Machine Learning, you perform inferencing by using __endpoints__.
26
26
27
27
## Endpoints and deployments
28
28
29
-
An **endpoint** is a stable and durable URL that can be used to request or invoke a model. You provide the required inputs to the endpoint and get the outputs back. An endpoint provides:
29
+
An **endpoint** is a stable and durable URL that can be used to request or invoke a model. You provide the required inputs to the endpoint and get the outputs back. Azure Machine Learning allows you to implement serverless API endpoints, online endpoints, and batch endpoints. An endpoint provides:
30
30
31
31
- a stable and durable URL (like _endpoint-name.region.inference.ml.azure.com_),
32
32
- an authentication mechanism, and
33
33
- an authorization mechanism.
34
34
35
-
A **deployment** is a set of resources and computes required for hosting the model or component that does the actual inferencing. A single endpoint can contain one or several deployments (except for [serverless API](#endpoints-serverless-api-online-and-batch) endpoints). The deployments can host independent assets and consume different resources based on the needs of the assets. Furthermore, endpoints have a routing mechanism that can direct requests to specific deployments in the endpoint.
35
+
A **deployment** is a set of resources and computes required for hosting the model or component that does the actual inferencing. An endpoint contains a deployment, and for onlineandbatch endpoints, one endpoint can contain several deployments. The deployments can host independent assets and consume different resources, based on the needs of the assets. Furthermore, an endpoint has a routing mechanism that can direct requests to any of its deployments.
36
36
37
-
Some types of endpoints in Azure Machine Learning consume dedicated resources on their deployments. For these endpoints to run, you must have compute quota on your subscription. However, certain models support a serverless deployment—consuming no quota from your subscription—instead, you're billed based on usage.
37
+
On one hand, some types of endpoints in Azure Machine Learning consume dedicated resources on their deployments. For these endpoints to run, you must have compute quota on your Azure subscription. On the other hand, certain models support a serverless deployment—allowing them to consume no quota from your subscription. For serverless deployment, you're billed based on usage.
38
38
39
39
### Intuition
40
40
41
41
Suppose you're working on an application that predicts the type and color of a car, given its photo. For this application, a user with certain credentials makes an HTTP request to a URL and provides a picture of a car as part of the request. In return, the user gets a response that includes the type and color of the car as string values. In this scenario, the URL serves as an __endpoint__.
42
42
43
-
:::image type="content" source="media/concept-endpoints/concept-endpoint.png" alt-text="A diagram showing the concept of an endpoint.":::
43
+
:::image type="content" source="media/concept-endpoints/concept-endpoint.png" alt-text="A diagram showing the concept of an endpoint." border="false":::
44
44
45
45
Furthermore, say that a data scientist, Alice, is working on implementing the application. Alice knows a lot about TensorFlow and decides to implement the model using a Keras sequential classifier with a RestNet architecture from the TensorFlow Hub. After testing the model, Alice is happy with its results and decides to use the model to solve the car prediction problem. The model is large in size and requires 8 GB of memory with 4 cores to run. In this scenario, Alice's model and the resources, such as the code and the compute, that are required to run the model make up a __deployment under the endpoint__.
46
46
47
-
:::image type="content" source="media/concept-endpoints/concept-deployment.png" alt-text="A diagram showing the concept of a deployment.":::
47
+
:::image type="content" source="media/concept-endpoints/concept-deployment.png" alt-text="A diagram showing the concept of a deployment." border="false":::
48
48
49
49
Let's imagine that after a couple of months, the organization discovers that the application performs poorly on images with less than ideal illumination conditions. Bob, another data scientist, knows a lot about data augmentation techniques that help a model build robustness on that factor. However, Bob feels more comfortable using Torch to implement the model and trains a new model with Torch. Bob wants to try this model in production gradually until the organization is ready to retire the old model. The new model also shows better performance when deployed to GPU, so the deployment needs to include a GPU. In this scenario, Bob's model and the resources, such as the code and the compute, that are required to run the model make up __another deployment under the same endpoint__.
50
50
51
-
:::image type="content" source="media/concept-endpoints/concept-deployment-routing.png" alt-text="A diagram showing the concept of an endpoint with multiple deployments.":::
51
+
:::image type="content" source="media/concept-endpoints/concept-deployment-routing.png" alt-text="A diagram showing the concept of an endpoint with multiple deployments." border="false":::
52
52
53
53
## Endpoints: serverless API, online, and batch
54
54
55
-
Azure Machine Learning allows you to implement [serverless API endpoints](how-to-deploy-models-serverless.md), [online endpoints](concept-endpoints-online.md), and [batch endpoints](concept-endpoints-batch.md). Serverless API endpoints and online endpoints are designed for real-time inference—when you invoke the endpoint, the results are returned in the endpoint's response. Serverless API endpoints don't consume quota from your subscription; rather they're billed with pay-as-you-go billing.
55
+
Azure Machine Learning allows you to implement [serverless API endpoints](how-to-deploy-models-serverless.md), [online endpoints](concept-endpoints-online.md), and [batch endpoints](concept-endpoints-batch.md).
56
56
57
-
Batch endpoints, on the other hand, are designed for long-running batch inference. Each time you invoke a batch endpoint you generate a batch job that performs the actual work.
57
+
_Serverless API endpoints_ and _online endpoints_ are designed for real-time inference. Whenever you invoke the endpoint, the results are returned in the endpoint's response. Serverless API endpoints don't consume quota from your subscription; rather, they're billed with pay-as-you-go billing.
58
+
59
+
_Batch endpoints_ are designed for long-running batch inference. Whenever you invoke a batch endpoint, you generate a batch job that performs the actual work.
58
60
59
61
### When to use serverless API, online, and batch endpoints
60
62
61
63
__Serverless API endpoints__:
62
64
63
-
Use [serverless API endpoints](how-to-deploy-models-serverless.md) to consume large foundational models for real-time inferencing off-the-shelf or for fine-tuning it such models. Not all models are available for deployment to serverless API endpoints. We recommend using this deployment mode when:
65
+
Use [serverless API endpoints](how-to-deploy-models-serverless.md) to consume large foundational models for real-time inferencing off-the-shelf or for fine-tuning such models. Not all models are available for deployment to serverless API endpoints. We recommend using this deployment mode when:
64
66
65
67
> [!div class="checklist"]
66
-
> * Your model is a foundational model, or a fine-tuned version of it is available for serverless API deployments.
68
+
> * Your model is a foundational model or a fine-tuned version of a foundational model that is available for serverless API deployments.
67
69
> * You can benefit from a quota-less deployment.
68
70
> * You don't need to customize the inferencing stack used to run the model.
69
71
@@ -72,7 +74,7 @@ __Online endpoints__:
72
74
Use [online endpoints](concept-endpoints-online.md) to operationalize models for real-time inference in synchronous low-latency requests. We recommend using them when:
73
75
74
76
> [!div class="checklist"]
75
-
> * Your model is a foundational model or a fine-tuned version of it, but it's not supported in serverless API endpoints.
77
+
> * Your model is a foundational model or a fine-tuned version of a foundational model, but it's not supported in serverless API endpoints.
76
78
> * You have low-latency requirements.
77
79
> * Your model can answer the request in a relatively short amount of time.
78
80
> * Your model's inputs fit on the HTTP payload of the request.
@@ -92,11 +94,11 @@ Use [batch endpoints](concept-endpoints-batch.md) to operationalize models or pi
92
94
93
95
### Comparison of serverless API, online, and batch endpoints
94
96
95
-
All serverless API, online, and batch endpoints are based on the idea of endpoints, which help you transition easily from one to the other. Online and batch endpoints also introduce the capability of managing multiple deployments for the same endpoint. The following section explains the different features of each deployment option:
97
+
All serverless API, online, and batch endpoints are based on the idea of endpoints, therefore, you can transition easily from one to the other. Online and batch endpoints are also capable of managing multiple deployments for the same endpoint.
96
98
97
99
#### Endpoints
98
100
99
-
The following table shows a summary of the different features available to serverless API, online, and batch endpoints.
101
+
The following table shows a summary of the different features available to serverless API, online, and batch endpoints at the endpoint level.
100
102
101
103
| Feature |[Serverless API endpoints](how-to-deploy-models-serverless.md)|[Online endpoints](concept-endpoints-online.md)|[Batch endpoints](concept-endpoints-batch.md)|
@@ -111,7 +113,7 @@ The following table shows a summary of the different features available to serve
111
113
| Customer-managed keys | NA | Yes | Yes |
112
114
| Cost basis | Per endpoint, per minute<sup>1</sup> | None | None |
113
115
114
-
<sup>1</sup>An small fraction is charged for serverless API endpoints per minute. See the [deployments](#deployments) section for the charges related to consumption, which are billed per token.
116
+
<sup>1</sup>A small fraction is charged for serverless API endpoints per minute. See the [deployments](#deployments) section for the charges related to consumption, which are billed per token.
115
117
116
118
117
119
#### Deployments
@@ -123,30 +125,30 @@ The following table shows a summary of the different features available to serve
| Cost basis<sup>4</sup> | Per tokens| Per deployment: compute instances running | Per job: compute instanced consumed in the job (capped to the maximum number of instances of the cluster).|
136
+
| Cost basis<sup>5</sup> | Per token| Per deployment: compute instances running | Per job: compute instanced consumed in the job (capped to the maximum number of instances of the cluster) |
135
137
| Local testing of deployments | No | Yes | No |
136
138
137
-
<sup>1</sup> Deploying MLflow models to endpoints without outbound internet connectivity or private networks requires [packaging the model](concept-package-models.md) first.
139
+
<sup>2</sup> Deploying MLflow models to endpoints without outbound internet connectivity or private networks requires [packaging the model](concept-package-models.md) first.
138
140
139
-
<sup>2</sup> *Inference server* refers to the serving technology that takes requests, processes them, and creates responses. The inference server also dictates the format of the input and the expected outputs.
141
+
<sup>3</sup> *Inference server* refers to the serving technology that takes requests, processes them, and creates responses. The inference server also dictates the format of the input and the expected outputs.
140
142
141
-
<sup>3</sup> *Autoscaling* is the ability to dynamically scale up or scale down the deployment's allocated resources based on its load. Online and batch deployments use different strategies for autoscaling. While online deployments scale up and down based on the resource utilization (like CPU, memory, requests, etc.), batch endpoints scale up or down based on the number of jobs created.
143
+
<sup>4</sup> *Autoscaling* is the ability to dynamically scale up or scale down the deployment's allocated resources based on its load. Online and batch deployments use different strategies for autoscaling. While online deployments scale up and down based on the resource utilization (like CPU, memory, requests, etc.), batch endpoints scale up or down based on the number of jobs created.
142
144
143
-
<sup>4</sup> Both online and batch deployments charge by the resources consumed. In online deployments, resources are provisioned at deployment time. However, in batch deployment, no resources are consumed at deployment time but when the job runs. Hence, there's no cost associated with the deployment itself. Notice that queued jobs don't consume resources either.
145
+
<sup>5</sup> Both online and batch deployments charge by the resources consumed. In online deployments, resources are provisioned at deployment time. In batch deployment, resources aren't consumed at deployment time but at the time that the job runs. Hence, there's no cost associated with the batch deployment itself. Likewise, queued jobs don't consume resources either.
144
146
145
147
## Developer interfaces
146
148
147
-
Endpoints are designed to help organizations operationalize production-level workloads in Azure Machine Learning. Endpoints are robust and scalable resources and they provide the best of the capabilities to implement MLOps workflows.
149
+
Endpoints are designed to help organizations operationalize production-level workloads in Azure Machine Learning. Endpoints are robust and scalable resources, and they provide the best capabilities to implement MLOps workflows.
148
150
149
-
You can create and manage batch and online endpoints with multiple developer tools:
151
+
You can create and manage batch and online endpoints with several developer tools:
150
152
151
153
- The Azure CLI and the Python SDK
152
154
- Azure Resource Manager/REST API
@@ -155,11 +157,9 @@ You can create and manage batch and online endpoints with multiple developer too
155
157
- Support for CI/CD MLOps pipelines using the Azure CLI interface & REST/ARM interfaces
156
158
157
159
158
-
## Next steps
160
+
## Related content
159
161
160
-
-[How to deploy online endpoints with the Azure CLI and Python SDK](how-to-deploy-online-endpoints.md)
161
-
-[How to deploy models with batch endpoints](how-to-use-batch-model-deployments.md)
162
+
-[Deploy and score a machine learning model by using an online endpoint](how-to-deploy-online-endpoints.md)
163
+
-[Deploy models for scoring in batch endpoints](how-to-use-batch-model-deployments.md)
162
164
-[How to deploy pipelines with batch endpoints](how-to-use-batch-pipeline-deployments.md)
163
-
-[How to use online endpoints with the studio](how-to-use-managed-online-endpoint-studio.md)
164
-
-[How to monitor managed online endpoints](how-to-monitor-online-endpoints.md)
165
-
-[Manage and increase quotas for resources with Azure Machine Learning](how-to-manage-quotas.md#azure-machine-learning-online-endpoints-and-batch-endpoints)
165
+
-[How to monitor managed online endpoints](how-to-monitor-online-endpoints.md)
0 commit comments