compilation_jobs
Creates, updates, deletes, gets or lists a compilation_jobs resource.
Overview
| Name | compilation_jobs |
| Type | Resource |
| Id | aws.sagemaker.compilation_jobs |
Fields
The following fields are returned by SELECT queries:
- describe_compilation_job
- list_compilation_jobs
| Name | Datatype | Description |
|---|---|---|
compilation_end_time | string (date-time) | 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 AI detected that the job failed. |
compilation_job_arn | string | The Amazon Resource Name (ARN) of the model compilation job. (pattern: <code>arn:aws[a-z-]:sagemaker:[a-z0-9-]:[0-9]{12}:compilation-job/.*</code>) |
compilation_job_name | string | The name of the model compilation job. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
compilation_job_status | string | The status of the model compilation job. (INPROGRESS, COMPLETED, FAILED, STARTING, STOPPING, STOPPED) |
compilation_start_time | string (date-time) | 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 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. |
creation_time | string (date-time) | The time that the model compilation job was created. |
derived_information | object | Information that SageMaker Neo automatically derived about the model. |
failure_reason | string | If a model compilation job failed, the reason it failed. |
inference_image | string | The inference image to use when compiling a model. Specify an image only if the target device is a cloud instance. |
input_config | object | 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. |
last_modified_time | string (date-time) | The time that the status of the model compilation job was last modified. |
model_artifacts | object | Information about the location in Amazon S3 that has been configured for storing the model artifacts used in the compilation job. |
model_digests | object | Provides a BLAKE2 hash value that identifies the compiled model artifacts in Amazon S3. |
model_package_version_arn | string | The Amazon Resource Name (ARN) of the versioned model package that was provided to SageMaker Neo when you initiated a compilation job. (pattern: <code>arn:aws[a-z-]*:sagemaker:[a-z0-9-]{9,16}:[0-9]{12}:model-package/[\S]{1,2048}</code>) |
output_config | object | Information about the output location for the compiled model and the target device that the model runs on. |
role_arn | string | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI assumes to perform the model compilation job. (pattern: <code>arn:aws[a-z-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@-_/]+</code>) |
stopping_condition | object | Specifies a limit to how long a job can run. When the job reaches the time limit, SageMaker ends the job. Use this API to cap costs. To stop a training job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost. The training algorithms provided by SageMaker automatically save the intermediate results of a model training job when possible. This attempt to save artifacts is only a best effort case as model might not be in a state from which it can be saved. For example, if training has just started, the model might not be ready to save. When saved, this intermediate data is a valid model artifact. You can use it to create a model with CreateModel. The Neural Topic Model (NTM) currently does not support saving intermediate model artifacts. When training NTMs, make sure that the maximum runtime is sufficient for the training job to complete. |
vpc_config | object | A VpcConfig object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see Protect Compilation Jobs by Using an Amazon Virtual Private Cloud. |
| Name | Datatype | Description |
|---|---|---|
compilation_end_time | string (date-time) | The time when the model compilation job completed. |
compilation_job_arn | string | The Amazon Resource Name (ARN) of the model compilation job. (pattern: <code>arn:aws[a-z-]:sagemaker:[a-z0-9-]:[0-9]{12}:compilation-job/.*</code>) |
compilation_job_name | string | The name of the model compilation job that you want a summary for. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
compilation_job_status | string | The status of the model compilation job. (INPROGRESS, COMPLETED, FAILED, STARTING, STOPPING, STOPPED) |
compilation_start_time | string (date-time) | The time when the model compilation job started. |
compilation_target_device | string | The type of device that the model will run on after the compilation job has completed. (lambda, ml_m4, ml_m5, ml_m6g, ml_c4, ml_c5, ml_c6g, ml_p2, ml_p3, ml_g4dn, ml_inf1, ml_inf2, ml_trn1, ml_eia2, jetson_tx1, jetson_tx2, jetson_nano, jetson_xavier, rasp3b, rasp4b, imx8qm, deeplens, rk3399, rk3288, aisage, sbe_c, qcs605, qcs603, sitara_am57x, amba_cv2, amba_cv22, amba_cv25, x86_win32, x86_win64, coreml, jacinto_tda4vm, imx8mplus) |
compilation_target_platform_accelerator | string | The type of accelerator that the model will run on after the compilation job has completed. (INTEL_GRAPHICS, MALI, NVIDIA, NNA) |
compilation_target_platform_arch | string | The type of architecture that the model will run on after the compilation job has completed. (X86_64, X86, ARM64, ARM_EABI, ARM_EABIHF) |
compilation_target_platform_os | string | The type of OS that the model will run on after the compilation job has completed. (ANDROID, LINUX) |
creation_time | string (date-time) | The time when the model compilation job was created. |
last_modified_time | string (date-time) | The time when the model compilation job was last modified. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_compilation_job | select | region | 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. | |
list_compilation_jobs | select | region | 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. | |
create_compilation_job | insert | region, CompilationJobName, RoleArn, OutputConfig, StoppingCondition | Starts a model compilation job. After the model has been compiled, Amazon SageMaker AI 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 AI hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts with Amazon Web Services 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 AI 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. | |
delete_compilation_job | delete | region | Deletes the specified compilation job. This action deletes only the compilation job resource in Amazon SageMaker AI. It doesn't delete other resources that are related to that job, such as the model artifacts that the job creates, the compilation logs in CloudWatch, the compiled model, or the IAM role. You can delete a compilation job only if its current status is COMPLETED, FAILED, or STOPPED. If the job status is STARTING or INPROGRESS, stop the job, and then delete it after its status becomes STOPPED. | |
stop_compilation_job | exec | region, CompilationJobName | Stops a model compilation job. To stop a job, Amazon SageMaker AI sends the algorithm the SIGTERM signal. This gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL signal. When it receives a StopCompilationJob request, Amazon SageMaker AI changes the CompilationJobStatus of the job to Stopping. After Amazon SageMaker stops the job, it sets the CompilationJobStatus to Stopped. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_compilation_job
- list_compilation_jobs
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.
SELECT
compilation_end_time,
compilation_job_arn,
compilation_job_name,
compilation_job_status,
compilation_start_time,
creation_time,
derived_information,
failure_reason,
inference_image,
input_config,
last_modified_time,
model_artifacts,
model_digests,
model_package_version_arn,
output_config,
role_arn,
stopping_condition,
vpc_config
FROM aws.sagemaker.compilation_jobs
WHERE region = '{{ region }}' -- required
;
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.
SELECT
compilation_end_time,
compilation_job_arn,
compilation_job_name,
compilation_job_status,
compilation_start_time,
compilation_target_device,
compilation_target_platform_accelerator,
compilation_target_platform_arch,
compilation_target_platform_os,
creation_time,
last_modified_time
FROM aws.sagemaker.compilation_jobs
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_compilation_job
- Manifest
Starts a model compilation job. After the model has been compiled, Amazon SageMaker AI 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 AI hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts with Amazon Web Services 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 AI 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.
INSERT INTO aws.sagemaker.compilation_jobs (
CompilationJobName,
RoleArn,
ModelPackageVersionArn,
InputConfig,
OutputConfig,
VpcConfig,
StoppingCondition,
Tags,
region
)
SELECT
'{{ CompilationJobName }}' /* required */,
'{{ RoleArn }}' /* required */,
'{{ ModelPackageVersionArn }}',
'{{ InputConfig }}',
'{{ OutputConfig }}' /* required */,
'{{ VpcConfig }}',
'{{ StoppingCondition }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
compilation_job_arn
;
# Description fields are for documentation purposes
- name: compilation_jobs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the compilation_jobs resource.
- name: CompilationJobName
value: "{{ CompilationJobName }}"
description: |
A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.
- name: RoleArn
value: "{{ RoleArn }}"
description: |
The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf. During model compilation, Amazon SageMaker AI 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 AI, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker AI Roles.
- name: ModelPackageVersionArn
value: "{{ ModelPackageVersionArn }}"
description: |
The Amazon Resource Name (ARN) of a versioned model package. Provide either a ModelPackageVersionArn or an InputConfig object in the request syntax. The presence of both objects in the CreateCompilationJob request will return an exception.
- name: InputConfig
description: |
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.
value:
S3Uri: "{{ S3Uri }}"
DataInputConfig: "{{ DataInputConfig }}"
Framework: "{{ Framework }}"
FrameworkVersion: "{{ FrameworkVersion }}"
- name: OutputConfig
description: |
Provides information about the output location for the compiled model and the target device the model runs on.
value:
S3OutputLocation: "{{ S3OutputLocation }}"
TargetDevice: "{{ TargetDevice }}"
TargetPlatform:
Os: "{{ Os }}"
Arch: "{{ Arch }}"
Accelerator: "{{ Accelerator }}"
CompilerOptions: "{{ CompilerOptions }}"
KmsKeyId: "{{ KmsKeyId }}"
- name: VpcConfig
description: |
A VpcConfig object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see Protect Compilation Jobs by Using an Amazon Virtual Private Cloud.
value:
SecurityGroupIds:
- "{{ SecurityGroupIds }}"
Subnets:
- "{{ Subnets }}"
- name: StoppingCondition
description: |
Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.
value:
MaxRuntimeInSeconds: {{ MaxRuntimeInSeconds }}
MaxWaitTimeInSeconds: {{ MaxWaitTimeInSeconds }}
MaxPendingTimeInSeconds: {{ MaxPendingTimeInSeconds }}
- name: Tags
description: |
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
DELETE examples
- delete_compilation_job
Deletes the specified compilation job. This action deletes only the compilation job resource in Amazon SageMaker AI. It doesn't delete other resources that are related to that job, such as the model artifacts that the job creates, the compilation logs in CloudWatch, the compiled model, or the IAM role. You can delete a compilation job only if its current status is COMPLETED, FAILED, or STOPPED. If the job status is STARTING or INPROGRESS, stop the job, and then delete it after its status becomes STOPPED.
DELETE FROM aws.sagemaker.compilation_jobs
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- stop_compilation_job
Stops a model compilation job. To stop a job, Amazon SageMaker AI sends the algorithm the SIGTERM signal. This gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL signal. When it receives a StopCompilationJob request, Amazon SageMaker AI changes the CompilationJobStatus of the job to Stopping. After Amazon SageMaker stops the job, it sets the CompilationJobStatus to Stopped.
EXEC aws.sagemaker.compilation_jobs.stop_compilation_job
@region='{{ region }}' --required
@@json=
'{
"CompilationJobName": "{{ CompilationJobName }}"
}'
;