inference_experiments
Creates, updates, deletes or gets an inference_experiment resource or lists inference_experiments in a region
Overview
| Name | inference_experiments |
| Type | Resource |
| Description | Resource Type definition for AWS::SageMaker::InferenceExperiment |
| Id | awscc.sagemaker.inference_experiments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the inference experiment. |
name | string | The name for the inference experiment. |
type | string | The type of the inference experiment that you want to run. |
description | string | The description of the inference experiment. |
role_arn | string | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment. |
endpoint_name | string | The name of the endpoint used to run the monitoring job. |
endpoint_metadata | object | The metadata of the endpoint on which the inference experiment ran. |
schedule | object | The duration for which you want the inference experiment to run. |
kms_key | string | The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. |
data_storage_config | object | The Amazon S3 location and configuration for storing inference request and response data. |
model_variants | array | An array of ModelVariantConfig objects. Each ModelVariantConfig object in the array describes the infrastructure configuration for the corresponding variant. |
shadow_mode_config | object | The configuration of ShadowMode inference experiment type. Use this field to specify a production variant which takes all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant also specify the percentage of requests that Amazon SageMaker replicates. |
tags | array | An array of key-value pairs to apply to this resource. |
creation_time | string | The timestamp at which you created the inference experiment. |
last_modified_time | string | The timestamp at which you last modified the inference experiment. |
status | string | The status of the inference experiment. |
status_reason | string | The error message or client-specified reason from the StopInferenceExperiment API, that explains the status of the inference experiment. |
desired_state | string | The desired state of the experiment after starting or stopping operation. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name for the inference experiment. |
region | string | AWS region. |
For more information, see AWS::SageMaker::InferenceExperiment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | inference_experiments | INSERT | Name, Type, RoleArn, EndpointName, ModelVariants, region |
delete_resource | inference_experiments | DELETE | Identifier, region |
update_resource | inference_experiments | UPDATE | Identifier, PatchDocument, region |
list_resources | inference_experiments_list_only | SELECT | region |
get_resource | inference_experiments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual inference_experiment.
SELECT
region,
arn,
name,
type,
description,
role_arn,
endpoint_name,
endpoint_metadata,
schedule,
kms_key,
data_storage_config,
model_variants,
shadow_mode_config,
tags,
creation_time,
last_modified_time,
status,
status_reason,
desired_state
FROM awscc.sagemaker.inference_experiments
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}';
Lists all inference_experiments in a region.
SELECT
region,
name
FROM awscc.sagemaker.inference_experiments_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new inference_experiment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.sagemaker.inference_experiments (
Name,
Type,
RoleArn,
EndpointName,
ModelVariants,
region
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ role_arn }}',
'{{ endpoint_name }}',
'{{ model_variants }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.sagemaker.inference_experiments (
Name,
Type,
Description,
RoleArn,
EndpointName,
Schedule,
KmsKey,
DataStorageConfig,
ModelVariants,
ShadowModeConfig,
Tags,
StatusReason,
DesiredState,
region
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ description }}',
'{{ role_arn }}',
'{{ endpoint_name }}',
'{{ schedule }}',
'{{ kms_key }}',
'{{ data_storage_config }}',
'{{ model_variants }}',
'{{ shadow_mode_config }}',
'{{ tags }}',
'{{ status_reason }}',
'{{ desired_state }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: inference_experiment
props:
- name: name
value: '{{ name }}'
- name: type
value: '{{ type }}'
- name: description
value: '{{ description }}'
- name: role_arn
value: '{{ role_arn }}'
- name: endpoint_name
value: '{{ endpoint_name }}'
- name: schedule
value:
start_time: '{{ start_time }}'
end_time: '{{ end_time }}'
- name: kms_key
value: '{{ kms_key }}'
- name: data_storage_config
value:
destination: '{{ destination }}'
kms_key: '{{ kms_key }}'
content_type:
csv_content_types:
- '{{ csv_content_types[0] }}'
json_content_types:
- '{{ json_content_types[0] }}'
- name: model_variants
value:
- model_name: '{{ model_name }}'
variant_name: '{{ variant_name }}'
infrastructure_config:
infrastructure_type: '{{ infrastructure_type }}'
real_time_inference_config:
instance_type: '{{ instance_type }}'
instance_count: '{{ instance_count }}'
- name: shadow_mode_config
value:
source_model_variant_name: '{{ source_model_variant_name }}'
shadow_model_variants:
- shadow_model_variant_name: '{{ shadow_model_variant_name }}'
sampling_percentage: '{{ sampling_percentage }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: status_reason
value: '{{ status_reason }}'
- name: desired_state
value: '{{ desired_state }}'
UPDATE example
Use the following StackQL query and manifest file to update a inference_experiment resource, using stack-deploy.
/*+ update */
UPDATE awscc.sagemaker.inference_experiments
SET PatchDocument = string('{{ {
"Description": description,
"Schedule": schedule,
"DataStorageConfig": data_storage_config,
"ModelVariants": model_variants,
"ShadowModeConfig": shadow_mode_config,
"Tags": tags,
"StatusReason": status_reason,
"DesiredState": desired_state
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.sagemaker.inference_experiments
WHERE
Identifier = '{{ name }}' AND
region = 'us-east-1';
Permissions
To operate on the inference_experiments resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
sagemaker:CreateInferenceExperiment,
sagemaker:DescribeInferenceExperiment,
sagemaker:AddTags,
sagemaker:ListTags,
iam:PassRole
sagemaker:DeleteInferenceExperiment,
sagemaker:DescribeInferenceExperiment,
sagemaker:StopInferenceExperiment,
sagemaker:ListTags
sagemaker:ListInferenceExperiments
sagemaker:DescribeInferenceExperiment,
sagemaker:ListTags
sagemaker:UpdateInferenceExperiment,
sagemaker:StartInferenceExperiment,
sagemaker:StopInferenceExperiment,
sagemaker:DescribeInferenceExperiment,
sagemaker:AddTags,
sagemaker:DeleteTags,
sagemaker:ListTags