DescribeTrainingJob - Amazon SageMaker
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.

DescribeTrainingJob

Returns information about a training job.

Some of the attributes below only appear if the training job successfully starts. If the training job fails, TrainingJobStatus is Failed and, depending on the FailureReason, attributes like TrainingStartTime, TrainingTimeInSeconds, TrainingEndTime, and BillableTimeInSeconds may not be present in the response.

Request Syntax

{ "TrainingJobName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

TrainingJobName

The name of the training job.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 63.

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

Required: Yes

Response Syntax

{ "AlgorithmSpecification": { "AlgorithmName": "string", "EnableSageMakerMetricsTimeSeries": boolean, "MetricDefinitions": [ { "Name": "string", "Regex": "string" } ], "TrainingImage": "string", "TrainingInputMode": "string" }, "AutoMLJobArn": "string", "BillableTimeInSeconds": number, "CheckpointConfig": { "LocalPath": "string", "S3Uri": "string" }, "CreationTime": number, "DebugHookConfig": { "CollectionConfigurations": [ { "CollectionName": "string", "CollectionParameters": { "string" : "string" } } ], "HookParameters": { "string" : "string" }, "LocalPath": "string", "S3OutputPath": "string" }, "DebugRuleConfigurations": [ { "InstanceType": "string", "LocalPath": "string", "RuleConfigurationName": "string", "RuleEvaluatorImage": "string", "RuleParameters": { "string" : "string" }, "S3OutputPath": "string", "VolumeSizeInGB": number } ], "DebugRuleEvaluationStatuses": [ { "LastModifiedTime": number, "RuleConfigurationName": "string", "RuleEvaluationJobArn": "string", "RuleEvaluationStatus": "string", "StatusDetails": "string" } ], "EnableInterContainerTrafficEncryption": boolean, "EnableManagedSpotTraining": boolean, "EnableNetworkIsolation": boolean, "Environment": { "string" : "string" }, "ExperimentConfig": { "ExperimentName": "string", "TrialComponentDisplayName": "string", "TrialName": "string" }, "FailureReason": "string", "FinalMetricDataList": [ { "MetricName": "string", "Timestamp": number, "Value": number } ], "HyperParameters": { "string" : "string" }, "InputDataConfig": [ { "ChannelName": "string", "CompressionType": "string", "ContentType": "string", "DataSource": { "FileSystemDataSource": { "DirectoryPath": "string", "FileSystemAccessMode": "string", "FileSystemId": "string", "FileSystemType": "string" }, "S3DataSource": { "AttributeNames": [ "string" ], "S3DataDistributionType": "string", "S3DataType": "string", "S3Uri": "string" } }, "InputMode": "string", "RecordWrapperType": "string", "ShuffleConfig": { "Seed": number } } ], "LabelingJobArn": "string", "LastModifiedTime": number, "ModelArtifacts": { "S3ModelArtifacts": "string" }, "OutputDataConfig": { "KmsKeyId": "string", "S3OutputPath": "string" }, "ProfilerConfig": { "ProfilingIntervalInMilliseconds": number, "ProfilingParameters": { "string" : "string" }, "S3OutputPath": "string" }, "ProfilerRuleConfigurations": [ { "InstanceType": "string", "LocalPath": "string", "RuleConfigurationName": "string", "RuleEvaluatorImage": "string", "RuleParameters": { "string" : "string" }, "S3OutputPath": "string", "VolumeSizeInGB": number } ], "ProfilerRuleEvaluationStatuses": [ { "LastModifiedTime": number, "RuleConfigurationName": "string", "RuleEvaluationJobArn": "string", "RuleEvaluationStatus": "string", "StatusDetails": "string" } ], "ProfilingStatus": "string", "ResourceConfig": { "InstanceCount": number, "InstanceType": "string", "VolumeKmsKeyId": "string", "VolumeSizeInGB": number }, "RetryStrategy": { "MaximumRetryAttempts": number }, "RoleArn": "string", "SecondaryStatus": "string", "SecondaryStatusTransitions": [ { "EndTime": number, "StartTime": number, "Status": "string", "StatusMessage": "string" } ], "StoppingCondition": { "MaxRuntimeInSeconds": number, "MaxWaitTimeInSeconds": number }, "TensorBoardOutputConfig": { "LocalPath": "string", "S3OutputPath": "string" }, "TrainingEndTime": number, "TrainingJobArn": "string", "TrainingJobName": "string", "TrainingJobStatus": "string", "TrainingStartTime": number, "TrainingTimeInSeconds": number, "TuningJobArn": "string", "VpcConfig": { "SecurityGroupIds": [ "string" ], "Subnets": [ "string" ] } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

AlgorithmSpecification

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

Type: AlgorithmSpecification object

AutoMLJobArn

The Amazon Resource Name (ARN) of an AutoML job.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:automl-job/.*

BillableTimeInSeconds

The billable time in seconds. Billable time refers to the absolute wall-clock time.

Multiply BillableTimeInSeconds by the number of instances (InstanceCount) in your training cluster to get the total compute time Amazon SageMaker will bill you if you run distributed training. The formula is as follows: BillableTimeInSeconds * InstanceCount .

You can calculate the savings from using managed spot training using the formula (1 - BillableTimeInSeconds / TrainingTimeInSeconds) * 100. For example, if BillableTimeInSeconds is 100 and TrainingTimeInSeconds is 500, the savings is 80%.

Type: Integer

Valid Range: Minimum value of 1.

CheckpointConfig

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

Type: CheckpointConfig object

CreationTime

A timestamp that indicates when the training job was created.

Type: Timestamp

DebugHookConfig

Configuration information for the 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.

Type: DebugHookConfig object

DebugRuleConfigurations

Configuration information for Debugger rules for debugging output tensors.

Type: Array of DebugRuleConfiguration objects

Array Members: Minimum number of 0 items. Maximum number of 20 items.

DebugRuleEvaluationStatuses

Evaluation status of Debugger rules for debugging on a training job.

Type: Array of DebugRuleEvaluationStatus objects

Array Members: Minimum number of 0 items. Maximum number of 20 items.

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 algorithms in distributed training.

Type: Boolean

EnableManagedSpotTraining

A Boolean indicating whether managed spot training is enabled (True) or not (False).

Type: Boolean

EnableNetworkIsolation

If you want to allow inbound or outbound network calls, except for calls between peers within a training cluster for distributed training, choose True. If you enable network isolation for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

Type: Boolean

Environment

The environment variables to set in the Docker container.

Type: String to string map

Map Entries: Maximum number of 48 items.

Key Length Constraints: Maximum length of 512.

Key Pattern: [a-zA-Z_][a-zA-Z0-9_]*

Value Length Constraints: Maximum length of 512.

Value Pattern: [\S\s]*

ExperimentConfig

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

Type: ExperimentConfig object

FailureReason

If the training job failed, the reason it failed.

Type: String

Length Constraints: Maximum length of 1024.

FinalMetricDataList

A collection of MetricData objects that specify the names, values, and dates and times that the training algorithm emitted to Amazon CloudWatch.

Type: Array of MetricData objects

Array Members: Minimum number of 0 items. Maximum number of 40 items.

HyperParameters

Algorithm-specific parameters.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 100 items.

Key Length Constraints: Maximum length of 256.

Key Pattern: .*

Value Length Constraints: Maximum length of 2500.

Value Pattern: .*

InputDataConfig

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

Type: Array of Channel objects

Array Members: Minimum number of 1 item. Maximum number of 20 items.

LabelingJobArn

The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling job that created the transform or training job.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:labeling-job/.*

LastModifiedTime

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

Type: Timestamp

ModelArtifacts

Information about the Amazon S3 location that is configured for storing model artifacts.

Type: ModelArtifacts object

OutputDataConfig

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

Type: OutputDataConfig object

ProfilerConfig

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

Type: ProfilerConfig object

ProfilerRuleConfigurations

Configuration information for Debugger rules for profiling system and framework metrics.

Type: Array of ProfilerRuleConfiguration objects

Array Members: Minimum number of 0 items. Maximum number of 20 items.

ProfilerRuleEvaluationStatuses

Evaluation status of Debugger rules for profiling on a training job.

Type: Array of ProfilerRuleEvaluationStatus objects

Array Members: Minimum number of 0 items. Maximum number of 20 items.

ProfilingStatus

Profiling status of a training job.

Type: String

Valid Values: Enabled | Disabled

ResourceConfig

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

Type: ResourceConfig object

RetryStrategy

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

Type: RetryStrategy object

RoleArn

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

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

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

SecondaryStatus

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

Amazon 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.

  • Interrupted - The job stopped because the managed spot training instances were interrupted.

  • 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.

  • MaxWaitTimeExceeded - The job stopped because it exceeded the maximum allowed wait time.

  • 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

  • PreparingTraining

  • DownloadingTrainingImage

Type: String

Valid Values: Starting | LaunchingMLInstances | PreparingTrainingStack | Downloading | DownloadingTrainingImage | Training | Uploading | Stopping | Stopped | MaxRuntimeExceeded | Completed | Failed | Interrupted | MaxWaitTimeExceeded | Updating | Restarting

SecondaryStatusTransitions

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

Type: Array of SecondaryStatusTransition objects

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, Amazon SageMaker ends the training job. Use this API to cap model training costs.

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

Type: StoppingCondition object

TensorBoardOutputConfig

Configuration of storage locations for the Debugger TensorBoard output data.

Type: TensorBoardOutputConfig object

TrainingEndTime

Indicates the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker detects a job failure.

Type: Timestamp

TrainingJobArn

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

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:training-job/.*

TrainingJobName

Name of the model training job.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 63.

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

TrainingJobStatus

The status of the training job.

Amazon SageMaker provides the following training job statuses:

  • 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.

Type: String

Valid Values: InProgress | Completed | Failed | Stopping | Stopped

TrainingStartTime

Indicates the time when the training job starts on training instances. You are billed for the time interval between this time and the value of TrainingEndTime. The start time in CloudWatch Logs might be later than this time. The difference is due to the time it takes to download the training data and to the size of the training container.

Type: Timestamp

TrainingTimeInSeconds

The training time in seconds.

Type: Integer

Valid Range: Minimum value of 1.

TuningJobArn

The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:hyper-parameter-tuning-job/.*

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.

Type: VpcConfig object

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceNotFound

Resource being access is not found.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: