Skip to content

Commit 155db1e

Browse files
author
awstools
committed
feat(client-sagemaker): Amazon SageMaker Automatic Model Tuning now supports specifying Hyperband strategy for tuning jobs, which uses a multi-fidelity based tuning strategy to stop underperforming hyperparameter configurations early.
1 parent d8e6a9a commit 155db1e

File tree

10 files changed

+340
-136
lines changed

10 files changed

+340
-136
lines changed

clients/client-sagemaker/src/SageMaker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,7 @@ export class SageMaker extends SageMakerClient {
14661466
}
14671467

14681468
/**
1469-
* <p>Creates a running app for the specified UserProfile. Supported apps are
1470-
* <code>JupyterServer</code> and <code>KernelGateway</code>. This operation is automatically
1469+
* <p>Creates a running app for the specified UserProfile. This operation is automatically
14711470
* invoked by Amazon SageMaker Studio upon access to the associated Domain, and when new kernel
14721471
* configurations are selected by the user. A user may have multiple Apps active simultaneously.</p>
14731472
*/

clients/client-sagemaker/src/commands/CreateAppCommand.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export interface CreateAppCommandInput extends CreateAppRequest {}
2525
export interface CreateAppCommandOutput extends CreateAppResponse, __MetadataBearer {}
2626

2727
/**
28-
* <p>Creates a running app for the specified UserProfile. Supported apps are
29-
* <code>JupyterServer</code> and <code>KernelGateway</code>. This operation is automatically
28+
* <p>Creates a running app for the specified UserProfile. This operation is automatically
3029
* invoked by Amazon SageMaker Studio upon access to the associated Domain, and when new kernel
3130
* configurations are selected by the user. A user may have multiple Apps active simultaneously.</p>
3231
* @example

clients/client-sagemaker/src/commands/DescribeFeatureMetadataCommand.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ import {
1212
SerdeContext as __SerdeContext,
1313
} from "@aws-sdk/types";
1414

15-
import {
16-
DescribeFeatureMetadataRequest,
17-
DescribeFeatureMetadataRequestFilterSensitiveLog,
18-
DescribeFeatureMetadataResponse,
19-
DescribeFeatureMetadataResponseFilterSensitiveLog,
20-
} from "../models/models_1";
15+
import { DescribeFeatureMetadataRequest, DescribeFeatureMetadataRequestFilterSensitiveLog } from "../models/models_1";
16+
import { DescribeFeatureMetadataResponse, DescribeFeatureMetadataResponseFilterSensitiveLog } from "../models/models_2";
2117
import {
2218
deserializeAws_json1_1DescribeFeatureMetadataCommand,
2319
serializeAws_json1_1DescribeFeatureMetadataCommand,

clients/client-sagemaker/src/commands/ListNotebookInstanceLifecycleConfigsCommand.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import {
1515
import {
1616
ListNotebookInstanceLifecycleConfigsInput,
1717
ListNotebookInstanceLifecycleConfigsInputFilterSensitiveLog,
18+
} from "../models/models_2";
19+
import {
1820
ListNotebookInstanceLifecycleConfigsOutput,
1921
ListNotebookInstanceLifecycleConfigsOutputFilterSensitiveLog,
20-
} from "../models/models_2";
22+
} from "../models/models_3";
2123
import {
2224
deserializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommand,
2325
serializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommand,

clients/client-sagemaker/src/models/models_0.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6036,8 +6036,7 @@ export interface CreateAppRequest {
60366036
UserProfileName: string | undefined;
60376037

60386038
/**
6039-
* <p>The type of app. Supported apps are <code>JupyterServer</code> and
6040-
* <code>KernelGateway</code>. <code>TensorBoard</code> is not supported.</p>
6039+
* <p>The type of app.</p>
60416040
*/
60426041
AppType: AppType | string | undefined;
60436042

@@ -7939,8 +7938,7 @@ export interface DomainSettings {
79397938
RStudioServerProDomainSettings?: RStudioServerProDomainSettings;
79407939

79417940
/**
7942-
* <p>The configuration for attaching a SageMaker user profile name to the execution role as a <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">
7943-
* <code>sts:SourceIdentity</code> key</a>.</p>
7941+
* <p>The configuration for attaching a SageMaker user profile name to the execution role as a <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">sts:SourceIdentity key</a>.</p>
79447942
*/
79457943
ExecutionRoleIdentityConfig?: ExecutionRoleIdentityConfig | string;
79467944
}
@@ -9886,6 +9884,7 @@ export interface ResourceLimits {
98869884

98879885
export enum HyperParameterTuningJobStrategyType {
98889886
BAYESIAN = "Bayesian",
9887+
HYPERBAND = "Hyperband",
98899888
RANDOM = "Random",
98909889
}
98919890

clients/client-sagemaker/src/models/models_1.ts

Lines changed: 104 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import {
5555
EdgePresetDeploymentType,
5656
EndpointInput,
5757
FeatureDefinition,
58-
FeatureType,
5958
GitConfig,
6059
HyperParameterTuningJobObjective,
6160
HyperParameterTuningJobStrategyType,
@@ -106,6 +105,84 @@ import {
106105
VpcConfig,
107106
} from "./models_0";
108107

108+
/**
109+
* <p>The configuration for <code>Hyperband</code>, a multi-fidelity based hyperparameter
110+
* tuning strategy. <code>Hyperband</code> uses the final and intermediate results of a
111+
* training job to dynamically allocate resources to utilized hyperparameter configurations
112+
* while automatically stopping under-performing configurations. This parameter should be
113+
* provided only if <code>Hyperband</code> is selected as the <code>StrategyConfig</code>
114+
* under the <code>HyperParameterTuningJobConfig</code> API.</p>
115+
*/
116+
export interface HyperbandStrategyConfig {
117+
/**
118+
* <p>The minimum number of resources (such as epochs) that can be used by a training job
119+
* launched by a hyperparameter tuning job. If the value for <code>MinResource</code> has not
120+
* been reached, the training job will not be stopped by <code>Hyperband</code>.</p>
121+
*/
122+
MinResource?: number;
123+
124+
/**
125+
* <p>The maximum number of resources (such as epochs) that can be used by a training job
126+
* launched by a hyperparameter tuning job. Once a job reaches the <code>MaxResource</code>
127+
* value, it is stopped. If a value for <code>MaxResource</code> is not provided, and
128+
* <code>Hyperband</code> is selected as the hyperparameter tuning strategy,
129+
* <code>HyperbandTrainingJ</code> attempts to infer <code>MaxResource</code> from the
130+
* following keys (if present) in <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html#sagemaker-Type-HyperParameterTrainingJobDefinition-StaticHyperParameters">StaticsHyperParameters</a>:</p>
131+
* <ul>
132+
* <li>
133+
* <p>
134+
* <code>epochs</code>
135+
* </p>
136+
* </li>
137+
* <li>
138+
* <p>
139+
* <code>numepochs</code>
140+
* </p>
141+
* </li>
142+
* <li>
143+
* <p>
144+
* <code>n-epochs</code>
145+
* </p>
146+
* </li>
147+
* <li>
148+
* <p>
149+
* <code>n_epochs</code>
150+
* </p>
151+
* </li>
152+
* <li>
153+
* <p>
154+
* <code>num_epochs</code>
155+
* </p>
156+
* </li>
157+
* </ul>
158+
* <p>If <code>HyperbandStrategyConfig</code> is unable to infer a value for
159+
* <code>MaxResource</code>, it generates a validation error. The maximum value is 20,000
160+
* epochs. All metrics that correspond to an objective metric are used to derive <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-early-stopping.html">early stopping
161+
* decisions</a>. For <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/distributed-training.html">distributive</a> training jobs,
162+
* ensure that duplicate metrics are not printed in the logs across the individual nodes in a
163+
* training job. If multiple nodes are publishing duplicate or incorrect metrics, training
164+
* jobs may make an incorrect stopping decision and stop the job prematurely. </p>
165+
*/
166+
MaxResource?: number;
167+
}
168+
169+
/**
170+
* <p>The configuration for a training job launched by a hyperparameter tuning job. Choose
171+
* <code>Bayesian</code> for Bayesian optimization, and <code>Random</code> for random
172+
* search optimization. For more advanced use cases, use <code>Hyperband</code>, which
173+
* evaluates objective metrics for training jobs after every epoch. For more information about
174+
* strategies, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html">How Hyperparameter
175+
* Tuning Works</a>.</p>
176+
*/
177+
export interface HyperParameterTuningJobStrategyConfig {
178+
/**
179+
* <p>The configuration for the object that specifies the <code>Hyperband</code> strategy.
180+
* This parameter is only supported for the <code>Hyperband</code> selection for
181+
* <code>Strategy</code> within the <code>HyperParameterTuningJobConfig</code> API.</p>
182+
*/
183+
HyperbandStrategyConfig?: HyperbandStrategyConfig;
184+
}
185+
109186
export enum TrainingJobEarlyStoppingType {
110187
AUTO = "Auto",
111188
OFF = "Off",
@@ -127,13 +204,19 @@ export interface TuningJobCompletionCriteria {
127204
export interface HyperParameterTuningJobConfig {
128205
/**
129206
* <p>Specifies how hyperparameter tuning chooses the combinations of hyperparameter values
130-
* to use for the training job it launches. To use the Bayesian search strategy, set this
131-
* to <code>Bayesian</code>. To randomly search, set it to <code>Random</code>. For
132-
* information about search strategies, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html">How
207+
* to use for the training job it launches. For information about search strategies, see
208+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html">How
133209
* Hyperparameter Tuning Works</a>.</p>
134210
*/
135211
Strategy: HyperParameterTuningJobStrategyType | string | undefined;
136212

213+
/**
214+
* <p>The configuration for the <code>Hyperband</code> optimization strategy. This parameter
215+
* should be provided only if <code>Hyperband</code> is selected as the strategy for
216+
* <code>HyperParameterTuningJobConfig</code>.</p>
217+
*/
218+
StrategyConfig?: HyperParameterTuningJobStrategyConfig;
219+
137220
/**
138221
* <p>The <a>HyperParameterTuningJobObjective</a> object that specifies the
139222
* objective
@@ -158,8 +241,10 @@ export interface HyperParameterTuningJobConfig {
158241

159242
/**
160243
* <p>Specifies whether to use early stopping for training jobs launched by the
161-
* hyperparameter tuning job. This can be one of the following values (the default value is
162-
* <code>OFF</code>):</p>
244+
* hyperparameter tuning job. Because the <code>Hyperband</code> strategy has its own
245+
* advanced internal early stopping mechanism,
246+
* <code>TrainingJobEarlyStoppingType</code> must be <code>OFF</code> to use <code>Hyperband</code>. This parameter can take on one of the following values (the
247+
* default value is <code>OFF</code>):</p>
163248
* <dl>
164249
* <dt>OFF</dt>
165250
* <dd>
@@ -2844,7 +2929,7 @@ export interface HumanTaskConfig {
28442929
/**
28452930
* <p>Defines the maximum number of data objects that can be labeled by human workers at the
28462931
* same time. Also referred to as batch size. Each object may have more than one worker at one time.
2847-
* The default value is 1000 objects.</p>
2932+
* The default value is 1000 objects. To increase the maximum value to 5000 objects, contact Amazon Web Services Support.</p>
28482933
*/
28492934
MaxConcurrentTaskCount?: number;
28502935

@@ -9117,61 +9202,20 @@ export interface DescribeFeatureMetadataRequest {
91179202
}
91189203

91199204
/**
9120-
* <p>A key-value pair that you specify to describe the feature.</p>
9205+
* @internal
91219206
*/
9122-
export interface FeatureParameter {
9123-
/**
9124-
* <p>A key that must contain a value to describe the feature.</p>
9125-
*/
9126-
Key?: string;
9127-
9128-
/**
9129-
* <p>The value that belongs to a key.</p>
9130-
*/
9131-
Value?: string;
9132-
}
9133-
9134-
export interface DescribeFeatureMetadataResponse {
9135-
/**
9136-
* <p>The Amazon Resource Number (ARN) of the feature group that contains the feature.</p>
9137-
*/
9138-
FeatureGroupArn: string | undefined;
9139-
9140-
/**
9141-
* <p>The name of the feature group that you've specified.</p>
9142-
*/
9143-
FeatureGroupName: string | undefined;
9144-
9145-
/**
9146-
* <p>The name of the feature that you've specified.</p>
9147-
*/
9148-
FeatureName: string | undefined;
9149-
9150-
/**
9151-
* <p>The data type of the feature.</p>
9152-
*/
9153-
FeatureType: FeatureType | string | undefined;
9154-
9155-
/**
9156-
* <p>A timestamp indicating when the feature was created.</p>
9157-
*/
9158-
CreationTime: Date | undefined;
9159-
9160-
/**
9161-
* <p>A timestamp indicating when the metadata for the feature group was modified. For example, if you add a parameter describing the feature, the timestamp changes to reflect the last time you </p>
9162-
*/
9163-
LastModifiedTime: Date | undefined;
9164-
9165-
/**
9166-
* <p>The description you added to describe the feature.</p>
9167-
*/
9168-
Description?: string;
9207+
export const HyperbandStrategyConfigFilterSensitiveLog = (obj: HyperbandStrategyConfig): any => ({
9208+
...obj,
9209+
});
91699210

9170-
/**
9171-
* <p>The key-value pairs that you added to describe the feature.</p>
9172-
*/
9173-
Parameters?: FeatureParameter[];
9174-
}
9211+
/**
9212+
* @internal
9213+
*/
9214+
export const HyperParameterTuningJobStrategyConfigFilterSensitiveLog = (
9215+
obj: HyperParameterTuningJobStrategyConfig
9216+
): any => ({
9217+
...obj,
9218+
});
91759219

91769220
/**
91779221
* @internal
@@ -11107,17 +11151,3 @@ export const DescribeFeatureGroupResponseFilterSensitiveLog = (obj: DescribeFeat
1110711151
export const DescribeFeatureMetadataRequestFilterSensitiveLog = (obj: DescribeFeatureMetadataRequest): any => ({
1110811152
...obj,
1110911153
});
11110-
11111-
/**
11112-
* @internal
11113-
*/
11114-
export const FeatureParameterFilterSensitiveLog = (obj: FeatureParameter): any => ({
11115-
...obj,
11116-
});
11117-
11118-
/**
11119-
* @internal
11120-
*/
11121-
export const DescribeFeatureMetadataResponseFilterSensitiveLog = (obj: DescribeFeatureMetadataResponse): any => ({
11122-
...obj,
11123-
});

0 commit comments

Comments
 (0)