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 3 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"]
191 changes: 191 additions & 0 deletions assets/common/components/batch_deploy_model/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
$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 ${{inputs.registration_details}}]]
$[[--model_id ${{inputs.model_id}}]]
$[[--inference_payload ${{inputs.inference_payload}}]]
$[[--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}}]]
--model_deployment_details ${{outputs.model_deployment_details}}

inputs:
# Output of registering component
registration_details:
type: uri_file
optional: true
description: Json file that contains the ID of registered model to be deployed

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

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 instances of the compute cluster
tanmaybansal104 marked this conversation as resolved.
Show resolved Hide resolved

max_instances:
type: integer
optional: true
default: 3
description: Maximum instances of the compute cluster

idle_time_before_scale_down:
type: integer
optional: true
default: 120
description: Idle time before scale down of the compute cluster

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

max_concurrency_per_instance:
type: integer
optional: true
default: 1
description: Maximum number of parallelism per instance

error_threshold:
type: integer
optional: true
default: -1
description: Error threshold before batch inference is aborted

max_retries:
type: integer
optional: true
default: 3
description: Number of retries in failure

timeout:
type: integer
optional: true
default: 30
description: Timeout in seconds

logging_level:
type: string
optional: true
default: info
description: Logging level for batch inference operation

mini_batch_size:
type: integer
optional: true
default: 10
description: Size of the mini-batch passed to each batch invocation

instance_count:
type: integer
optional: true
default: 1
description: Number of compute instances to deploy model

outputs:
model_deployment_details:
type: uri_file
description: Json file to which deployment details will be written

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