View a markdown version of this page

AWS::SageMaker::TrainingJob - 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::TrainingJob

Contains information about a training job.

Syntax

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

Properties

AlgorithmSpecification

Information about the algorithm used for training, and algorithm metadata.

Required: Yes

Type: AlgorithmSpecification

Update requires: Replacement

CheckpointConfig

Contains information about the output location for managed spot training checkpoint data.

Required: No

Type: CheckpointConfig

Update requires: Replacement

DebugHookConfig

Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the DebugHookConfig parameter, see Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job.

Required: No

Type: DebugHookConfig

Update requires: Replacement

DebugRuleConfigurations

Information about the debug rule configuration.

Required: No

Type: Array of DebugRuleConfiguration

Maximum: 20

Update requires: Replacement

EnableInterContainerTrafficEncryption

To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.

Required: No

Type: Boolean

Update requires: Replacement

EnableManagedSpotTraining

When true, enables managed spot training using Amazon EC2 Spot instances to run training jobs instead of on-demand instances. For more information, see Managed Spot Training.

Required: No

Type: Boolean

Update requires: Replacement

EnableNetworkIsolation

If the TrainingJob was created with network isolation, the value is set to true. If network isolation is enabled, nodes can't communicate beyond the VPC they run in.

Required: No

Type: Boolean

Update requires: Replacement

Environment

The environment variables to set in the Docker container.

Required: No

Type: Object of String

Pattern: .*

Maximum: 512

Update requires: Replacement

ExperimentConfig

Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:

Required: No

Type: ExperimentConfig

Update requires: Replacement

HyperParameters

Algorithm-specific parameters.

Required: No

Type: Object of String

Pattern: .*

Maximum: 2500

Update requires: Replacement

InfraCheckConfig

Configuration information for the infrastructure health check of a training job. A SageMaker-provided health check tests the health of instance hardware and cluster network connectivity.

Required: No

Type: InfraCheckConfig

Update requires: Replacement

InputDataConfig

An array of Channel objects that describes each data input channel.

Your input must be in the same AWS region as your training job.

Required: No

Type: Array of Channel

Maximum: 20

Update requires: Replacement

OutputDataConfig

The S3 path where model artifacts that you configured when creating the job are stored. SageMaker creates subfolders for model artifacts.

Required: Yes

Type: OutputDataConfig

Update requires: Replacement

ProfilerConfig

Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.

Required: No

Type: ProfilerConfig

Update requires: Replacement

ProfilerRuleConfigurations

Property description not available.

Required: No

Type: Array of ProfilerRuleConfiguration

Maximum: 20

Update requires: Replacement

RemoteDebugConfig

Configuration for remote debugging for the CreateTrainingJob API. To learn more about the remote debugging functionality of SageMaker, see Access a training container through AWS Systems Manager (SSM) for remote debugging.

Required: No

Type: RemoteDebugConfig

Update requires: Replacement

ResourceConfig

Resources, including ML compute instances and ML storage volumes, that are configured for model training.

Required: Yes

Type: ResourceConfig

Update requires: Replacement

RetryStrategy

The number of times to retry the job when the job fails due to an InternalServerError.

Required: No

Type: RetryStrategy

Update requires: Replacement

RoleArn

The AWS Identity and Access Management (IAM) role configured for the training job.

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 model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.

To stop a 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.

Required: Yes

Type: StoppingCondition

Update requires: Replacement

Tags

An array of key-value pairs. You can use tags to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging AWS Resources.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: Replacement

TensorBoardOutputConfig

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

Type: TensorBoardOutputConfig

Update requires: Replacement

TrainingJobName

The name of the training job.

Required: Yes

Type: String

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

Minimum: 1

Maximum: 63

Update requires: Replacement

VpcConfig

A VpcConfig object that specifies the VPC that this training job has access to. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

Required: No

Type: VpcConfig

Update requires: Replacement

Return values

Ref

Fn::GetAtt

BillableTimeInSeconds

The billable time in seconds.

CreationTime

A timestamp that indicates when the training job was created.

LastModifiedTime

A timestamp that indicates when the status of the training job was last modified.

ProfilingStatus

Property description not available.

SecondaryStatus

Provides detailed information about the state of the training job. For detailed information about the secondary status of the training job, see StatusMessage under SecondaryStatusTransition.

SageMaker provides primary statuses and secondary statuses that apply to each of them:

InProgress
  • Starting - Starting the training job.

  • Downloading - An optional stage for algorithms that support File training input mode. It indicates that data is being downloaded to the ML storage volumes.

  • Training - Training is in progress.

  • Uploading - Training is complete and the model artifacts are being uploaded to the S3 location.

Completed
  • Completed - The training job has completed.

Failed
  • Failed - The training job has failed. The reason for the failure is returned in the FailureReason field of DescribeTrainingJobResponse.

Stopped
  • MaxRuntimeExceeded - The job stopped because it exceeded the maximum allowed runtime.

  • Stopped - The training job has stopped.

Stopping
  • Stopping - Stopping the training job.

Important

Valid values for SecondaryStatus are subject to change.

We no longer support the following secondary statuses:

  • LaunchingMLInstances

  • PreparingTrainingStack

  • DownloadingTrainingImage

SecondaryStatusTransitions

A history of all of the secondary statuses that the training job has transitioned through.

TrainingJobArn

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

TrainingJobStatus

The status of the training job.

Training job statuses are:

  • InProgress - The training is in progress.

  • Completed - The training job has completed.

  • Failed - The training job has failed. To see the reason for the failure, see the FailureReason field in the response to a DescribeTrainingJobResponse call.

  • Stopping - The training job is stopping.

  • Stopped - The training job has stopped.

For more detailed information, see SecondaryStatus.

TrainingTimeInSeconds

The training time in seconds.