AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Amazon SageMaker Service CreateOptimizationJob API operation.

Syntax

New-SMOptimizationJob
-ModelAccessConfig_AcceptEula <Boolean>
-DeploymentInstanceType <OptimizationJobDeploymentInstanceType>
-OutputConfig_KmsKeyId <String>
-StoppingCondition_MaxPendingTimeInSecond <Int32>
-StoppingCondition_MaxRuntimeInSecond <Int32>
-StoppingCondition_MaxWaitTimeInSecond <Int32>
-OptimizationConfig <OptimizationConfig[]>
-OptimizationEnvironment <Hashtable>
-OptimizationJobName <String>
-RoleArn <String>
-OutputConfig_S3OutputLocation <String>
-S3_S3Uri <String>
-VpcConfig_SecurityGroupId <String[]>
-VpcConfig_Subnet <String[]>
-Tag <Tag[]>
-Select <String>
-Force <SwitchParameter>
-ClientConfig <AmazonSageMakerConfig>

Description

Creates a job that optimizes a model for inference performance. To create the job, you provide the location of a source model, and you provide the settings for the optimization techniques that you want the job to apply. When the job completes successfully, SageMaker uploads the new optimized model to the output destination that you specify. For more information about how to use this action, and about the supported optimization techniques, see Optimize model inference with Amazon SageMaker.

Parameters

-ClientConfig <AmazonSageMakerConfig>
Amazon.PowerShell.Cmdlets.SM.AmazonSageMakerClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeploymentInstanceType <OptimizationJobDeploymentInstanceType>
The type of instance that hosts the optimized model that you create with the optimization job.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ModelAccessConfig_AcceptEula <Boolean>
Specifies agreement to the model end-user license agreement (EULA). The AcceptEula value must be explicitly defined as True in order to accept the EULA that this model requires. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesModelSource_S3_ModelAccessConfig_AcceptEula
-OptimizationConfig <OptimizationConfig[]>
Settings for each of the optimization techniques that the job applies. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOptimizationConfigs
-OptimizationEnvironment <Hashtable>
The environment variables to set in the model container. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OptimizationJobName <String>
A custom name for the new optimization job.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-OutputConfig_KmsKeyId <String>
The Amazon Resource Name (ARN) of a key in Amazon Web Services KMS. SageMaker uses they key to encrypt the artifacts of the optimized model when SageMaker uploads the model to Amazon S3.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OutputConfig_S3OutputLocation <String>
The Amazon S3 URI for where to store the optimized model that you create with an optimization job.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-RoleArn <String>
The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf. During model optimization, 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.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-S3_S3Uri <String>
An Amazon S3 URI that locates a source model to optimize with an optimization job.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesModelSource_S3_S3Uri
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'OptimizationJobArn'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.SageMaker.Model.CreateOptimizationJobResponse). Specifying the name of a property of type Amazon.SageMaker.Model.CreateOptimizationJobResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-StoppingCondition_MaxPendingTimeInSecond <Int32>
The maximum length of time, in seconds, that a training or compilation job can be pending before it is stopped.When working with training jobs that use capacity from training plans, not all Pending job states count against the MaxPendingTimeInSeconds limit. The following scenarios do not increment the MaxPendingTimeInSeconds counter:
  • The plan is in a Scheduled state: Jobs queued (in Pending status) before a plan's start date (waiting for scheduled start time)
  • Between capacity reservations: Jobs temporarily back to Pending status between two capacity reservation periods
MaxPendingTimeInSeconds only increments when jobs are actively waiting for capacity in an Active plan.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoppingCondition_MaxPendingTimeInSeconds
-StoppingCondition_MaxRuntimeInSecond <Int32>
The maximum length of time, in seconds, that a training or compilation job can run before it is stopped.For compilation jobs, if the job does not complete during this time, a TimeOut error is generated. We recommend starting with 900 seconds and increasing as necessary based on your model.For all other jobs, if the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxRuntimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt. The default value is 1 day. The maximum value is 28 days.The maximum time that a TrainingJob can run in total, including any time spent publishing metrics or archiving and uploading models after it has been stopped, is 30 days.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoppingCondition_MaxRuntimeInSeconds
-StoppingCondition_MaxWaitTimeInSecond <Int32>
The maximum length of time, in seconds, that a managed Spot training job has to complete. It is the amount of time spent waiting for Spot capacity plus the amount of time the job can run. It must be equal to or greater than MaxRuntimeInSeconds. If the job does not complete during this time, SageMaker ends the job.When RetryStrategy is specified in the job request, MaxWaitTimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoppingCondition_MaxWaitTimeInSeconds
-Tag <Tag[]>
A list of key-value pairs associated with the optimization job. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
-VpcConfig_SecurityGroupId <String[]>
The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesVpcConfig_SecurityGroupIds
-VpcConfig_Subnet <String[]>
The ID of the subnets in the VPC to which you want to connect your optimized model. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesVpcConfig_Subnets

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns a System.String object. The service call response (type Amazon.SageMaker.Model.CreateOptimizationJobResponse) can be returned by specifying '-Select *'.

Supported Version

AWS Tools for PowerShell: 2.x.y.z