Amazon SageMaker Service

2018/01/18 - Amazon SageMaker Service - 4 updated api methods

Changes  CreateTrainingJob and CreateEndpointConfig now supports KMS Key for volume encryption.

CreateEndpointConfig (updated) Link ¶
Changes (request)
{'KmsKeyId': 'string'}

Creates an endpoint configuration that Amazon SageMaker hosting services uses to deploy models. In the configuration, you identify one or more models, created using the CreateModel API, to deploy and the resources that you want Amazon SageMaker to provision. Then you call the CreateEndpoint API.

Note

Use this API only if you want to use Amazon SageMaker hosting services to deploy models into production.

In the request, you define one or more ProductionVariant s, each of which identifies a model. Each ProductionVariant parameter also describes the resources that you want Amazon SageMaker to provision. This includes the number and type of ML compute instances to deploy.

If you are hosting multiple models, you also assign a VariantWeight to specify how much traffic you want to allocate to each model. For example, suppose that you want to host two models, A and B, and you assign traffic weight 2 for model A and 1 for model B. Amazon SageMaker distributes two-thirds of the traffic to Model A, and one-third to model B.

See also: AWS API Documentation

Request Syntax

client.create_endpoint_config(
    EndpointConfigName='string',
    ProductionVariants=[
        {
            'VariantName': 'string',
            'ModelName': 'string',
            'InitialInstanceCount': 123,
            'InstanceType': 'ml.c4.2xlarge'|'ml.c4.8xlarge'|'ml.c4.xlarge'|'ml.c5.2xlarge'|'ml.c5.9xlarge'|'ml.c5.xlarge'|'ml.m4.xlarge'|'ml.p2.xlarge'|'ml.p3.2xlarge'|'ml.t2.medium',
            'InitialVariantWeight': ...
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    KmsKeyId='string'
)
type EndpointConfigName

string

param EndpointConfigName

[REQUIRED]

The name of the endpoint configuration. You specify this name in a CreateEndpoint request.

type ProductionVariants

list

param ProductionVariants

[REQUIRED]

An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

  • (dict) --

    Identifies a model that you want to host and the resources to deploy for hosting it. If you are deploying multiple models, tell Amazon SageMaker how to distribute traffic among the models by specifying variant weights.

    • VariantName (string) -- [REQUIRED]

      The name of the production variant.

    • ModelName (string) -- [REQUIRED]

      The name of the model that you want to host. This is the name that you specified when creating the model.

    • InitialInstanceCount (integer) -- [REQUIRED]

      Number of instances to launch initially.

    • InstanceType (string) -- [REQUIRED]

      The ML compute instance type.

    • InitialVariantWeight (float) --

      Determines initial traffic distribution among all of the models that you specify in the endpoint configuration. The traffic to a production variant is determined by the ratio of the VariantWeight to the sum of all VariantWeight values across all ProductionVariants. If unspecified, it defaults to 1.0.

type Tags

list

param Tags

An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .

  • (dict) --

    Describes a tag.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) -- [REQUIRED]

      The tag value.

type KmsKeyId

string

param KmsKeyId

The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint.

rtype

dict

returns

Response Syntax

{
    'EndpointConfigArn': 'string'
}

Response Structure

  • (dict) --

    • EndpointConfigArn (string) --

      The Amazon Resource Name (ARN) of the endpoint configuration.

CreateTrainingJob (updated) Link ¶
Changes (request)
{'ResourceConfig': {'VolumeKmsKeyId': 'string'}}

Starts a model training job. After training completes, Amazon SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify.

If you choose to host your model using Amazon SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a deep learning service other than Amazon SageMaker, provided that you know how to use them for inferences.

In the request body, you provide the following:

  • AlgorithmSpecification - Identifies the training algorithm to use.

  • HyperParameters - Specify these algorithm-specific parameters to influence the quality of the final model. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

  • InputDataConfig - Describes the training dataset and the Amazon S3 location where it is stored.

  • OutputDataConfig - Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training.

  • ResourceConfig - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance.

  • RoleARN - The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that Amazon SageMaker can successfully complete model training.

  • StoppingCondition - Sets a duration for training. Use this parameter to cap model training costs.

For more information about Amazon SageMaker, see How It Works.

See also: AWS API Documentation

Request Syntax

client.create_training_job(
    TrainingJobName='string',
    HyperParameters={
        'string': 'string'
    },
    AlgorithmSpecification={
        'TrainingImage': 'string',
        'TrainingInputMode': 'Pipe'|'File'
    },
    RoleArn='string',
    InputDataConfig=[
        {
            'ChannelName': 'string',
            'DataSource': {
                'S3DataSource': {
                    'S3DataType': 'ManifestFile'|'S3Prefix',
                    'S3Uri': 'string',
                    'S3DataDistributionType': 'FullyReplicated'|'ShardedByS3Key'
                }
            },
            'ContentType': 'string',
            'CompressionType': 'None'|'Gzip',
            'RecordWrapperType': 'None'|'RecordIO'
        },
    ],
    OutputDataConfig={
        'KmsKeyId': 'string',
        'S3OutputPath': 'string'
    },
    ResourceConfig={
        'InstanceType': 'ml.m4.xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.8xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge',
        'InstanceCount': 123,
        'VolumeSizeInGB': 123,
        'VolumeKmsKeyId': 'string'
    },
    StoppingCondition={
        'MaxRuntimeInSeconds': 123
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type TrainingJobName

string

param TrainingJobName

[REQUIRED]

The name of the training job. The name must be unique within an AWS Region in an AWS account. It appears in the Amazon SageMaker console.

type HyperParameters

dict

param HyperParameters

Algorithm-specific parameters. You set hyperparameters before you start the learning process. Hyperparameters influence the quality of the model. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the Length Constraint .

  • (string) --

    • (string) --

type AlgorithmSpecification

dict

param AlgorithmSpecification

[REQUIRED]

The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by Amazon SageMaker, see Algorithms. For information about providing your own algorithms, see Bring Your Own Algorithms.

  • TrainingImage (string) -- [REQUIRED]

    The registry path of the Docker image that contains the training algorithm. For information about using your own algorithms, see Docker Registry Paths for Algorithms Provided by Amazon SageMaker.

  • TrainingInputMode (string) -- [REQUIRED]

    The input mode that the algorithm supports. For the input modes that Amazon SageMaker algorithms support, see Algorithms. If an algorithm supports the File input mode, Amazon SageMaker downloads the training data from S3 to the provisioned ML storage Volume, and mounts the directory to docker volume for training container. If an algorithm supports the Pipe input mode, Amazon SageMaker streams data directly from S3 to the container.

    In File mode, make sure you provision ML storage volume with sufficient capacity to accomodate the data download from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container use ML storage volume to also store intermediate information, if any.

    For distributed algorithms using File mode, training data is distributed uniformly, and your training duration is predictable if the input data objects size is approximately same. Amazon SageMaker does not split the files any further for model training. If the object sizes are skewed, training won't be optimal as the data distribution is also skewed where one host in a training cluster is overloaded, thus becoming bottleneck in training.

type RoleArn

string

param RoleArn

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

During model training, Amazon SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see Amazon SageMaker Roles.

type InputDataConfig

list

param InputDataConfig

[REQUIRED]

An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location.

Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, training_data and validation_data . The configuration for each channel provides the S3 location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.

Depending on the input mode that the algorithm supports, Amazon SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams.

  • (dict) --

    A channel is a named input source that training algorithms can consume.

    • ChannelName (string) -- [REQUIRED]

      The name of the channel.

    • DataSource (dict) -- [REQUIRED]

      The location of the channel data.

      • S3DataSource (dict) -- [REQUIRED]

        The S3 location of the data source that is associated with a channel.

        • S3DataType (string) -- [REQUIRED]

          If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects with the specified key name prefix for model training.

          If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

        • S3Uri (string) -- [REQUIRED]

          Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

          • A key name prefix might look like this: s3://bucketname/exampleprefix .

          • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-1 ... The complete set of s3uris in this manifest constitutes the input data for the channel for this datasource. The object that each s3uris points to must readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

        • S3DataDistributionType (string) --

          If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

          If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

          Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both FILE and PIPE modes. Keep this in mind when developing algorithms.

          In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

    • ContentType (string) --

      The MIME type of the data.

    • CompressionType (string) --

      If training data is compressed, the compression type. The default value is None . CompressionType is used only in PIPE input mode. In FILE mode, leave this field unset or set it to None.

    • RecordWrapperType (string) --

      Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format, in which caseAmazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

      In FILE mode, leave this field unset or set it to None.

type OutputDataConfig

dict

param OutputDataConfig

[REQUIRED]

Specifies the path to the S3 bucket where you want to store model artifacts. Amazon SageMaker creates subfolders for the artifacts.

  • KmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.

    Note

    If the configuration of the output S3 bucket requires server-side encryption for objects, and you don't provide the KMS key ID, Amazon SageMaker uses the default service key. For more information, see KMS-Managed Encryption Keys in Amazon Simple Storage Service developer guide.

    Note

    The KMS key policy must grant permission to the IAM role you specify in your CreateTrainingJob request. Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide.

  • S3OutputPath (string) -- [REQUIRED]

    Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

type ResourceConfig

dict

param ResourceConfig

[REQUIRED]

The resources, including the ML compute instances and ML storage volumes, to use for model training.

ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want Amazon SageMaker to use the ML storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

  • InstanceType (string) -- [REQUIRED]

    The ML compute instance type.

  • InstanceCount (integer) -- [REQUIRED]

    The number of ML compute instances to use. For distributed training, provide a value greater than 1.

  • VolumeSizeInGB (integer) -- [REQUIRED]

    The size of the ML storage volume that you want to provision.

    ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

    You must specify sufficient ML storage for your scenario.

    Note

    Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

  • VolumeKmsKeyId (string) --

    The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.

type StoppingCondition

dict

param StoppingCondition

[REQUIRED]

Sets a duration for training. Use this parameter 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 might use this 120-second window to save the model artifacts.

When Amazon SageMaker terminates a job because the stopping condition has been met, training algorithms provided by Amazon SageMaker save the intermediate results of the job. This intermediate data is a valid model artifact. You can use it to create a model using the CreateModel API.

  • MaxRuntimeInSeconds (integer) --

    The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 5 days.

type Tags

list

param Tags

An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .

  • (dict) --

    Describes a tag.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) -- [REQUIRED]

      The tag value.

rtype

dict

returns

Response Syntax

{
    'TrainingJobArn': 'string'
}

Response Structure

  • (dict) --

    • TrainingJobArn (string) --

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

DescribeEndpointConfig (updated) Link ¶
Changes (response)
{'KmsKeyId': 'string'}

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

See also: AWS API Documentation

Request Syntax

client.describe_endpoint_config(
    EndpointConfigName='string'
)
type EndpointConfigName

string

param EndpointConfigName

[REQUIRED]

The name of the endpoint configuration.

rtype

dict

returns

Response Syntax

{
    'EndpointConfigName': 'string',
    'EndpointConfigArn': 'string',
    'ProductionVariants': [
        {
            'VariantName': 'string',
            'ModelName': 'string',
            'InitialInstanceCount': 123,
            'InstanceType': 'ml.c4.2xlarge'|'ml.c4.8xlarge'|'ml.c4.xlarge'|'ml.c5.2xlarge'|'ml.c5.9xlarge'|'ml.c5.xlarge'|'ml.m4.xlarge'|'ml.p2.xlarge'|'ml.p3.2xlarge'|'ml.t2.medium',
            'InitialVariantWeight': ...
        },
    ],
    'KmsKeyId': 'string',
    'CreationTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • EndpointConfigName (string) --

      Name of the Amazon SageMaker endpoint configuration.

    • EndpointConfigArn (string) --

      The Amazon Resource Name (ARN) of the endpoint configuration.

    • ProductionVariants (list) --

      An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

      • (dict) --

        Identifies a model that you want to host and the resources to deploy for hosting it. If you are deploying multiple models, tell Amazon SageMaker how to distribute traffic among the models by specifying variant weights.

        • VariantName (string) --

          The name of the production variant.

        • ModelName (string) --

          The name of the model that you want to host. This is the name that you specified when creating the model.

        • InitialInstanceCount (integer) --

          Number of instances to launch initially.

        • InstanceType (string) --

          The ML compute instance type.

        • InitialVariantWeight (float) --

          Determines initial traffic distribution among all of the models that you specify in the endpoint configuration. The traffic to a production variant is determined by the ratio of the VariantWeight to the sum of all VariantWeight values across all ProductionVariants. If unspecified, it defaults to 1.0.

    • KmsKeyId (string) --

      AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the instance.

    • CreationTime (datetime) --

      A timestamp that shows when the endpoint configuration was created.

DescribeTrainingJob (updated) Link ¶
Changes (response)
{'ResourceConfig': {'VolumeKmsKeyId': 'string'}}

Returns information about a training job.

See also: AWS API Documentation

Request Syntax

client.describe_training_job(
    TrainingJobName='string'
)
type TrainingJobName

string

param TrainingJobName

[REQUIRED]

The name of the training job.

rtype

dict

returns

Response Syntax

{
    'TrainingJobName': 'string',
    'TrainingJobArn': 'string',
    'ModelArtifacts': {
        'S3ModelArtifacts': 'string'
    },
    'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    'SecondaryStatus': 'Starting'|'Downloading'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed',
    'FailureReason': 'string',
    'HyperParameters': {
        'string': 'string'
    },
    'AlgorithmSpecification': {
        'TrainingImage': 'string',
        'TrainingInputMode': 'Pipe'|'File'
    },
    'RoleArn': 'string',
    'InputDataConfig': [
        {
            'ChannelName': 'string',
            'DataSource': {
                'S3DataSource': {
                    'S3DataType': 'ManifestFile'|'S3Prefix',
                    'S3Uri': 'string',
                    'S3DataDistributionType': 'FullyReplicated'|'ShardedByS3Key'
                }
            },
            'ContentType': 'string',
            'CompressionType': 'None'|'Gzip',
            'RecordWrapperType': 'None'|'RecordIO'
        },
    ],
    'OutputDataConfig': {
        'KmsKeyId': 'string',
        'S3OutputPath': 'string'
    },
    'ResourceConfig': {
        'InstanceType': 'ml.m4.xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.8xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge',
        'InstanceCount': 123,
        'VolumeSizeInGB': 123,
        'VolumeKmsKeyId': 'string'
    },
    'StoppingCondition': {
        'MaxRuntimeInSeconds': 123
    },
    'CreationTime': datetime(2015, 1, 1),
    'TrainingStartTime': datetime(2015, 1, 1),
    'TrainingEndTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • TrainingJobName (string) --

      Name of the model training job.

    • TrainingJobArn (string) --

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

    • ModelArtifacts (dict) --

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

      • S3ModelArtifacts (string) --

        The path of the S3 object that contains the model artifacts. For example, s3://bucket-name/keynameprefix/model.tar.gz .

    • TrainingJobStatus (string) --

      The status of the training job.

      For the InProgress status, Amazon SageMaker can return these secondary statuses:

      • Starting - Preparing for training.

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

      • Training - Training is in progress.

      • Uploading - Training is complete and model upload is in progress.

      For the Stopped training status, Amazon SageMaker can return these secondary statuses:

      • MaxRuntimeExceeded - Job stopped as a result of maximum allowed runtime exceeded.

    • SecondaryStatus (string) --

      Provides granular information about the system state. For more information, see TrainingJobStatus .

    • FailureReason (string) --

      If the training job failed, the reason it failed.

    • HyperParameters (dict) --

      Algorithm-specific parameters.

      • (string) --

        • (string) --

    • AlgorithmSpecification (dict) --

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

      • TrainingImage (string) --

        The registry path of the Docker image that contains the training algorithm. For information about using your own algorithms, see Docker Registry Paths for Algorithms Provided by Amazon SageMaker.

      • TrainingInputMode (string) --

        The input mode that the algorithm supports. For the input modes that Amazon SageMaker algorithms support, see Algorithms. If an algorithm supports the File input mode, Amazon SageMaker downloads the training data from S3 to the provisioned ML storage Volume, and mounts the directory to docker volume for training container. If an algorithm supports the Pipe input mode, Amazon SageMaker streams data directly from S3 to the container.

        In File mode, make sure you provision ML storage volume with sufficient capacity to accomodate the data download from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container use ML storage volume to also store intermediate information, if any.

        For distributed algorithms using File mode, training data is distributed uniformly, and your training duration is predictable if the input data objects size is approximately same. Amazon SageMaker does not split the files any further for model training. If the object sizes are skewed, training won't be optimal as the data distribution is also skewed where one host in a training cluster is overloaded, thus becoming bottleneck in training.

    • RoleArn (string) --

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

    • InputDataConfig (list) --

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

      • (dict) --

        A channel is a named input source that training algorithms can consume.

        • ChannelName (string) --

          The name of the channel.

        • DataSource (dict) --

          The location of the channel data.

          • S3DataSource (dict) --

            The S3 location of the data source that is associated with a channel.

            • S3DataType (string) --

              If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects with the specified key name prefix for model training.

              If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

            • S3Uri (string) --

              Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

              • A key name prefix might look like this: s3://bucketname/exampleprefix .

              • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-1 ... The complete set of s3uris in this manifest constitutes the input data for the channel for this datasource. The object that each s3uris points to must readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

            • S3DataDistributionType (string) --

              If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

              If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

              Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both FILE and PIPE modes. Keep this in mind when developing algorithms.

              In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

        • ContentType (string) --

          The MIME type of the data.

        • CompressionType (string) --

          If training data is compressed, the compression type. The default value is None . CompressionType is used only in PIPE input mode. In FILE mode, leave this field unset or set it to None.

        • RecordWrapperType (string) --

          Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format, in which caseAmazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

          In FILE mode, leave this field unset or set it to None.

    • OutputDataConfig (dict) --

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

      • KmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.

        Note

        If the configuration of the output S3 bucket requires server-side encryption for objects, and you don't provide the KMS key ID, Amazon SageMaker uses the default service key. For more information, see KMS-Managed Encryption Keys in Amazon Simple Storage Service developer guide.

        Note

        The KMS key policy must grant permission to the IAM role you specify in your CreateTrainingJob request. Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide.

      • S3OutputPath (string) --

        Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

    • ResourceConfig (dict) --

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

      • InstanceType (string) --

        The ML compute instance type.

      • InstanceCount (integer) --

        The number of ML compute instances to use. For distributed training, provide a value greater than 1.

      • VolumeSizeInGB (integer) --

        The size of the ML storage volume that you want to provision.

        ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

        You must specify sufficient ML storage for your scenario.

        Note

        Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

      • VolumeKmsKeyId (string) --

        The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.

    • StoppingCondition (dict) --

      The condition under which to stop the training job.

      • MaxRuntimeInSeconds (integer) --

        The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 5 days.

    • CreationTime (datetime) --

      A timestamp that indicates when the training job was created.

    • TrainingStartTime (datetime) --

      A timestamp that indicates when training started.

    • TrainingEndTime (datetime) --

      A timestamp that indicates when model training ended.

    • LastModifiedTime (datetime) --

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