Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(client-sagemaker): Amazon SageMaker Automatic Model Tuning now s…
…upports enabling Autotune for tuning jobs which can choose tuning job configurations.
  • Loading branch information
awstools committed May 25, 2023
1 parent 384c171 commit d7d3a70
Show file tree
Hide file tree
Showing 17 changed files with 580 additions and 298 deletions.
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { CreateEdgeDeploymentPlanRequest, CreateEdgeDeploymentPlanResponse } from "../models/models_0";
import { CreateEdgeDeploymentPlanRequest, CreateEdgeDeploymentPlanResponse } from "../models/models_1";
import { de_CreateEdgeDeploymentPlanCommand, se_CreateEdgeDeploymentPlanCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { CreateEdgeDeploymentStageRequest } from "../models/models_0";
import { CreateEdgeDeploymentStageRequest } from "../models/models_1";
import { de_CreateEdgeDeploymentStageCommand, se_CreateEdgeDeploymentStageCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -106,6 +106,12 @@ export interface CreateHyperParameterTuningJobCommandOutput
* ],
* },
* ],
* AutoParameters: [ // AutoParameters
* { // AutoParameter
* Name: "STRING_VALUE", // required
* ValueHint: "STRING_VALUE", // required
* },
* ],
* },
* TrainingJobEarlyStoppingType: "Off" || "Auto",
* TuningJobCompletionCriteria: { // TuningJobCompletionCriteria
Expand Down Expand Up @@ -150,6 +156,12 @@ export interface CreateHyperParameterTuningJobCommandOutput
* ],
* },
* ],
* AutoParameters: [
* {
* Name: "STRING_VALUE", // required
* ValueHint: "STRING_VALUE", // required
* },
* ],
* },
* StaticHyperParameters: { // HyperParameters
* "<keys>": "STRING_VALUE",
Expand Down Expand Up @@ -287,6 +299,12 @@ export interface CreateHyperParameterTuningJobCommandOutput
* ],
* },
* ],
* AutoParameters: [
* {
* Name: "STRING_VALUE", // required
* ValueHint: "STRING_VALUE", // required
* },
* ],
* },
* StaticHyperParameters: {
* "<keys>": "STRING_VALUE",
Expand Down Expand Up @@ -407,6 +425,9 @@ export interface CreateHyperParameterTuningJobCommandOutput
* Value: "STRING_VALUE", // required
* },
* ],
* Autotune: { // Autotune
* Mode: "Enabled", // required
* },
* };
* const command = new CreateHyperParameterTuningJobCommand(input);
* const response = await client.send(command);
Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { DeleteProjectInput } from "../models/models_1";
import { DeleteProjectInput } from "../models/models_2";
import { de_DeleteProjectCommand, se_DeleteProjectCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { DeleteSpaceRequest } from "../models/models_1";
import { DeleteSpaceRequest } from "../models/models_2";
import { de_DeleteSpaceCommand, se_DeleteSpaceCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { DeleteStudioLifecycleConfigRequest } from "../models/models_1";
import { DeleteStudioLifecycleConfigRequest } from "../models/models_2";
import { de_DeleteStudioLifecycleConfigCommand, se_DeleteStudioLifecycleConfigCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -41,8 +41,9 @@ export interface DescribeHyperParameterTuningJobCommandOutput

/**
* @public
* <p>Gets
* a description of a hyperparameter tuning job.</p>
* <p>Returns a description of a hyperparameter tuning job, depending on the fields
* selected. These fields can include the name, Amazon Resource Name (ARN), job status of
* your tuning job and more.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -99,6 +100,12 @@ export interface DescribeHyperParameterTuningJobCommandOutput
* // ],
* // },
* // ],
* // AutoParameters: [ // AutoParameters
* // { // AutoParameter
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // TrainingJobEarlyStoppingType: "Off" || "Auto",
* // TuningJobCompletionCriteria: { // TuningJobCompletionCriteria
Expand Down Expand Up @@ -143,6 +150,12 @@ export interface DescribeHyperParameterTuningJobCommandOutput
* // ],
* // },
* // ],
* // AutoParameters: [
* // {
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // StaticHyperParameters: { // HyperParameters
* // "<keys>": "STRING_VALUE",
Expand Down Expand Up @@ -280,6 +293,12 @@ export interface DescribeHyperParameterTuningJobCommandOutput
* // ],
* // },
* // ],
* // AutoParameters: [
* // {
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // StaticHyperParameters: {
* // "<keys>": "STRING_VALUE",
Expand Down Expand Up @@ -458,6 +477,9 @@ export interface DescribeHyperParameterTuningJobCommandOutput
* // ConsumedResources: { // HyperParameterTuningJobConsumedResources
* // RuntimeInSeconds: Number("int"),
* // },
* // Autotune: { // Autotune
* // Mode: "Enabled", // required
* // },
* // };
*
* ```
Expand Down
18 changes: 18 additions & 0 deletions clients/client-sagemaker/src/commands/SearchCommand.ts
Expand Up @@ -1439,6 +1439,12 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* // ],
* // },
* // ],
* // AutoParameters: [ // AutoParameters
* // { // AutoParameter
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // TrainingJobEarlyStoppingType: "Off" || "Auto",
* // TuningJobCompletionCriteria: { // TuningJobCompletionCriteria
Expand Down Expand Up @@ -1483,6 +1489,12 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* // ],
* // },
* // ],
* // AutoParameters: [
* // {
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // StaticHyperParameters: "<HyperParameters>",
* // AlgorithmSpecification: { // HyperParameterAlgorithmSpecification
Expand Down Expand Up @@ -1552,6 +1564,12 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* // ],
* // },
* // ],
* // AutoParameters: [
* // {
* // Name: "STRING_VALUE", // required
* // ValueHint: "STRING_VALUE", // required
* // },
* // ],
* // },
* // StaticHyperParameters: "<HyperParameters>",
* // AlgorithmSpecification: {
Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { StopNotebookInstanceInput } from "../models/models_3";
import { StopNotebookInstanceInput } from "../models/models_4";
import { de_StopNotebookInstanceCommand, se_StopNotebookInstanceCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { StopPipelineExecutionRequest, StopPipelineExecutionResponse } from "../models/models_3";
import { StopPipelineExecutionRequest, StopPipelineExecutionResponse } from "../models/models_4";
import { de_StopPipelineExecutionCommand, se_StopPipelineExecutionCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
130 changes: 75 additions & 55 deletions clients/client-sagemaker/src/models/models_0.ts
Expand Up @@ -5485,6 +5485,24 @@ export const AutoMLSortOrder = {
*/
export type AutoMLSortOrder = (typeof AutoMLSortOrder)[keyof typeof AutoMLSortOrder];

/**
* @public
* <p>The name and an example value of the hyperparameter that
* you want to use in Autotune. If Automatic model tuning (AMT) determines that your hyperparameter is eligible
* for Autotune, an optimal hyperparameter range is selected for you.</p>
*/
export interface AutoParameter {
/**
* <p>The name of the hyperparameter to optimize using Autotune.</p>
*/
Name: string | undefined;

/**
* <p>An example value of the hyperparameter to optimize using Autotune.</p>
*/
ValueHint: string | undefined;
}

/**
* @public
* <p>Automatic rollback configuration for handling endpoint deployment failures and
Expand All @@ -5499,6 +5517,63 @@ export interface AutoRollbackConfig {
Alarms?: Alarm[];
}

/**
* @public
* @enum
*/
export const AutotuneMode = {
ENABLED: "Enabled",
} as const;

/**
* @public
*/
export type AutotuneMode = (typeof AutotuneMode)[keyof typeof AutotuneMode];

/**
* @public
* <p>A flag to indicate if you want to use Autotune to automatically find optimal values for
* the following fields:</p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html#sagemaker-Type-HyperParameterTuningJobConfig-ParameterRanges">ParameterRanges</a>: The names and ranges of parameters that a hyperparameter
* tuning job can optimize.</p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ResourceLimits.html">ResourceLimits</a>: The maximum resources that can be used for a training job.
* These resources include the maximum number of training jobs, the maximum runtime of a
* tuning job, and the maximum number of training jobs to run at the same time.</p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html#sagemaker-Type-HyperParameterTuningJobConfig-TrainingJobEarlyStoppingType">TrainingJobEarlyStoppingType</a>: A flag that specifies whether or not to use
* early stopping for training jobs launched by a hyperparameter tuning job.</p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html#sagemaker-Type-HyperParameterTrainingJobDefinition-RetryStrategy">RetryStrategy</a>: The number of times to retry a training job.</p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html">Strategy</a>: Specifies how hyperparameter tuning chooses the combinations of
* hyperparameter values to use for the training jobs that it launches.</p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ConvergenceDetected.html">ConvergenceDetected</a>: A flag to indicate that Automatic model tuning (AMT) has detected model
* convergence.</p>
* </li>
* </ul>
*/
export interface Autotune {
/**
* <p>Set <code>Mode</code> to <code>Enabled</code> if you want to use Autotune.</p>
*/
Mode: AutotuneMode | string | undefined;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -10413,58 +10488,3 @@ export interface DeploymentStage {
*/
DeploymentConfig?: EdgeDeploymentConfig;
}

/**
* @public
*/
export interface CreateEdgeDeploymentPlanRequest {
/**
* <p>The name of the edge deployment plan.</p>
*/
EdgeDeploymentPlanName: string | undefined;

/**
* <p>List of models associated with the edge deployment plan.</p>
*/
ModelConfigs: EdgeDeploymentModelConfig[] | undefined;

/**
* <p>The device fleet used for this edge deployment plan.</p>
*/
DeviceFleetName: string | undefined;

/**
* <p>List of stages of the edge deployment plan. The number of stages is limited to 10 per deployment.</p>
*/
Stages?: DeploymentStage[];

/**
* <p>List of tags with which to tag the edge deployment plan.</p>
*/
Tags?: Tag[];
}

/**
* @public
*/
export interface CreateEdgeDeploymentPlanResponse {
/**
* <p>The ARN of the edge deployment plan.</p>
*/
EdgeDeploymentPlanArn: string | undefined;
}

/**
* @public
*/
export interface CreateEdgeDeploymentStageRequest {
/**
* <p>The name of the edge deployment plan.</p>
*/
EdgeDeploymentPlanName: string | undefined;

/**
* <p>List of stages to be added to the edge deployment plan.</p>
*/
Stages: DeploymentStage[] | undefined;
}

0 comments on commit d7d3a70

Please sign in to comment.