Skip to content

TrainingJob

Source code in docs_src/capo_sagemaker/types/training_job.py
class TrainingJob(TypedDict, closed=True):
    training_job_name: NotRequired[
        "capo_sagemaker.types.training_job_name.TrainingJobName"
    ]
    """<p>The name of the training job.</p>"""
    training_job_arn: NotRequired[
        "capo_sagemaker.types.training_job_arn.TrainingJobArn"
    ]
    """<p>The Amazon Resource Name (ARN) of the training job.</p>"""
    tuning_job_arn: NotRequired[
        "capo_sagemaker.types.hyper_parameter_tuning_job_arn.HyperParameterTuningJobArn"
    ]
    """<p>The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.</p>"""
    labeling_job_arn: NotRequired[
        "capo_sagemaker.types.labeling_job_arn.LabelingJobArn"
    ]
    """<p>The Amazon Resource Name (ARN) of the labeling job.</p>"""
    auto_ml_job_arn: NotRequired["capo_sagemaker.types.auto_ml_job_arn.AutoMLJobArn"]
    """<p>The Amazon Resource Name (ARN) of the job.</p>"""
    model_artifacts: NotRequired["capo_sagemaker.types.model_artifacts.ModelArtifacts"]
    """<p>Information about the Amazon S3 location that is configured for storing model artifacts.</p>"""
    training_job_status: NotRequired[
        "capo_sagemaker.types.training_job_status.TrainingJobStatus"
    ]
    """<p>The status of the training job.</p> <p>Training job statuses are:</p> <ul> <li> <p> <code>InProgress</code> - The training is in progress.</p> </li> <li> <p> <code>Completed</code> - The training job has completed.</p> </li> <li> <p> <code>Failed</code> - The training job has failed. To see the reason for the failure, see the <code>FailureReason</code> field in the response to a <code>DescribeTrainingJobResponse</code> call.</p> </li> <li> <p> <code>Stopping</code> - The training job is stopping.</p> </li> <li> <p> <code>Stopped</code> - The training job has stopped.</p> </li> </ul> <p>For more detailed information, see <code>SecondaryStatus</code>. </p>"""
    secondary_status: NotRequired[
        "capo_sagemaker.types.secondary_status.SecondaryStatus"
    ]
    """<p> Provides detailed information about the state of the training job. For detailed information about the secondary status of the training job, see <code>StatusMessage</code> under <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SecondaryStatusTransition.html">SecondaryStatusTransition</a>.</p> <p>SageMaker provides primary statuses and secondary statuses that apply to each of them:</p> <dl> <dt>InProgress</dt> <dd> <ul> <li> <p> <code>Starting</code> - Starting the training job.</p> </li> <li> <p> <code>Downloading</code> - An optional stage for algorithms that support <code>File</code> training input mode. It indicates that data is being downloaded to the ML storage volumes.</p> </li> <li> <p> <code>Training</code> - Training is in progress.</p> </li> <li> <p> <code>Uploading</code> - Training is complete and the model artifacts are being uploaded to the S3 location.</p> </li> </ul> </dd> <dt>Completed</dt> <dd> <ul> <li> <p> <code>Completed</code> - The training job has completed.</p> </li> </ul> </dd> <dt>Failed</dt> <dd> <ul> <li> <p> <code>Failed</code> - The training job has failed. The reason for the failure is returned in the <code>FailureReason</code> field of <code>DescribeTrainingJobResponse</code>.</p> </li> </ul> </dd> <dt>Stopped</dt> <dd> <ul> <li> <p> <code>MaxRuntimeExceeded</code> - The job stopped because it exceeded the maximum allowed runtime.</p> </li> <li> <p> <code>Stopped</code> - The training job has stopped.</p> </li> </ul> </dd> <dt>Stopping</dt> <dd> <ul> <li> <p> <code>Stopping</code> - Stopping the training job.</p> </li> </ul> </dd> </dl> <important> <p>Valid values for <code>SecondaryStatus</code> are subject to change. </p> </important> <p>We no longer support the following secondary statuses:</p> <ul> <li> <p> <code>LaunchingMLInstances</code> </p> </li> <li> <p> <code>PreparingTrainingStack</code> </p> </li> <li> <p> <code>DownloadingTrainingImage</code> </p> </li> </ul>"""
    failure_reason: NotRequired["capo_sagemaker.types.failure_reason.FailureReason"]
    """<p>If the training job failed, the reason it failed.</p>"""
    hyper_parameters: NotRequired[
        "capo_sagemaker.types.hyper_parameters.HyperParameters"
    ]
    """<p>Algorithm-specific parameters.</p>"""
    algorithm_specification: NotRequired[
        "capo_sagemaker.types.algorithm_specification.AlgorithmSpecification"
    ]
    """<p>Information about the algorithm used for training, and algorithm metadata.</p>"""
    role_arn: NotRequired["capo_sagemaker.types.role_arn.RoleArn"]
    """<p>The Amazon Web Services Identity and Access Management (IAM) role configured for the training job.</p>"""
    input_data_config: NotRequired[
        "capo_sagemaker.types.input_data_config.InputDataConfig"
    ]
    """<p>An array of <code>Channel</code> objects that describes each data input channel.</p> <p>Your input must be in the same Amazon Web Services region as your training job.</p>"""
    output_data_config: NotRequired[
        "capo_sagemaker.types.output_data_config.OutputDataConfig"
    ]
    """<p>The S3 path where model artifacts that you configured when creating the job are stored. SageMaker creates subfolders for model artifacts.</p>"""
    resource_config: NotRequired["capo_sagemaker.types.resource_config.ResourceConfig"]
    """<p>Resources, including ML compute instances and ML storage volumes, that are configured for model training.</p>"""
    warm_pool_status: NotRequired[
        "capo_sagemaker.types.warm_pool_status.WarmPoolStatus"
    ]
    """<p>The status of the warm pool associated with the training job.</p>"""
    vpc_config: NotRequired["capo_sagemaker.types.vpc_config.VpcConfig"]
    """<p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that this training job has access to. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>"""
    stopping_condition: NotRequired[
        "capo_sagemaker.types.stopping_condition.StoppingCondition"
    ]
    """<p>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.</p> <p>To stop a job, SageMaker sends the algorithm the <code>SIGTERM</code> 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. </p>"""
    creation_time: NotRequired["capo_sagemaker.types.timestamp.Timestamp"]
    """<p>A timestamp that indicates when the training job was created.</p>"""
    training_start_time: NotRequired["capo_sagemaker.types.timestamp.Timestamp"]
    """<p>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 <code>TrainingEndTime</code>. 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.</p>"""
    training_end_time: NotRequired["capo_sagemaker.types.timestamp.Timestamp"]
    """<p>Indicates the time when the training job ends on training instances. You are billed for the time interval between the value of <code>TrainingStartTime</code> 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 SageMaker detects a job failure.</p>"""
    last_modified_time: NotRequired["capo_sagemaker.types.timestamp.Timestamp"]
    """<p>A timestamp that indicates when the status of the training job was last modified.</p>"""
    secondary_status_transitions: NotRequired[
        "capo_sagemaker.types.secondary_status_transitions.SecondaryStatusTransitions"
    ]
    """<p>A history of all of the secondary statuses that the training job has transitioned through.</p>"""
    final_metric_data_list: NotRequired[
        "capo_sagemaker.types.final_metric_data_list.FinalMetricDataList"
    ]
    """<p>A list of final metric values that are set when the training job completes. Used only if the training job was configured to use metrics.</p>"""
    enable_network_isolation: NotRequired["capo_sagemaker.types.boolean.Boolean"]
    """<p>If the <code>TrainingJob</code> was created with network isolation, the value is set to <code>true</code>. If network isolation is enabled, nodes can't communicate beyond the VPC they run in.</p>"""
    enable_inter_container_traffic_encryption: NotRequired[
        "capo_sagemaker.types.boolean.Boolean"
    ]
    """<p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. 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.</p>"""
    enable_managed_spot_training: NotRequired["capo_sagemaker.types.boolean.Boolean"]
    """<p>When true, enables managed spot training using Amazon EC2 Spot instances to run training jobs instead of on-demand instances. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html">Managed Spot Training</a>.</p>"""
    checkpoint_config: NotRequired[
        "capo_sagemaker.types.checkpoint_config.CheckpointConfig"
    ]
    training_time_in_seconds: NotRequired[
        "capo_sagemaker.types.training_time_in_seconds.TrainingTimeInSeconds"
    ]
    """<p>The training time in seconds.</p>"""
    billable_time_in_seconds: NotRequired[
        "capo_sagemaker.types.billable_time_in_seconds.BillableTimeInSeconds"
    ]
    """<p>The billable time in seconds.</p>"""
    debug_hook_config: NotRequired[
        "capo_sagemaker.types.debug_hook_config.DebugHookConfig"
    ]
    experiment_config: NotRequired[
        "capo_sagemaker.types.experiment_config.ExperimentConfig"
    ]
    debug_rule_configurations: NotRequired[
        "capo_sagemaker.types.debug_rule_configurations.DebugRuleConfigurations"
    ]
    """<p>Information about the debug rule configuration.</p>"""
    tensor_board_output_config: NotRequired[
        "capo_sagemaker.types.tensor_board_output_config.TensorBoardOutputConfig"
    ]
    debug_rule_evaluation_statuses: NotRequired[
        "capo_sagemaker.types.debug_rule_evaluation_statuses.DebugRuleEvaluationStatuses"
    ]
    """<p>Information about the evaluation status of the rules for the training job.</p>"""
    output_model_package_arn: NotRequired[
        "capo_sagemaker.types.model_package_arn.ModelPackageArn"
    ]
    """<p> The output model package Amazon Resource Name (ARN) that contains model weights or checkpoint. </p>"""
    model_package_config: NotRequired[
        "capo_sagemaker.types.model_package_config.ModelPackageConfig"
    ]
    """<p> The model package configuration. </p>"""
    profiler_config: NotRequired["capo_sagemaker.types.profiler_config.ProfilerConfig"]
    environment: NotRequired[
        "capo_sagemaker.types.training_environment_map.TrainingEnvironmentMap"
    ]
    """<p>The environment variables to set in the Docker container.</p>"""
    retry_strategy: NotRequired["capo_sagemaker.types.retry_strategy.RetryStrategy"]
    """<p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>"""
    tags: NotRequired["capo_sagemaker.types.tag_list.TagList"]
    """<p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>"""

algorithm_specification instance-attribute

algorithm_specification: NotRequired[AlgorithmSpecification]

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

auto_ml_job_arn instance-attribute

auto_ml_job_arn: NotRequired[AutoMLJobArn]

The Amazon Resource Name (ARN) of the job.

billable_time_in_seconds instance-attribute

billable_time_in_seconds: NotRequired[BillableTimeInSeconds]

The billable time in seconds.

checkpoint_config instance-attribute

checkpoint_config: NotRequired[CheckpointConfig]

creation_time instance-attribute

creation_time: NotRequired[Timestamp]

A timestamp that indicates when the training job was created.

debug_hook_config instance-attribute

debug_hook_config: NotRequired[DebugHookConfig]

debug_rule_configurations instance-attribute

debug_rule_configurations: NotRequired[DebugRuleConfigurations]

Information about the debug rule configuration.

debug_rule_evaluation_statuses instance-attribute

debug_rule_evaluation_statuses: NotRequired[DebugRuleEvaluationStatuses]

Information about the evaluation status of the rules for the training job.

enable_inter_container_traffic_encryption instance-attribute

enable_inter_container_traffic_encryption: NotRequired[Boolean]

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.

enable_managed_spot_training instance-attribute

enable_managed_spot_training: NotRequired[Boolean]

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.

enable_network_isolation instance-attribute

enable_network_isolation: NotRequired[Boolean]

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.

environment instance-attribute

environment: NotRequired[TrainingEnvironmentMap]

The environment variables to set in the Docker container.

experiment_config instance-attribute

experiment_config: NotRequired[ExperimentConfig]

failure_reason instance-attribute

failure_reason: NotRequired[FailureReason]

If the training job failed, the reason it failed.

final_metric_data_list instance-attribute

final_metric_data_list: NotRequired[FinalMetricDataList]

A list of final metric values that are set when the training job completes. Used only if the training job was configured to use metrics.

hyper_parameters instance-attribute

hyper_parameters: NotRequired[HyperParameters]

Algorithm-specific parameters.

input_data_config instance-attribute

input_data_config: NotRequired[InputDataConfig]

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

Your input must be in the same Amazon Web Services region as your training job.

labeling_job_arn instance-attribute

labeling_job_arn: NotRequired[LabelingJobArn]

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

last_modified_time instance-attribute

last_modified_time: NotRequired[Timestamp]

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

model_artifacts instance-attribute

model_artifacts: NotRequired[ModelArtifacts]

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

model_package_config instance-attribute

model_package_config: NotRequired[ModelPackageConfig]

The model package configuration.

output_data_config instance-attribute

output_data_config: NotRequired[OutputDataConfig]

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

output_model_package_arn instance-attribute

output_model_package_arn: NotRequired[ModelPackageArn]

The output model package Amazon Resource Name (ARN) that contains model weights or checkpoint.

profiler_config instance-attribute

profiler_config: NotRequired[ProfilerConfig]

resource_config instance-attribute

resource_config: NotRequired[ResourceConfig]

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

retry_strategy instance-attribute

retry_strategy: NotRequired[RetryStrategy]

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

role_arn instance-attribute

role_arn: NotRequired[RoleArn]

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

secondary_status instance-attribute

secondary_status: NotRequired[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.

Valid values for SecondaryStatus are subject to change.

We no longer support the following secondary statuses:

  • LaunchingMLInstances

  • PreparingTrainingStack

  • DownloadingTrainingImage

secondary_status_transitions instance-attribute

secondary_status_transitions: NotRequired[SecondaryStatusTransitions]

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

stopping_condition instance-attribute

stopping_condition: NotRequired[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.

tags instance-attribute

tags: NotRequired[TagList]

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

tensor_board_output_config instance-attribute

tensor_board_output_config: NotRequired[TensorBoardOutputConfig]

training_end_time instance-attribute

training_end_time: NotRequired[Timestamp]

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 SageMaker detects a job failure.

training_job_arn instance-attribute

training_job_arn: NotRequired[TrainingJobArn]

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

training_job_name instance-attribute

training_job_name: NotRequired[TrainingJobName]

The name of the training job.

training_job_status instance-attribute

training_job_status: NotRequired[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.

training_start_time instance-attribute

training_start_time: NotRequired[Timestamp]

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.

training_time_in_seconds instance-attribute

training_time_in_seconds: NotRequired[TrainingTimeInSeconds]

The training time in seconds.

tuning_job_arn instance-attribute

tuning_job_arn: NotRequired[HyperParameterTuningJobArn]

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

vpc_config instance-attribute

vpc_config: NotRequired[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.

warm_pool_status instance-attribute

warm_pool_status: NotRequired[WarmPoolStatus]

The status of the warm pool associated with the training job.