SageMaker / Client / list_training_jobs

list_training_jobs#

SageMaker.Client.list_training_jobs(**kwargs)#

Lists training jobs.

Note

When StatusEquals and MaxResults are set at the same time, the MaxResults number of training jobs are first retrieved ignoring the StatusEquals parameter and then they are filtered by the StatusEquals parameter, which is returned as a response.

For example, if ListTrainingJobs is invoked with the following parameters:

{ ... MaxResults: 100, StatusEquals: InProgress ... }

First, 100 trainings jobs with any status, including those other than InProgress, are selected (sorted according to the creation time, from the most current to the oldest). Next, those with a status of InProgress are returned.

You can quickly test the API using the following Amazon Web Services CLI code.

aws sagemaker list-training-jobs --max-results 100 --status-equals InProgress

See also: AWS API Documentation

Request Syntax

response = client.list_training_jobs(
    NextToken='string',
    MaxResults=123,
    CreationTimeAfter=datetime(2015, 1, 1),
    CreationTimeBefore=datetime(2015, 1, 1),
    LastModifiedTimeAfter=datetime(2015, 1, 1),
    LastModifiedTimeBefore=datetime(2015, 1, 1),
    NameContains='string',
    StatusEquals='InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    SortBy='Name'|'CreationTime'|'Status',
    SortOrder='Ascending'|'Descending',
    WarmPoolStatusEquals='Available'|'Terminated'|'Reused'|'InUse',
    TrainingPlanArnEquals='string'
)
Parameters:
  • NextToken (string) – If the result of the previous ListTrainingJobs request was truncated, the response includes a NextToken. To retrieve the next set of training jobs, use the token in the next request.

  • MaxResults (integer) – The maximum number of training jobs to return in the response.

  • CreationTimeAfter (datetime) – A filter that returns only training jobs created after the specified time (timestamp).

  • CreationTimeBefore (datetime) – A filter that returns only training jobs created before the specified time (timestamp).

  • LastModifiedTimeAfter (datetime) – A filter that returns only training jobs modified after the specified time (timestamp).

  • LastModifiedTimeBefore (datetime) – A filter that returns only training jobs modified before the specified time (timestamp).

  • NameContains (string) – A string in the training job name. This filter returns only training jobs whose name contains the specified string.

  • StatusEquals (string) – A filter that retrieves only training jobs with a specific status.

  • SortBy (string) – The field to sort results by. The default is CreationTime.

  • SortOrder (string) – The sort order for results. The default is Ascending.

  • WarmPoolStatusEquals (string) – A filter that retrieves only training jobs with a specific warm pool status.

  • TrainingPlanArnEquals (string) – The Amazon Resource Name (ARN); of the training plan to filter training jobs by. For more information about reserving GPU capacity for your SageMaker training jobs using Amazon SageMaker Training Plan, see ``CreateTrainingPlan ``.

Return type:

dict

Returns:

Response Syntax

{
    'TrainingJobSummaries': [
        {
            'TrainingJobName': 'string',
            'TrainingJobArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TrainingEndTime': datetime(2015, 1, 1),
            'LastModifiedTime': datetime(2015, 1, 1),
            'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
            'SecondaryStatus': 'Starting'|'LaunchingMLInstances'|'PreparingTrainingStack'|'Downloading'|'DownloadingTrainingImage'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed'|'Interrupted'|'MaxWaitTimeExceeded'|'Updating'|'Restarting'|'Pending',
            'WarmPoolStatus': {
                'Status': 'Available'|'Terminated'|'Reused'|'InUse',
                'ResourceRetainedBillableTimeInSeconds': 123,
                'ReusedByJob': 'string'
            },
            'TrainingPlanArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • TrainingJobSummaries (list) –

      An array of TrainingJobSummary objects, each listing a training job.

      • (dict) –

        Provides summary information about a training job.

        • TrainingJobName (string) –

          The name of the training job that you want a summary for.

        • TrainingJobArn (string) –

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

        • CreationTime (datetime) –

          A timestamp that shows when the training job was created.

        • TrainingEndTime (datetime) –

          A timestamp that shows when the training job ended. This field is set only if the training job has one of the terminal statuses ( Completed, Failed, or Stopped).

        • LastModifiedTime (datetime) –

          Timestamp when the training job was last modified.

        • TrainingJobStatus (string) –

          The status of the training job.

        • SecondaryStatus (string) –

          The secondary status of the training job.

        • WarmPoolStatus (dict) –

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

          • Status (string) –

            The status of the warm pool.

            • InUse: The warm pool is in use for the training job.

            • Available: The warm pool is available to reuse for a matching training job.

            • Reused: The warm pool moved to a matching training job for reuse.

            • Terminated: The warm pool is no longer available. Warm pools are unavailable if they are terminated by a user, terminated for a patch update, or terminated for exceeding the specified KeepAlivePeriodInSeconds.

          • ResourceRetainedBillableTimeInSeconds (integer) –

            The billable time in seconds used by the warm pool. Billable time refers to the absolute wall-clock time.

            Multiply ResourceRetainedBillableTimeInSeconds by the number of instances ( InstanceCount) in your training cluster to get the total compute time SageMaker bills you if you run warm pool training. The formula is as follows: ResourceRetainedBillableTimeInSeconds * InstanceCount.

          • ReusedByJob (string) –

            The name of the matching training job that reused the warm pool.

        • TrainingPlanArn (string) –

          The Amazon Resource Name (ARN); of the training plan associated with this training job.

          For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see ``CreateTrainingPlan ``.

    • NextToken (string) –

      If the response is truncated, SageMaker returns this token. To retrieve the next set of training jobs, use it in the subsequent request.