SageMaker / Client / describe_training_session

describe_training_session

SageMaker.Client.describe_training_session(**kwargs)

Retrieves detailed information about a training session, including its current status, model configuration, Low-Rank Adaptation (LoRA) parameters, and timestamps.

The following operations are related to DescribeTrainingSession:

  • CreateTrainingSession

  • ListTrainingSessions

  • StopTrainingSession

  • DeleteTrainingSession

See also: AWS API Documentation

Request Syntax

response = client.describe_training_session(
    TrainingSessionName='string'
)
Parameters:

TrainingSessionName (string) –

[REQUIRED]

The name of the training session to describe.

Return type:

dict

Returns:

Response Syntax

{
    'TrainingSessionDetail': {
        'TrainingSessionArn': 'string',
        'TrainingSessionName': 'string',
        'TrainingSessionStatus': 'Created'|'Blocked'|'Running'|'Failed'|'Scheduled'|'Stopping'|'Stopped'|'Expired'|'Deleting'|'DeletionFailed',
        'ModelPackageGroupArn': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'LastModifiedTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'ErrorDetails': 'string',
        'LastReceivedSequenceNumber': 123,
        'BillableTokenUsage': {
            'PrefillTokenCount': 123,
            'SampleTokenCount': 123,
            'TrainingTokenCount': 123
        },
        'VpcConfig': {
            'SecurityGroupIds': [
                'string',
            ],
            'Subnets': [
                'string',
            ]
        },
        'RoleArn': 'string',
        'LoraConfig': {
            'Rank': 123,
            'Alpha': 123
        },
        'ModelConfig': {
            'BaseModelArn': 'string',
            'AcceptEula': True|False
        },
        'OutputConfig': {
            'S3Location': {
                'Path': 'string',
                'KmsKeyArn': 'string'
            }
        },
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • TrainingSessionDetail (dict) –

      The detailed information about the training session.

      • TrainingSessionArn (string) –

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

      • TrainingSessionName (string) –

        The name of the training session.

      • TrainingSessionStatus (string) –

        The current status of the training session.

      • ModelPackageGroupArn (string) –

        The Amazon Resource Name (ARN) of the model package group where checkpoints are published.

      • CreationTime (datetime) –

        The date and time that the training session was created.

      • LastModifiedTime (datetime) –

        The date and time that the training session was last modified.

      • EndTime (datetime) –

        The date and time that the training session ended.

      • ErrorDetails (string) –

        If the training session failed or is blocked, detailed error information.

      • LastReceivedSequenceNumber (integer) –

        The sequence number of the last training operation received by the session.

      • BillableTokenUsage (dict) –

        The billable token usage for the training session.

        • PrefillTokenCount (integer) –

          The number of prefill tokens consumed.

        • SampleTokenCount (integer) –

          The number of sample tokens consumed.

        • TrainingTokenCount (integer) –

          The number of training tokens consumed.

      • VpcConfig (dict) –

        The Virtual Private Cloud (VPC) configuration for the training session.

        • SecurityGroupIds (list) –

          The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

          • (string) –

        • Subnets (list) –

          The ID of the subnets in the VPC to which you want to connect your training job or model. For information about the availability of specific instance types, see Supported Instance Types and Availability Zones.

          • (string) –

      • RoleArn (string) –

        The Amazon Resource Name (ARN) of the IAM role associated with the training session.

      • LoraConfig (dict) –

        The Low-Rank Adaptation (LoRA) configuration for the training session.

        • Rank (integer) –

          The rank of the Low-Rank Adaptation (LoRA) adapter matrices.

        • Alpha (integer) –

          The Low-Rank Adaptation (LoRA) scaling factor.

      • ModelConfig (dict) –

        The configuration for the base model.

        • BaseModelArn (string) –

          The Amazon Resource Name (ARN) of the base foundation model from SageMaker Hub.

        • AcceptEula (boolean) –

          Specifies whether you accept the end-user license agreement (EULA) for gated models.

      • OutputConfig (dict) –

        The output configuration for the training session.

        • S3Location (dict) –

          The Amazon S3 location where training session outputs, including checkpoints and model artifacts, are stored.

          • Path (string) –

            The Amazon S3 path where training session outputs are stored.

          • KmsKeyArn (string) –

            The Amazon Resource Name (ARN) of the KMS key used to encrypt output data. If not specified, the default Amazon S3 encryption is used.

      • Tags (list) –

        The tags associated with the training session.

        • (dict) –

          A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

          You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

          For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

          • Key (string) –

            The tag key. Tag keys must be unique per resource.

          • Value (string) –

            The tag value.

Exceptions

  • SageMaker.Client.exceptions.ResourceNotFound