Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch component added for deployment and inference #859

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ab3da8a
Batch component added for deployment and inderence
tanmaybansal104 Jul 10, 2023
b44633a
Removed Sytax check errors
tanmaybansal104 Jul 10, 2023
dc4bc5e
Removed Sytax check errors
tanmaybansal104 Jul 10, 2023
5b5b099
Changed OnlineEndpointInvocationError to BatchEndpointInvocationError
tanmaybansal104 Jul 10, 2023
5f4b3a1
Removed Sytax check errors
tanmaybansal104 Jul 10, 2023
a5e8d4a
Updated descriptions and default values. Added compute cluster check.
tanmaybansal104 Jul 12, 2023
8d4693c
Removed syntax check errors
tanmaybansal104 Jul 12, 2023
f099a21
Modularized the compute cluster creation and updated the descriptions
tanmaybansal104 Jul 14, 2023
9b950d0
Defined default constant values for batch component
tanmaybansal104 Jul 18, 2023
529294b
Added file and folder inference for batch component
tanmaybansal104 Jul 20, 2023
22e14f2
Modularized invoke_endpoint_job for batch component
tanmaybansal104 Jul 20, 2023
aae4b23
Fixed file path for batch component
tanmaybansal104 Jul 20, 2023
c82bf1e
Merged main into the branch
tanmaybansal104 Jul 21, 2023
f3d76a3
Changed registration file to folder for batch model deploy
tanmaybansal104 Jul 21, 2023
eb58960
Fixed syntax checks for batch deploy component
tanmaybansal104 Jul 21, 2023
05a8fec
Fixed syntax checks for batch deploy component
tanmaybansal104 Jul 21, 2023
121adda
Added batch job output folder
tanmaybansal104 Jul 24, 2023
c835413
Removed Syntax check errors
tanmaybansal104 Jul 24, 2023
022d239
Changed file path for batch deploy component
tanmaybansal104 Jul 24, 2023
3ca64b6
Changed the file structure for batch component output download
tanmaybansal104 Jul 25, 2023
de60196
Removed Syntax check errors
tanmaybansal104 Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/common/components/batch_deploy_model/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: component
spec: spec.yaml
categories: ["Models"]
197 changes: 197 additions & 0 deletions assets/common/components/batch_deploy_model/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json
name: batch_deploy_model
version: 0.0.1
type: command

is_deterministic: True

display_name: Batch deploy model
description:
Batch deploy a model to a workspace. The component works on compute with [MSI](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-create-manage-compute-instance?tabs=python) attached.

environment: azureml://registries/azureml/environments/python-sdk-v2/versions/6

code: ../../src
command: >-
python batch_deploy.py
$[[--registration_details_folder ${{inputs.registration_details_folder}}]]
$[[--model_id ${{inputs.model_id}}]]
$[[--inference_payload_file ${{inputs.inference_payload_file}}]]
$[[--inference_payload_folder ${{inputs.inference_payload_folder}}]]
$[[--endpoint_name ${{inputs.endpoint_name}}]]
$[[--deployment_name ${{inputs.deployment_name}}]]
$[[--compute_name ${{inputs.compute_name}}]]
$[[--size ${{inputs.size}}]]
$[[--min_instances ${{inputs.min_instances}}]]
$[[--max_instances ${{inputs.max_instances}}]]
$[[--idle_time_before_scale_down ${{inputs.idle_time_before_scale_down}}]]
$[[--output_file_name ${{inputs.output_file_name}}]]
$[[--max_concurrency_per_instance ${{inputs.max_concurrency_per_instance}}]]
$[[--error_threshold ${{inputs.error_threshold}}]]
$[[--max_retries ${{inputs.max_retries}}]]
$[[--timeout ${{inputs.timeout}}]]
$[[--logging_level ${{inputs.logging_level}}]]
$[[--mini_batch_size ${{inputs.mini_batch_size}}]]
$[[--instance_count ${{inputs.instance_count}}]]
--batch_job_output_folder ${{outputs.batch_job_output_folder}}

inputs:
# Output of registering component
registration_details_folder:
type: uri_folder
optional: true
description: Folder containing model registration details in a JSON file named model_registration_details.json

model_id:
type: string
optional: true
description: |
Asset ID of the model registered in workspace/registry.
Registry - azureml://registries/<registry-name>/models/<model-name>/versions/<version>
Workspace - azureml:<model-name>:<version>

inference_payload_file:
type: uri_file
optional: true
description: File containing data used to validate deployment

inference_payload_folder:
type: uri_folder
optional: true
description: Folder containing files used to validate deployment

endpoint_name:
type: string
optional: true
description: Name of the endpoint

deployment_name:
type: string
optional: true
default: default
description: Name of the deployment

compute_name:
tanmaybansal104 marked this conversation as resolved.
Show resolved Hide resolved
type: string
optional: true
default: cpu-cluster
description: Name of the compute cluster to execute the batch scoring jobs on. New compute will be created if the compute cluster is not present.

size:
tanmaybansal104 marked this conversation as resolved.
Show resolved Hide resolved
type: string
optional: true
enum:
- Standard_DS1_v2
- Standard_DS2_v2
- Standard_DS3_v2
- Standard_DS4_v2
- Standard_DS5_v2
- Standard_F2s_v2
- Standard_F4s_v2
- Standard_F8s_v2
- Standard_F16s_v2
- Standard_F32s_v2
- Standard_F48s_v2
- Standard_F64s_v2
- Standard_F72s_v2
- Standard_FX24mds
- Standard_FX36mds
- Standard_FX48mds
- Standard_E2s_v3
- Standard_E4s_v3
- Standard_E8s_v3
- Standard_E16s_v3
- Standard_E32s_v3
- Standard_E48s_v3
- Standard_E64s_v3
- Standard_NC4as_T4_v3
- Standard_NC6s_v2
- Standard_NC6s_v3
- Standard_NC8as_T4_v3
- Standard_NC12s_v2
- Standard_NC12s_v3
- Standard_NC16as_T4_v3
- Standard_NC24s_v2
- Standard_NC24s_v3
- Standard_NC24rs_v3
- Standard_NC64as_T4_v3
- Standard_ND40rs_v2
- Standard_ND96asr_v4
- Standard_ND96amsr_A100_v4
default: Standard_NC24s_v3
description: Compute instance size to deploy model. Make sure that instance type is available and have enough quota available.

min_instances:
type: integer
optional: true
default: 0
description: Minimum number of instances of the compute cluster to be created.

max_instances:
type: integer
optional: true
default: 1
description: Maximum number of instances of the compute cluster to be created.

idle_time_before_scale_down:
type: integer
optional: true
default: 120
description: Node Idle Time before scaling down the compute cluster to be created.

output_file_name:
type: string
optional: true
default: predictions.csv
description: Name of the batch scoring output file.

max_concurrency_per_instance:
type: integer
optional: true
default: 1
description: The maximum number of parallel scoring_script runs per instance.

error_threshold:
type: integer
optional: true
default: -1
description: The number of file failures that should be ignored.

max_retries:
type: integer
optional: true
default: 3
description: The maximum number of retries for a failed or timed-out mini batch.

timeout:
type: integer
optional: true
default: 500
description: The timeout in seconds for scoring a single mini batch.

logging_level:
type: string
optional: true
default: info
description: The log verbosity level.

mini_batch_size:
type: integer
optional: true
default: 10
description: The number of files the code_configuration.scoring_script can process in one run() call.

instance_count:
type: integer
optional: true
default: 1
description: The number of nodes to use for each batch scoring job.
tanmaybansal104 marked this conversation as resolved.
Show resolved Hide resolved

outputs:
batch_job_output_folder:
type: uri_folder
description: Folder to which batch job outputs will be saved.

tags:
Preview: ""
Internal: ""
Loading
Loading