Path6.Mod2.a - Deploy and Consume Models - Batch Endpoints Flashcards
When to use Batch Endpoints
With long-running tasks that deal with large amounts of data performed through batch operations.
Batch Inferencing
ML uses Batch Inferencing to asynchronously apply a predictive model to multiple cases (like async batch scoring), then persists the results to file or DB or some other datastore connected to your ML Workspace.
BSJ CC m_i
Batch Endpoints
- When invoked creates this kind of Job
- The Job requires this kind of Compute
- For new data in parallel batches, the Compute has to have more than one
- When the Endpoint is invoked, it submits a Batch Scoring Job for execution
- Batch Scoring Jobs require a Compute Cluster for scoring multiple inputs
- The Compute Cluster requires a
max_instances
value greater than 1
Create an instance of the BatchEndpoint
class
Straightforward and pretty simple:
endpoint = BatchEndpoint( name="endpoint-example", description="A batch endpoint", ) ml_client.batch_endpoints.begin_create_or_update(endpoint)
The Batch Endpoint name does NOT have to be unique per Region, but must be unique per Workspace (T/F)
False. The name must always be unique per Region
A BatchEndpoint instance must be created first, before Deployments are added to it (T/F)
True
You can deploy multiple Models to a BatchEndpoint (T/F)
True
The type of Deployment the Batch Scoring Job uses, unless otherwise specified and how to trigger the Deployment
It uses the default deployment. Triggered by hitting the batch endpoint.
Upon viewing the Scoring Job’s details, you’ll see under Deployment Summary the deployment details:
Create an instance of an AmlComputer
class for a Compute Cluster that will support Batch Endpoints
from azure.ai.ml.entities import AmlCompute cpucluster = AmlCompute( name="aml-cluster", type="amlcompute", size="STANDARDDS11V2", mininstances=0, maxinstances=4, // main thing is to specify more than one max instances idletimebeforescaledown=120, tier="Dedicated", ) cpucluster = mlclient.compute.begin_create_or_update(cpucluster)
The advantage of using a Compute Cluster for running the Scoring Script
You can run the Score Script on separate instances in parallel.