2019/03/08 - Amazon SageMaker Service - 7 updated api methods
Changes Update sagemaker client to latest version
{'OutputConfig': {'TargetDevice': {'rk3288', 'rk3399'}}}
Starts a model compilation job. After the model has been compiled, Amazon SageMaker saves the resulting model artifacts to an Amazon Simple Storage Service (Amazon S3) bucket 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 with AWS IoT Greengrass. In that case, deploy them as an ML resource.
In the request body, you provide the following:
A name for the compilation job
Information about the input model artifacts
The output location for the compiled model and the device (target) that the model runs on
The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the model compilation job
You can also provide a Tag to track the model compilation job's resource use and costs. The response body contains the CompilationJobArn for the compiled job.
To stop a model compilation job, use StopCompilationJob. To get information about a particular model compilation job, use DescribeCompilationJob. To get information about multiple model compilation jobs, use ListCompilationJobs.
See also: AWS API Documentation
Request Syntax
client.create_compilation_job( CompilationJobName='string', RoleArn='string', InputConfig={ 'S3Uri': 'string', 'DataInputConfig': 'string', 'Framework': 'TENSORFLOW'|'MXNET'|'ONNX'|'PYTORCH'|'XGBOOST' }, OutputConfig={ 'S3OutputLocation': 'string', 'TargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288' }, StoppingCondition={ 'MaxRuntimeInSeconds': 123 } )
string
[REQUIRED]
A name for the model compilation job. The name must be unique within the AWS Region and within your AWS account.
string
[REQUIRED]
The Amazon Resource Name (ARN) of an IIAMAM role that enables Amazon SageMaker to perform tasks on your behalf.
During model compilation, Amazon SageMaker needs your permission to:
Read input data from an S3 bucket
Write model artifacts to an S3 bucket
Write logs to Amazon CloudWatch Logs
Publish metrics to Amazon CloudWatch
You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker Roles.
dict
[REQUIRED]
Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.
S3Uri (string) -- [REQUIRED]
The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).
DataInputConfig (string) -- [REQUIRED]
Specifies the name and shape of the expected data inputs for your trained model with a JSON dictionary form. The data inputs are InputConfig$Framework specific.
TensorFlow : You must specify the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.
Examples for one input:
If using the console, {"input":[1,1024,1024,3]}
If using the CLI, {\"input\":[1,1024,1024,3]}
Examples for two inputs:
If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]}
If using the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]}
MXNET/ONNX : You must specify the name and shape (NCHW format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.
Examples for one input:
If using the console, {"data":[1,3,1024,1024]}
If using the CLI, {\"data\":[1,3,1024,1024]}
Examples for two inputs:
If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]}
If using the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]}
PyTorch : You can either specify the name and shape (NCHW format) of expected data inputs in order using a dictionary format for your trained model or you can specify the shape only using a list format. The dictionary formats required for the console and CLI are different. The list formats for the console and CLI are the same.
Examples for one input in dictionary format:
If using the console, {"input0":[1,3,224,224]}
If using the CLI, {\"input0\":[1,3,224,224]}
Example for one input in list format: [[1,3,224,224]]
Examples for two inputs in dictionary format:
If using the console, {"input0":[1,3,224,224], "input1":[1,3,224,224]}
If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]}
Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]]
XGBOOST : input data name and shape are not needed.
Framework (string) -- [REQUIRED]
Identifies the framework in which the model was trained. For example: TENSORFLOW.
dict
[REQUIRED]
Provides information about the output location for the compiled model and the target device the model runs on.
S3OutputLocation (string) -- [REQUIRED]
Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix.
TargetDevice (string) -- [REQUIRED]
Identifies the device that you want to run your model on after it has been compiled. For example: ml_c5.
dict
[REQUIRED]
The duration allowed for model compilation.
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 28 days.
dict
Response Syntax
{ 'CompilationJobArn': 'string' }
Response Structure
(dict) --
CompilationJobArn (string) --
If the action is successful, the service sends back an HTTP 200 response. Amazon SageMaker returns the following data in JSON format:
CompilationJobArn : The Amazon Resource Name (ARN) of the compiled job.
{'RootAccess': 'Enabled | Disabled'}
Creates an Amazon SageMaker notebook instance. A notebook instance is a machine learning (ML) compute instance running on a Jupyter notebook.
In a CreateNotebookInstance request, specify the type of ML compute instance that you want to run. Amazon SageMaker launches the instance, installs common libraries that you can use to explore datasets for model training, and attaches an ML storage volume to the notebook instance.
Amazon SageMaker also provides a set of example notebooks. Each notebook demonstrates how to use Amazon SageMaker with a specific algorithm or with a machine learning framework.
After receiving the request, Amazon SageMaker does the following:
Creates a network interface in the Amazon SageMaker VPC.
(Option) If you specified SubnetId , Amazon SageMaker creates a network interface in your own VPC, which is inferred from the subnet ID that you provide in the input. When creating this network interface, Amazon SageMaker attaches the security group that you specified in the request to the network interface that it creates in your VPC.
Launches an EC2 instance of the type specified in the request in the Amazon SageMaker VPC. If you specified SubnetId of your VPC, Amazon SageMaker specifies both network interfaces when launching this instance. This enables inbound traffic from your own VPC to the notebook instance, assuming that the security groups allow it.
After creating the notebook instance, Amazon SageMaker returns its Amazon Resource Name (ARN).
After Amazon SageMaker creates the notebook instance, you can connect to the Jupyter server and work in Jupyter notebooks. For example, you can write code to explore a dataset that you can use for model training, train a model, host models by creating Amazon SageMaker endpoints, and validate hosted models.
For more information, see How It Works.
See also: AWS API Documentation
Request Syntax
client.create_notebook_instance( NotebookInstanceName='string', InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge', SubnetId='string', SecurityGroupIds=[ 'string', ], RoleArn='string', KmsKeyId='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], LifecycleConfigName='string', DirectInternetAccess='Enabled'|'Disabled', VolumeSizeInGB=123, AcceleratorTypes=[ 'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge', ], DefaultCodeRepository='string', AdditionalCodeRepositories=[ 'string', ], RootAccess='Enabled'|'Disabled' )
string
[REQUIRED]
The name of the new notebook instance.
string
[REQUIRED]
The type of ML compute instance to launch for the notebook instance.
string
The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.
list
The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.
(string) --
string
[REQUIRED]
When you send any requests to AWS resources from the notebook instance, Amazon SageMaker assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so Amazon SageMaker can perform these tasks. The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see Amazon SageMaker Roles.
Note
To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.
string
If you provide a AWS KMS key ID, Amazon SageMaker uses it to encrypt data at rest on the ML storage volume that is attached to your notebook instance. The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the AWS Key Management Service Developer Guide .
list
A list of tags to associate with the notebook instance. You can add tags later by using the CreateTags API.
(dict) --
Describes a tag.
Key (string) -- [REQUIRED]
The tag key.
Value (string) -- [REQUIRED]
The tag value.
string
The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.
string
Sets whether Amazon SageMaker provides internet access to the notebook instance. If you set this to Disabled this notebook instance will be able to access resources only in your VPC, and will not be able to connect to Amazon SageMaker training and endpoint services unless your configure a NAT Gateway in your VPC.
For more information, see Notebook Instances Are Internet-Enabled by Default. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.
integer
The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.
list
A list of Elastic Inference (EI) instance types to associate with this notebook instance. Currently, only one instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.
(string) --
string
A Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
list
An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
(string) --
string
Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .
Note
Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.
dict
Response Syntax
{ 'NotebookInstanceArn': 'string' }
Response Structure
(dict) --
NotebookInstanceArn (string) --
The Amazon Resource Name (ARN) of the notebook instance.
{'OutputConfig': {'TargetDevice': {'rk3288', 'rk3399'}}}
Returns information about a model compilation job.
To create a model compilation job, use CreateCompilationJob. To get information about multiple model compilation jobs, use ListCompilationJobs.
See also: AWS API Documentation
Request Syntax
client.describe_compilation_job( CompilationJobName='string' )
string
[REQUIRED]
The name of the model compilation job that you want information about.
dict
Response Syntax
{ 'CompilationJobName': 'string', 'CompilationJobArn': 'string', 'CompilationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED', 'CompilationStartTime': datetime(2015, 1, 1), 'CompilationEndTime': datetime(2015, 1, 1), 'StoppingCondition': { 'MaxRuntimeInSeconds': 123 }, 'CreationTime': datetime(2015, 1, 1), 'LastModifiedTime': datetime(2015, 1, 1), 'FailureReason': 'string', 'ModelArtifacts': { 'S3ModelArtifacts': 'string' }, 'RoleArn': 'string', 'InputConfig': { 'S3Uri': 'string', 'DataInputConfig': 'string', 'Framework': 'TENSORFLOW'|'MXNET'|'ONNX'|'PYTORCH'|'XGBOOST' }, 'OutputConfig': { 'S3OutputLocation': 'string', 'TargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288' } }
Response Structure
(dict) --
CompilationJobName (string) --
The name of the model compilation job.
CompilationJobArn (string) --
The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes to perform the model compilation job.
CompilationJobStatus (string) --
The status of the model compilation job.
CompilationStartTime (datetime) --
The time when the model compilation job started the CompilationJob instances.
You are billed for the time between this timestamp and the timestamp in the DescribeCompilationJobResponse$CompilationEndTime field. In Amazon CloudWatch Logs, the start time might be later than this time. That's because it takes time to download the compilation job, which depends on the size of the compilation job container.
CompilationEndTime (datetime) --
The time when the model compilation job on a compilation job instance ended. For a successful or stopped job, this is when the job's model artifacts have finished uploading. For a failed job, this is when Amazon SageMaker detected that the job failed.
StoppingCondition (dict) --
The duration allowed for model compilation.
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 28 days.
CreationTime (datetime) --
The time that the model compilation job was created.
LastModifiedTime (datetime) --
The time that the status of the model compilation job was last modified.
FailureReason (string) --
If a model compilation job failed, the reason it failed.
ModelArtifacts (dict) --
Information about the location in Amazon S3 that has been configured for storing the model artifacts used in the compilation job.
S3ModelArtifacts (string) --
The path of the S3 object that contains the model artifacts. For example, s3://bucket-name/keynameprefix/model.tar.gz .
RoleArn (string) --
The Amazon Resource Name (ARN) of the model compilation job.
InputConfig (dict) --
Information about the location in Amazon S3 of the input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.
S3Uri (string) --
The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).
DataInputConfig (string) --
Specifies the name and shape of the expected data inputs for your trained model with a JSON dictionary form. The data inputs are InputConfig$Framework specific.
TensorFlow : You must specify the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.
Examples for one input:
If using the console, {"input":[1,1024,1024,3]}
If using the CLI, {\"input\":[1,1024,1024,3]}
Examples for two inputs:
If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]}
If using the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]}
MXNET/ONNX : You must specify the name and shape (NCHW format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.
Examples for one input:
If using the console, {"data":[1,3,1024,1024]}
If using the CLI, {\"data\":[1,3,1024,1024]}
Examples for two inputs:
If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]}
If using the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]}
PyTorch : You can either specify the name and shape (NCHW format) of expected data inputs in order using a dictionary format for your trained model or you can specify the shape only using a list format. The dictionary formats required for the console and CLI are different. The list formats for the console and CLI are the same.
Examples for one input in dictionary format:
If using the console, {"input0":[1,3,224,224]}
If using the CLI, {\"input0\":[1,3,224,224]}
Example for one input in list format: [[1,3,224,224]]
Examples for two inputs in dictionary format:
If using the console, {"input0":[1,3,224,224], "input1":[1,3,224,224]}
If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]}
Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]]
XGBOOST : input data name and shape are not needed.
Framework (string) --
Identifies the framework in which the model was trained. For example: TENSORFLOW.
OutputConfig (dict) --
Information about the output location for the compiled model and the target device that the model runs on.
S3OutputLocation (string) --
Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix.
TargetDevice (string) --
Identifies the device that you want to run your model on after it has been compiled. For example: ml_c5.
{'RootAccess': 'Enabled | Disabled'}
Returns information about a notebook instance.
See also: AWS API Documentation
Request Syntax
client.describe_notebook_instance( NotebookInstanceName='string' )
string
[REQUIRED]
The name of the notebook instance that you want information about.
dict
Response Syntax
{ 'NotebookInstanceArn': 'string', 'NotebookInstanceName': 'string', 'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating', 'FailureReason': 'string', 'Url': 'string', 'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge', 'SubnetId': 'string', 'SecurityGroups': [ 'string', ], 'RoleArn': 'string', 'KmsKeyId': 'string', 'NetworkInterfaceId': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'CreationTime': datetime(2015, 1, 1), 'NotebookInstanceLifecycleConfigName': 'string', 'DirectInternetAccess': 'Enabled'|'Disabled', 'VolumeSizeInGB': 123, 'AcceleratorTypes': [ 'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge', ], 'DefaultCodeRepository': 'string', 'AdditionalCodeRepositories': [ 'string', ], 'RootAccess': 'Enabled'|'Disabled' }
Response Structure
(dict) --
NotebookInstanceArn (string) --
The Amazon Resource Name (ARN) of the notebook instance.
NotebookInstanceName (string) --
The name of the Amazon SageMaker notebook instance.
NotebookInstanceStatus (string) --
The status of the notebook instance.
FailureReason (string) --
If status is Failed , the reason it failed.
Url (string) --
The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.
InstanceType (string) --
The type of ML compute instance running on the notebook instance.
SubnetId (string) --
The ID of the VPC subnet.
SecurityGroups (list) --
The IDs of the VPC security groups.
(string) --
RoleArn (string) --
The Amazon Resource Name (ARN) of the IAM role associated with the instance.
KmsKeyId (string) --
The AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the instance.
NetworkInterfaceId (string) --
The network interface IDs that Amazon SageMaker created at the time of creating the instance.
LastModifiedTime (datetime) --
A timestamp. Use this parameter to retrieve the time when the notebook instance was last modified.
CreationTime (datetime) --
A timestamp. Use this parameter to return the time when the notebook instance was created
NotebookInstanceLifecycleConfigName (string) --
Returns the name of a notebook instance lifecycle configuration.
For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance
DirectInternetAccess (string) --
Describes whether Amazon SageMaker provides internet access to the notebook instance. If this value is set to Disabled , the notebook instance does not have internet access, and cannot connect to Amazon SageMaker training and endpoint services.
For more information, see Notebook Instances Are Internet-Enabled by Default.
VolumeSizeInGB (integer) --
The size, in GB, of the ML storage volume attached to the notebook instance.
AcceleratorTypes (list) --
A list of the Elastic Inference (EI) instance types associated with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.
(string) --
DefaultCodeRepository (string) --
The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
AdditionalCodeRepositories (list) --
An array of up to three Git repositories associated with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
(string) --
RootAccess (string) --
Whether root access is enabled or disabled for users of the notebook instance.
Note
Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.
{'CompilationJobSummaries': {'CompilationTargetDevice': {'rk3288', 'rk3399'}}}
Lists model compilation jobs that satisfy various filters.
To create a model compilation job, use CreateCompilationJob. To get information about a particular model compilation job you have created, use DescribeCompilationJob.
See also: AWS API Documentation
Request Syntax
client.list_compilation_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'|'STARTING'|'STOPPING'|'STOPPED', SortBy='Name'|'CreationTime'|'Status', SortOrder='Ascending'|'Descending' )
string
If the result of the previous ListCompilationJobs request was truncated, the response includes a NextToken . To retrieve the next set of model compilation jobs, use the token in the next request.
integer
The maximum number of model compilation jobs to return in the response.
datetime
A filter that returns the model compilation jobs that were created after a specified time.
datetime
A filter that returns the model compilation jobs that were created before a specified time.
datetime
A filter that returns the model compilation jobs that were modified after a specified time.
datetime
A filter that returns the model compilation jobs that were modified before a specified time.
string
A filter that returns the model compilation jobs whose name contains a specified string.
string
A filter that retrieves model compilation jobs with a specific DescribeCompilationJobResponse$CompilationJobStatus status.
string
The field by which to sort results. The default is CreationTime .
string
The sort order for results. The default is Ascending .
dict
Response Syntax
{ 'CompilationJobSummaries': [ { 'CompilationJobName': 'string', 'CompilationJobArn': 'string', 'CreationTime': datetime(2015, 1, 1), 'CompilationStartTime': datetime(2015, 1, 1), 'CompilationEndTime': datetime(2015, 1, 1), 'CompilationTargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288', 'LastModifiedTime': datetime(2015, 1, 1), 'CompilationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
CompilationJobSummaries (list) --
An array of CompilationJobSummary objects, each describing a model compilation job.
(dict) --
A summary of a model compilation job.
CompilationJobName (string) --
The name of the model compilation job that you want a summary for.
CompilationJobArn (string) --
The Amazon Resource Name (ARN) of the model compilation job.
CreationTime (datetime) --
The time when the model compilation job was created.
CompilationStartTime (datetime) --
The time when the model compilation job started.
CompilationEndTime (datetime) --
The time when the model compilation job completed.
CompilationTargetDevice (string) --
The type of device that the model will run on after compilation has completed.
LastModifiedTime (datetime) --
The time when the model compilation job was last modified.
CompilationJobStatus (string) --
The status of the model compilation job.
NextToken (string) --
If the response is truncated, Amazon SageMaker returns this NextToken . To retrieve the next set of model compilation jobs, use this token in the next request.
{'Results': {'TrainingJob': {'EnableInterContainerTrafficEncryption': 'boolean'}}}
Finds Amazon SageMaker resources that match a search query. Matching resource objects are returned as a list of SearchResult objects in the response. You can sort the search results by any resource property in a ascending or descending order.
You can query against the following value types: numerical, text, Booleans, and timestamps.
See also: AWS API Documentation
Request Syntax
client.search( Resource='TrainingJob', SearchExpression={ 'Filters': [ { 'Name': 'string', 'Operator': 'Equals'|'NotEquals'|'GreaterThan'|'GreaterThanOrEqualTo'|'LessThan'|'LessThanOrEqualTo'|'Contains', 'Value': 'string' }, ], 'NestedFilters': [ { 'NestedPropertyName': 'string', 'Filters': [ { 'Name': 'string', 'Operator': 'Equals'|'NotEquals'|'GreaterThan'|'GreaterThanOrEqualTo'|'LessThan'|'LessThanOrEqualTo'|'Contains', 'Value': 'string' }, ] }, ], 'SubExpressions': [ {'... recursive ...'}, ], 'Operator': 'And'|'Or' }, SortBy='string', SortOrder='Ascending'|'Descending', NextToken='string', MaxResults=123 )
string
[REQUIRED]
The name of the Amazon SageMaker resource to search for. Currently, the only valid Resource value is TrainingJob .
dict
A Boolean conditional statement. Resource objects must satisfy this condition to be included in search results. You must provide at least one subexpression, filter, or nested filter. The maximum number of recursive SubExpressions , NestedFilters , and Filters that can be included in a SearchExpression object is 50.
Filters (list) --
A list of filter objects.
(dict) --
A conditional statement for a search expression that includes a Boolean operator, a resource property, and a value.
If you don't specify an Operator and a Value , the filter searches for only the specified property. For example, defining a Filter for the FailureReason for the TrainingJob Resource searches for training job objects that have a value in the FailureReason field.
If you specify a Value , but not an Operator , Amazon SageMaker uses the equals operator as the default.
In search, there are several property types:
Metrics
To define a metric filter, enter a value using the form "Metrics.<name>" , where <name> is a metric name. For example, the following filter searches for training jobs with an "accuracy" metric greater than "0.9" :
{
"Name": "Metrics.accuracy",
"Operator": "GREATER_THAN",
"Value": "0.9"
}
HyperParameters
To define a hyperparameter filter, enter a value with the form "HyperParameters.<name>" . Decimal hyperparameter values are treated as a decimal in a comparison if the specified Value is also a decimal value. If the specified Value is an integer, the decimal hyperparameter values are treated as integers. For example, the following filter is satisfied by training jobs with a "learning_rate" hyperparameter that is less than "0.5" :
{
"Name": "HyperParameters.learning_rate",
"Operator": "LESS_THAN",
"Value": "0.5"
}
Tags
To define a tag filter, enter a value with the form "Tags.<key>" .
Name (string) -- [REQUIRED]
A property name. For example, TrainingJobName . For the list of valid property names returned in a search result for each supported resource, see TrainingJob properties. You must specify a valid property name for the resource.
Operator (string) --
A Boolean binary operator that is used to evaluate the filter. The operator field contains one of the following values:
Equals
The specified resource in Name equals the specified Value .
NotEquals
The specified resource in Name does not equal the specified Value .
GreaterThan
The specified resource in Name is greater than the specified Value . Not supported for text-based properties.
GreaterThanOrEqualTo
The specified resource in Name is greater than or equal to the specified Value . Not supported for text-based properties.
LessThan
The specified resource in Name is less than the specified Value . Not supported for text-based properties.
LessThanOrEqualTo
The specified resource in Name is less than or equal to the specified Value . Not supported for text-based properties.
Contains
Only supported for text-based properties. The word-list of the property contains the specified Value .
If you have specified a filter Value , the default is Equals .
Value (string) --
A value used with Resource and Operator to determine if objects satisfy the filter's condition. For numerical properties, Value must be an integer or floating-point decimal. For timestamp properties, Value must be an ISO 8601 date-time string of the following format: YYYY-mm-dd'T'HH:MM:SS .
NestedFilters (list) --
A list of nested filter objects.
(dict) --
Defines a list of NestedFilters objects. To satisfy the conditions specified in the NestedFilters call, a resource must satisfy the conditions of all of the filters.
For example, you could define a NestedFilters using the training job's InputDataConfig property to filter on Channel objects.
A NestedFilters object contains multiple filters. For example, to find all training jobs whose name contains train and that have cat/data in their S3Uri (specified in InputDataConfig ), you need to create a NestedFilters object that specifies the InputDataConfig property with the following Filter objects:
'{Name:"InputDataConfig.ChannelName", "Operator":"EQUALS", "Value":"train"}',
'{Name:"InputDataConfig.DataSource.S3DataSource.S3Uri", "Operator":"CONTAINS", "Value":"cat/data"}'
NestedPropertyName (string) -- [REQUIRED]
The name of the property to use in the nested filters. The value must match a listed property name, such as InputDataConfig .
Filters (list) -- [REQUIRED]
A list of filters. Each filter acts on a property. Filters must contain at least one Filters value. For example, a NestedFilters call might include a filter on the PropertyName parameter of the InputDataConfig property: InputDataConfig.DataSource.S3DataSource.S3Uri .
(dict) --
A conditional statement for a search expression that includes a Boolean operator, a resource property, and a value.
If you don't specify an Operator and a Value , the filter searches for only the specified property. For example, defining a Filter for the FailureReason for the TrainingJob Resource searches for training job objects that have a value in the FailureReason field.
If you specify a Value , but not an Operator , Amazon SageMaker uses the equals operator as the default.
In search, there are several property types:
Metrics
To define a metric filter, enter a value using the form "Metrics.<name>" , where <name> is a metric name. For example, the following filter searches for training jobs with an "accuracy" metric greater than "0.9" :
{
"Name": "Metrics.accuracy",
"Operator": "GREATER_THAN",
"Value": "0.9"
}
HyperParameters
To define a hyperparameter filter, enter a value with the form "HyperParameters.<name>" . Decimal hyperparameter values are treated as a decimal in a comparison if the specified Value is also a decimal value. If the specified Value is an integer, the decimal hyperparameter values are treated as integers. For example, the following filter is satisfied by training jobs with a "learning_rate" hyperparameter that is less than "0.5" :
{
"Name": "HyperParameters.learning_rate",
"Operator": "LESS_THAN",
"Value": "0.5"
}
Tags
To define a tag filter, enter a value with the form "Tags.<key>" .
Name (string) -- [REQUIRED]
A property name. For example, TrainingJobName . For the list of valid property names returned in a search result for each supported resource, see TrainingJob properties. You must specify a valid property name for the resource.
Operator (string) --
A Boolean binary operator that is used to evaluate the filter. The operator field contains one of the following values:
Equals
The specified resource in Name equals the specified Value .
NotEquals
The specified resource in Name does not equal the specified Value .
GreaterThan
The specified resource in Name is greater than the specified Value . Not supported for text-based properties.
GreaterThanOrEqualTo
The specified resource in Name is greater than or equal to the specified Value . Not supported for text-based properties.
LessThan
The specified resource in Name is less than the specified Value . Not supported for text-based properties.
LessThanOrEqualTo
The specified resource in Name is less than or equal to the specified Value . Not supported for text-based properties.
Contains
Only supported for text-based properties. The word-list of the property contains the specified Value .
If you have specified a filter Value , the default is Equals .
Value (string) --
A value used with Resource and Operator to determine if objects satisfy the filter's condition. For numerical properties, Value must be an integer or floating-point decimal. For timestamp properties, Value must be an ISO 8601 date-time string of the following format: YYYY-mm-dd'T'HH:MM:SS .
SubExpressions (list) --
A list of search expression objects.
(dict) --
A multi-expression that searches for the specified resource or resources in a search. All resource objects that satisfy the expression's condition are included in the search results. You must specify at least one subexpression, filter, or nested filter. A SearchExpression can contain up to twenty elements.
A SearchExpression contains the following components:
A list of Filter objects. Each filter defines a simple Boolean expression comprised of a resource property name, Boolean operator, and value.
A list of NestedFilter objects. Each nested filter defines a list of Boolean expressions using a list of resource properties. A nested filter is satisfied if a single object in the list satisfies all Boolean expressions.
A list of SearchExpression objects. A search expression object can be nested in a list of search expression objects.
A Boolean operator: And or Or .
Operator (string) --
A Boolean operator used to evaluate the search expression. If you want every conditional statement in all lists to be satisfied for the entire search expression to be true, specify And . If only a single conditional statement needs to be true for the entire search expression to be true, specify Or . The default value is And .
string
The name of the resource property used to sort the SearchResults . The default is LastModifiedTime .
string
How SearchResults are ordered. Valid values are Ascending or Descending . The default is Descending .
string
If more than MaxResults resource objects match the specified SearchExpression , the SearchResponse includes a NextToken . The NextToken can be passed to the next SearchRequest to continue retrieving results for the specified SearchExpression and Sort parameters.
integer
The maximum number of results to return in a SearchResponse .
dict
Response Syntax
{ 'Results': [ { 'TrainingJob': { 'TrainingJobName': 'string', 'TrainingJobArn': 'string', 'TuningJobArn': 'string', 'LabelingJobArn': 'string', 'ModelArtifacts': { 'S3ModelArtifacts': 'string' }, 'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped', 'SecondaryStatus': 'Starting'|'LaunchingMLInstances'|'PreparingTrainingStack'|'Downloading'|'DownloadingTrainingImage'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed', 'FailureReason': 'string', 'HyperParameters': { 'string': 'string' }, 'AlgorithmSpecification': { 'TrainingImage': 'string', 'AlgorithmName': 'string', 'TrainingInputMode': 'Pipe'|'File', 'MetricDefinitions': [ { 'Name': 'string', 'Regex': 'string' }, ] }, 'RoleArn': 'string', 'InputDataConfig': [ { 'ChannelName': 'string', 'DataSource': { 'S3DataSource': { 'S3DataType': 'ManifestFile'|'S3Prefix'|'AugmentedManifestFile', 'S3Uri': 'string', 'S3DataDistributionType': 'FullyReplicated'|'ShardedByS3Key', 'AttributeNames': [ 'string', ] } }, 'ContentType': 'string', 'CompressionType': 'None'|'Gzip', 'RecordWrapperType': 'None'|'RecordIO', 'InputMode': 'Pipe'|'File', 'ShuffleConfig': { 'Seed': 123 } }, ], 'OutputDataConfig': { 'KmsKeyId': 'string', 'S3OutputPath': 'string' }, 'ResourceConfig': { 'InstanceType': 'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.large'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'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' }, 'VpcConfig': { 'SecurityGroupIds': [ 'string', ], 'Subnets': [ 'string', ] }, 'StoppingCondition': { 'MaxRuntimeInSeconds': 123 }, 'CreationTime': datetime(2015, 1, 1), 'TrainingStartTime': datetime(2015, 1, 1), 'TrainingEndTime': datetime(2015, 1, 1), 'LastModifiedTime': datetime(2015, 1, 1), 'SecondaryStatusTransitions': [ { 'Status': 'Starting'|'LaunchingMLInstances'|'PreparingTrainingStack'|'Downloading'|'DownloadingTrainingImage'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusMessage': 'string' }, ], 'FinalMetricDataList': [ { 'MetricName': 'string', 'Value': ..., 'Timestamp': datetime(2015, 1, 1) }, ], 'EnableNetworkIsolation': True|False, 'EnableInterContainerTrafficEncryption': True|False, 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Results (list) --
A list of SearchResult objects.
(dict) --
An individual search result record that contains a single resource object.
TrainingJob (dict) --
A TrainingJob object that is returned as part of a Search request.
TrainingJobName (string) --
The name of the training job.
TrainingJobArn (string) --
The Amazon Resource Name (ARN) of the training job.
TuningJobArn (string) --
The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.
LabelingJobArn (string) --
The Amazon Resource Name (ARN) of the labeling 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.
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 .
SecondaryStatus (string) --
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.
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.
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.
Warning
Valid values for SecondaryStatus are subject to change.
We no longer support the following secondary statuses:
LaunchingMLInstances
PreparingTrainingStack
DownloadingTrainingImage
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 docker registry paths for built-in algorithms, see Algorithms Provided by Amazon SageMaker: Common Parameters. Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.
AlgorithmName (string) --
The name of the algorithm resource to use for the training job. This must be an algorithm resource that you created or subscribe to on AWS Marketplace. If you specify a value for this parameter, you can't specify a value for TrainingImage .
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 accommodate 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.
MetricDefinitions (list) --
A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs. Amazon SageMaker publishes each metric to Amazon CloudWatch.
(dict) --
Specifies a metric that the training algorithm writes to stderr or stdout . Amazon SageMakerhyperparameter tuning captures all defined metrics. You specify one metric that a hyperparameter tuning job uses as its objective metric to choose the best training job.
Name (string) --
The name of the metric.
Regex (string) --
A regular expression that searches the output of a training job and gets the value of the metric. For more information about using regular expressions to define metrics, see Defining Objective Metrics.
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 that match 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.
If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .
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-2 ... The complete set of s3uris in this manifest is the input data for the channel for this datasource. The object that each s3uris points to must be 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.
AttributeNames (list) --
A list of one or more attribute names to use that are found in a specified augmented manifest file.
(string) --
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 this case, Amazon 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.
InputMode (string) --
(Optional) The input mode to use for the data channel in a training job. If you don't set a value for InputMode , Amazon SageMaker uses the value set for TrainingInputMode . Use this parameter to override the TrainingInputMode setting in a AlgorithmSpecification request when you have a channel that needs a different input mode from the training job's general setting. To download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned ML storage volume, and mount the directory to a Docker volume, use File input mode. To stream data directly from Amazon S3 to the container, choose Pipe input mode.
To use a model for incremental training, choose File input model.
ShuffleConfig (dict) --
A configuration for a shuffle option for input data in a channel. If you use S3Prefix for S3DataType , this shuffles the results of the S3 key prefix matches. If you use ManifestFile , the order of the S3 object references in the ManifestFile is shuffled. If you use AugmentedManifestFile , the order of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling order is determined using the Seed value.
For Pipe input mode, shuffling is done at the start of every epoch. With large datasets this ensures that the order of the training data is different for each epoch, it helps reduce bias and possible overfitting. In a multi-node training job when ShuffleConfig is combined with S3DataDistributionType of ShardedByS3Key , the data is shuffled across nodes so that the content sent to a particular node on the first epoch might be sent to a different node on the second epoch.
Seed (integer) --
Determines the shuffling order in ShuffleConfig value.
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. The KmsKeyId can be any of the following formats:
// KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"
// Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
// KMS Key Alias "alias/ExampleAlias"
// Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.
The KMS key policy must grant permission to the IAM role that you specify in your CreateTramsformJob request. For more information, see 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 AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. The VolumeKmsKeyId can be any of the following formats:
// KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"
// Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
VpcConfig (dict) --
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.
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.
(string) --
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 28 days.
CreationTime (datetime) --
A timestamp that indicates when the training job was created.
TrainingStartTime (datetime) --
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.
TrainingEndTime (datetime) --
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.
LastModifiedTime (datetime) --
A timestamp that indicates when the status of the training job was last modified.
SecondaryStatusTransitions (list) --
A history of all of the secondary statuses that the training job has transitioned through.
(dict) --
An array element of DescribeTrainingJobResponse$SecondaryStatusTransitions. It provides additional details about a status that the training job has transitioned through. A training job can be in one of several states, for example, starting, downloading, training, or uploading. Within each state, there are a number of intermediate states. For example, within the starting state, Amazon SageMaker could be starting the training job or launching the ML instances. These transitional states are referred to as the job's secondary status.
Status (string) --
Contains a secondary status information from a training job.
Status might be one of the following secondary statuses:
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.
We no longer support the following secondary statuses:
LaunchingMLInstances
PreparingTrainingStack
DownloadingTrainingImage
StartTime (datetime) --
A timestamp that shows when the training job transitioned to the current secondary status state.
EndTime (datetime) --
A timestamp that shows when the training job transitioned out of this secondary status state into another secondary status state or when the training job has ended.
StatusMessage (string) --
A detailed description of the progress within a secondary status.
Amazon SageMaker provides secondary statuses and status messages that apply to each of them:
Starting
Starting the training job.
Launching requested ML instances.
Insufficient capacity error from EC2 while launching instances, retrying!
Launched instance was unhealthy, replacing it!
Preparing the instances for training.
Training
Downloading the training image.
Training image download completed. Training in progress.
Warning
Status messages are subject to change. Therefore, we recommend not including them in code that programmatically initiates actions. For examples, don't use status messages in if statements.
To have an overview of your training job's progress, view TrainingJobStatus and SecondaryStatus in DescribeTrainingJobResponse, and StatusMessage together. For example, at the start of a training job, you might see the following:
TrainingJobStatus - InProgress
SecondaryStatus - Training
StatusMessage - Downloading the training image
FinalMetricDataList (list) --
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.
(dict) --
The name, value, and date and time of a metric that was emitted to Amazon CloudWatch.
MetricName (string) --
The name of the metric.
Value (float) --
The value of the metric.
Timestamp (datetime) --
The date and time that the algorithm emitted the metric.
EnableNetworkIsolation (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.
EnableInterContainerTrafficEncryption (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.
Tags (list) --
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) --
The tag key.
Value (string) --
The tag value.
NextToken (string) --
If the result of the previous Search request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request.
{'RootAccess': 'Enabled | Disabled'}
Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements. You can also update the VPC security groups.
See also: AWS API Documentation
Request Syntax
client.update_notebook_instance( NotebookInstanceName='string', InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge', RoleArn='string', LifecycleConfigName='string', DisassociateLifecycleConfig=True|False, VolumeSizeInGB=123, DefaultCodeRepository='string', AdditionalCodeRepositories=[ 'string', ], AcceleratorTypes=[ 'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge', ], DisassociateAcceleratorTypes=True|False, DisassociateDefaultCodeRepository=True|False, DisassociateAdditionalCodeRepositories=True|False, RootAccess='Enabled'|'Disabled' )
string
[REQUIRED]
The name of the notebook instance to update.
string
The Amazon ML compute instance type.
string
The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access the notebook instance. For more information, see Amazon SageMaker Roles.
Note
To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.
string
The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.
boolean
Set to true to remove the notebook instance lifecycle configuration currently associated with the notebook instance.
integer
The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.
string
The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
list
An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.
(string) --
list
A list of the Elastic Inference (EI) instance types to associate with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.
(string) --
boolean
A list of the Elastic Inference (EI) instance types to remove from this notebook instance.
boolean
The name or URL of the default Git repository to remove from this notebook instance.
boolean
A list of names or URLs of the default Git repositories to remove from this notebook instance.
string
Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .
Note
If you set this to Disabled , users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.
dict
Response Syntax
{}
Response Structure
(dict) --