Path6.Mod2.a - Deploy and Consume Models - Batch Endpoint Deployment Flashcards

1
Q

Same as Managed Endpoint Deployments…

W.r.t. Batch Endpoint Deployments, using this makes it easy and why it does…

A

Use MLFlow ; it automatically generates your Scoring Script and Environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Like all usage of MLFlow models…

This specific action must happen to an MLFlow Model before it can be deployed to a Batch Endpoint

A

It has to be registered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Just like MLTable…

This specific file must be included in the Model’s location for registration, before it can be deployed to a Batch Endpoint

A

To register, the folder location of the MLFlow Model file must also have the MLModel file (which describes how to load and use the Model).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create an instance of the Model class (required to register the Model in MFLow)

A
from azure.ai.ml.entities import Model
from azure.ai.ml.constants import AssetTypes

model_instance = Model(
name= 'mlflow-model',
		path='./model',
		type=AssetTypes.MLFLOW_MODEL)
model = ml_client.models.create_or_update(model_instance)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ic mcpi mbs oa (SO AR) ofn rs (BRS)

BatchDeployment class: key behavior-controlling parameters

A
  • instance_count: count of compute nodes to use
  • max_concurrency_per_instance: max number of parallel Scoring Scripts runs per compute node
  • mini_batch_size: number of files passed per Scoring Script run
  • output_action: what to do with predictions:
    BatchDeploymentOutputAction.SUMMARY_ONLY
    BatchDeploymentOutputAction.APPEND_ROW
  • output_file_name: file to append predictions to, if you selected BatchDeploymentOutputAction.APPEND_ROW above, otherwise ignored
  • retry_settings: uses a BatchRetrySettings instance with params max_retries & timeout
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Near identical to ManagedOnlineDeployment

Create an instance of the BatchDeployment class, noting all the parameters

A
from azure.ai.ml.entities import BatchDeployment, BatchRetrySettings
from azure.ai.ml.constants import BatchDeploymentOutputAction

deployment = BatchDeployment(
    name="forecast-mlflow",
    description="A sales forecaster",
    endpoint_name=endpoint.name,
    model=model,
    compute="aml-cluster",
    instance_count=2,
    max_concurrency_per_instance=2,
    mini_batch_size=2,
    output_action=BatchDeploymentOutputAction.APPEND_ROW,
    output_file_name="predictions.csv",
    retry_settings=BatchRetrySettings(max_retries=3, timeout=300),
    logging_level="info",
)
ml_client.batch_deployments.begin_create_or_update(deployment)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly