AWS::SageMaker::InferenceExperiment - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::SageMaker::InferenceExperiment

Creates an inference experiment using the configurations specified in the request.

Use this API to setup and schedule an experiment to compare model variants on a Amazon SageMaker inference endpoint. For more information about inference experiments, see Shadow tests.

Amazon SageMaker begins your experiment at the scheduled time and routes traffic to your endpoint's model variants based on your specified configuration.

While the experiment is in progress or after it has concluded, you can view metrics that compare your model variants. For more information, see View, monitor, and edit shadow tests.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::SageMaker::InferenceExperiment", "Properties" : { "DataStorageConfig" : DataStorageConfig, "Description" : String, "DesiredState" : String, "EndpointName" : String, "KmsKey" : String, "ModelVariants" : [ ModelVariantConfig, ... ], "Name" : String, "RoleArn" : String, "Schedule" : InferenceExperimentSchedule, "ShadowModeConfig" : ShadowModeConfig, "StatusReason" : String, "Tags" : [ Tag, ... ], "Type" : String } }

YAML

Type: AWS::SageMaker::InferenceExperiment Properties: DataStorageConfig: DataStorageConfig Description: String DesiredState: String EndpointName: String KmsKey: String ModelVariants: - ModelVariantConfig Name: String RoleArn: String Schedule: InferenceExperimentSchedule ShadowModeConfig: ShadowModeConfig StatusReason: String Tags: - Tag Type: String

Properties

DataStorageConfig

The Amazon S3 location and configuration for storing inference request and response data.

Required: No

Type: DataStorageConfig

Update requires: No interruption

Description

The description of the inference experiment.

Required: No

Type: String

Pattern: .*

Minimum: 1

Maximum: 1024

Update requires: No interruption

DesiredState

The desired state of the experiment after stopping. The possible states are the following:

  • Completed: The experiment completed successfully

  • Cancelled: The experiment was canceled

Required: No

Type: String

Allowed values: Running | Completed | Cancelled

Update requires: No interruption

EndpointName

The name of the endpoint.

Required: Yes

Type: String

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*

Maximum: 63

Update requires: Replacement

KmsKey

The Amazon Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.

Required: No

Type: String

Pattern: .*

Maximum: 2048

Update requires: Replacement

ModelVariants

An array of ModelVariantConfigSummary objects. There is one for each variant in the inference experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure configuration for deploying the corresponding variant.

Required: Yes

Type: Array of ModelVariantConfig

Maximum: 2

Update requires: No interruption

Name

The name of the inference experiment.

Required: Yes

Type: String

Minimum: 1

Maximum: 120

Update requires: Replacement

RoleArn

The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.

Required: Yes

Type: String

Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

Minimum: 20

Maximum: 2048

Update requires: Replacement

Schedule

The duration for which the inference experiment ran or will run.

The maximum duration that you can set for an inference experiment is 30 days.

Required: No

Type: InferenceExperimentSchedule

Update requires: No interruption

ShadowModeConfig

The configuration of ShadowMode inference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.

Required: No

Type: ShadowModeConfig

Update requires: No interruption

StatusReason

The error message for the inference experiment status result.

Required: No

Type: String

Pattern: .*

Minimum: 1

Maximum: 1024

Update requires: No interruption

Tags

An array of key-value pairs to apply to this resource.

For more information, see Tag.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption

Type

The type of the inference experiment.

Required: Yes

Type: String

Allowed values: ShadowMode

Update requires: Replacement

Return values

Ref


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the inference experiment.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The ARN for your inference experiment.

CreationTime

The timestamp at which the inference experiment was created.

LastModifiedTime

The timestamp at which you last modified the inference experiment.

Status

The status of the inference experiment. The following are the possible statuses for an inference experiment:

  • Creating - Amazon SageMaker is creating your experiment.

  • Created - Amazon SageMaker has finished the creation of your experiment and will begin the experiment at the scheduled time.

  • Updating - When you make changes to your experiment, your experiment shows as updating.

  • Starting - Amazon SageMaker is beginning your experiment.

  • Running - Your experiment is in progress.

  • Stopping - Amazon SageMaker is stopping your experiment.

  • Completed - Your experiment has completed.

  • Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled.