View a markdown version of this page

AWS::SageMaker::OptimizationJob - AWS CloudFormation

This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.

AWS::SageMaker::OptimizationJob

Creates a job that optimizes a model for inference performance. To create the job, you provide the location of a source model, and you provide the settings for the optimization techniques that you want the job to apply. When the job completes successfully, SageMaker uploads the new optimized model to the output destination that you specify.

For more information about how to use this action, and about the supported optimization techniques, see Optimize model inference with Amazon SageMaker.

Syntax

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

JSON

{ "Type" : "AWS::SageMaker::OptimizationJob", "Properties" : { "DeploymentInstanceType" : String, "ModelSource" : OptimizationJobModelSource, "OptimizationConfigs" : [ OptimizationConfig, ... ], "OptimizationEnvironment" : {Key: Value, ...}, "OptimizationJobName" : String, "OutputConfig" : OptimizationJobOutputConfig, "RoleArn" : String, "StoppingCondition" : StoppingCondition, "Tags" : [ Tag, ... ], "VpcConfig" : OptimizationVpcConfig } }

Properties

DeploymentInstanceType

The type of instance that hosts the optimized model that you create with the optimization job.

Required: Yes

Type: String

Allowed values: ml.p4d.24xlarge | ml.p4de.24xlarge | ml.p5.48xlarge | ml.p5e.48xlarge | ml.p5en.48xlarge | ml.g4dn.xlarge | ml.g4dn.2xlarge | ml.g4dn.4xlarge | ml.g4dn.8xlarge | ml.g4dn.12xlarge | ml.g4dn.16xlarge | ml.g5.xlarge | ml.g5.2xlarge | ml.g5.4xlarge | ml.g5.8xlarge | ml.g5.12xlarge | ml.g5.16xlarge | ml.g5.24xlarge | ml.g5.48xlarge | ml.g6.xlarge | ml.g6.2xlarge | ml.g6.4xlarge | ml.g6.8xlarge | ml.g6.12xlarge | ml.g6.16xlarge | ml.g6.24xlarge | ml.g6.48xlarge | ml.g6e.xlarge | ml.g6e.2xlarge | ml.g6e.4xlarge | ml.g6e.8xlarge | ml.g6e.12xlarge | ml.g6e.16xlarge | ml.g6e.24xlarge | ml.g6e.48xlarge | ml.inf2.xlarge | ml.inf2.8xlarge | ml.inf2.24xlarge | ml.inf2.48xlarge | ml.trn1.2xlarge | ml.trn1.32xlarge | ml.trn1n.32xlarge | ml.p6-b200.48xlarge | ml.g7e.2xlarge | ml.g7e.4xlarge | ml.g7e.8xlarge | ml.g7e.12xlarge | ml.g7e.24xlarge | ml.g7e.48xlarge

Update requires: Replacement

ModelSource

Property description not available.

Required: Yes

Type: OptimizationJobModelSource

Update requires: Replacement

OptimizationConfigs

Property description not available.

Required: Yes

Type: Array of OptimizationConfig

Maximum: 10

Update requires: Replacement

OptimizationEnvironment

Property description not available.

Required: No

Type: Object of String

Pattern: .+

Maximum: 1024

Update requires: Replacement

OptimizationJobName

The name that you assigned to the optimization job.

Required: Yes

Type: String

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}$

Minimum: 1

Maximum: 63

Update requires: Replacement

OutputConfig

Contains information about the output location for the compiled model and the target device that the model runs on. TargetDevice and TargetPlatform are mutually exclusive, so you need to choose one between the two to specify your target device or platform. If you cannot find your device you want to use from the TargetDevice list, use TargetPlatform to describe the platform of your edge device and CompilerOptions if there are specific settings that are required or recommended to use for particular TargetPlatform.

Required: Yes

Type: OptimizationJobOutputConfig

Update requires: Replacement

RoleArn

Property description not available.

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

StoppingCondition

Specifies a limit to how long a job can run. When the job reaches the time limit, SageMaker ends the job. Use this API to cap costs.

To stop a training job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

The training algorithms provided by SageMaker automatically save the intermediate results of a model training job when possible. This attempt to save artifacts is only a best effort case as model might not be in a state from which it can be saved. For example, if training has just started, the model might not be ready to save. When saved, this intermediate data is a valid model artifact. You can use it to create a model with CreateModel.

Note

The Neural Topic Model (NTM) currently does not support saving intermediate model artifacts. When training NTMs, make sure that the maximum runtime is sufficient for the training job to complete.

Required: Yes

Type: StoppingCondition

Update requires: Replacement

Tags

Property description not available.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: Replacement

VpcConfig

Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see Give SageMaker Access to Resources in your Amazon VPC.

Required: No

Type: OptimizationVpcConfig

Update requires: Replacement

Return values

Ref

Fn::GetAtt

CreationTime

The time when you created the optimization job.

LastModifiedTime

The time when the optimization job was last updated.

OptimizationJobArn

The Amazon Resource Name (ARN) of the optimization job.

OptimizationJobStatus

The current status of the optimization job.