Skip to content

Commit 85fc637

Browse files
author
awstools
committed
feat(client-sagemaker): SageMaker Training Managed Warm Pools let you retain provisioned infrastructure to reduce latency for repetitive training workloads.
1 parent 66a6a45 commit 85fc637

File tree

8 files changed

+278
-37
lines changed

8 files changed

+278
-37
lines changed

clients/client-sagemaker/src/SageMaker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10233,7 +10233,7 @@ export class SageMaker extends SageMakerClient {
1023310233
}
1023410234

1023510235
/**
10236-
* <p>Update a model training job to request a new Debugger profiling configuration.</p>
10236+
* <p>Update a model training job to request a new Debugger profiling configuration or to change warm pool retention length.</p>
1023710237
*/
1023810238
public updateTrainingJob(
1023910239
args: UpdateTrainingJobCommandInput,

clients/client-sagemaker/src/commands/ListMonitoringSchedulesCommand.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-
ListMonitoringSchedulesRequest,
17-
ListMonitoringSchedulesRequestFilterSensitiveLog,
18-
ListMonitoringSchedulesResponse,
19-
ListMonitoringSchedulesResponseFilterSensitiveLog,
20-
} from "../models/models_2";
15+
import { ListMonitoringSchedulesRequest, ListMonitoringSchedulesRequestFilterSensitiveLog } from "../models/models_2";
16+
import { ListMonitoringSchedulesResponse, ListMonitoringSchedulesResponseFilterSensitiveLog } from "../models/models_3";
2117
import {
2218
deserializeAws_json1_1ListMonitoringSchedulesCommand,
2319
serializeAws_json1_1ListMonitoringSchedulesCommand,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface UpdateTrainingJobCommandInput extends UpdateTrainingJobRequest
2828
export interface UpdateTrainingJobCommandOutput extends UpdateTrainingJobResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Update a model training job to request a new Debugger profiling configuration.</p>
31+
* <p>Update a model training job to request a new Debugger profiling configuration or to change warm pool retention length.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,11 @@ export interface ResourceConfig {
12151215
* <p>The configuration of a heterogeneous cluster in JSON format.</p>
12161216
*/
12171217
InstanceGroups?: InstanceGroup[];
1218+
1219+
/**
1220+
* <p>The duration of time in seconds to retain configured resources in a warm pool for subsequent training jobs.</p>
1221+
*/
1222+
KeepAlivePeriodInSeconds?: number;
12181223
}
12191224

12201225
/**

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

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,6 +3020,56 @@ export interface SecondaryStatusTransition {
30203020
StatusMessage?: string;
30213021
}
30223022

3023+
export enum WarmPoolResourceStatus {
3024+
AVAILABLE = "Available",
3025+
INUSE = "InUse",
3026+
REUSED = "Reused",
3027+
TERMINATED = "Terminated",
3028+
}
3029+
3030+
/**
3031+
* <p>Status and billing information about the warm pool.</p>
3032+
*/
3033+
export interface WarmPoolStatus {
3034+
/**
3035+
* <p>The status of the warm pool.</p>
3036+
* <ul>
3037+
* <li>
3038+
* <p>
3039+
* <code>InUse</code>: The warm pool is in use for the training job.</p>
3040+
* </li>
3041+
* <li>
3042+
* <p>
3043+
* <code>Available</code>: The warm pool is available to reuse for a matching training job.</p>
3044+
* </li>
3045+
* <li>
3046+
* <p>
3047+
* <code>Reused</code>: The warm pool moved to a matching training job for reuse.</p>
3048+
* </li>
3049+
* <li>
3050+
* <p>
3051+
* <code>Terminated</code>: The warm pool is no longer available. Warm pools are unavailable if they are terminated by a user, terminated for a patch update, or terminated for exceeding the specified <code>KeepAlivePeriodInSeconds</code>.</p>
3052+
* </li>
3053+
* </ul>
3054+
*/
3055+
Status: WarmPoolResourceStatus | string | undefined;
3056+
3057+
/**
3058+
* <p>The billable time in seconds used by the warm pool. Billable time refers to the absolute wall-clock
3059+
* time.</p>
3060+
* <p>Multiply <code>ResourceRetainedBillableTimeInSeconds</code> by the number of instances
3061+
* (<code>InstanceCount</code>) in your training cluster to get the total compute time
3062+
* SageMaker bills you if you run warm pool training. The formula is as follows:
3063+
* <code>ResourceRetainedBillableTimeInSeconds * InstanceCount</code>.</p>
3064+
*/
3065+
ResourceRetainedBillableTimeInSeconds?: number;
3066+
3067+
/**
3068+
* <p>The name of the matching training job that reused the warm pool.</p>
3069+
*/
3070+
ReusedByJob?: string;
3071+
}
3072+
30233073
export interface DescribeTrainingJobResponse {
30243074
/**
30253075
* <p> Name of the model training job. </p>
@@ -3420,6 +3470,11 @@ export interface DescribeTrainingJobResponse {
34203470
* <p>The environment variables to set in the Docker container.</p>
34213471
*/
34223472
Environment?: Record<string, string>;
3473+
3474+
/**
3475+
* <p>The status of the warm pool associated with the training job.</p>
3476+
*/
3477+
WarmPoolStatus?: WarmPoolStatus;
34233478
}
34243479

34253480
export interface DescribeTransformJobRequest {
@@ -8911,25 +8966,6 @@ export interface MonitoringScheduleSummary {
89118966
MonitoringType?: MonitoringType | string;
89128967
}
89138968

8914-
export interface ListMonitoringSchedulesResponse {
8915-
/**
8916-
* <p>A JSON array in which each element is a summary for a monitoring schedule.</p>
8917-
*/
8918-
MonitoringScheduleSummaries: MonitoringScheduleSummary[] | undefined;
8919-
8920-
/**
8921-
* <p>If the response is truncated, Amazon SageMaker returns this token. To retrieve the next set of jobs,
8922-
* use it in the subsequent request.</p>
8923-
*/
8924-
NextToken?: string;
8925-
}
8926-
8927-
export enum NotebookInstanceLifecycleConfigSortKey {
8928-
CREATION_TIME = "CreationTime",
8929-
LAST_MODIFIED_TIME = "LastModifiedTime",
8930-
NAME = "Name",
8931-
}
8932-
89338969
/**
89348970
* @internal
89358971
*/
@@ -9491,6 +9527,13 @@ export const SecondaryStatusTransitionFilterSensitiveLog = (obj: SecondaryStatus
94919527
...obj,
94929528
});
94939529

9530+
/**
9531+
* @internal
9532+
*/
9533+
export const WarmPoolStatusFilterSensitiveLog = (obj: WarmPoolStatus): any => ({
9534+
...obj,
9535+
});
9536+
94949537
/**
94959538
* @internal
94969539
*/
@@ -10680,10 +10723,3 @@ export const ListMonitoringSchedulesRequestFilterSensitiveLog = (obj: ListMonito
1068010723
export const MonitoringScheduleSummaryFilterSensitiveLog = (obj: MonitoringScheduleSummary): any => ({
1068110724
...obj,
1068210725
});
10683-
10684-
/**
10685-
* @internal
10686-
*/
10687-
export const ListMonitoringSchedulesResponseFilterSensitiveLog = (obj: ListMonitoringSchedulesResponse): any => ({
10688-
...obj,
10689-
});

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

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import {
9898
MetricData,
9999
ModelPackageGroupStatus,
100100
ModelPackageStatusDetails,
101-
NotebookInstanceLifecycleConfigSortKey,
101+
MonitoringScheduleSummary,
102102
NotebookInstanceStatus,
103103
PipelineExecutionStatus,
104104
PipelineExperimentConfig,
@@ -118,10 +118,31 @@ import {
118118
TrialComponentSource,
119119
TrialSource,
120120
UserProfileStatus,
121+
WarmPoolResourceStatus,
122+
WarmPoolStatus,
121123
Workforce,
122124
Workteam,
123125
} from "./models_2";
124126

127+
export interface ListMonitoringSchedulesResponse {
128+
/**
129+
* <p>A JSON array in which each element is a summary for a monitoring schedule.</p>
130+
*/
131+
MonitoringScheduleSummaries: MonitoringScheduleSummary[] | undefined;
132+
133+
/**
134+
* <p>If the response is truncated, Amazon SageMaker returns this token. To retrieve the next set of jobs,
135+
* use it in the subsequent request.</p>
136+
*/
137+
NextToken?: string;
138+
}
139+
140+
export enum NotebookInstanceLifecycleConfigSortKey {
141+
CREATION_TIME = "CreationTime",
142+
LAST_MODIFIED_TIME = "LastModifiedTime",
143+
NAME = "Name",
144+
}
145+
125146
export enum NotebookInstanceLifecycleConfigSortOrder {
126147
ASCENDING = "Ascending",
127148
DESCENDING = "Descending",
@@ -1479,6 +1500,11 @@ export interface ListTrainingJobsRequest {
14791500
* <p>The sort order for results. The default is <code>Ascending</code>.</p>
14801501
*/
14811502
SortOrder?: SortOrder | string;
1503+
1504+
/**
1505+
* <p>A filter that retrieves only training jobs with a specific warm pool status.</p>
1506+
*/
1507+
WarmPoolStatusEquals?: WarmPoolResourceStatus | string;
14821508
}
14831509

14841510
/**
@@ -1516,6 +1542,11 @@ export interface TrainingJobSummary {
15161542
* <p>The status of the training job.</p>
15171543
*/
15181544
TrainingJobStatus: TrainingJobStatus | string | undefined;
1545+
1546+
/**
1547+
* <p>The status of the warm pool associated with the training job.</p>
1548+
*/
1549+
WarmPoolStatus?: WarmPoolStatus;
15191550
}
15201551

15211552
export interface ListTrainingJobsResponse {
@@ -3066,6 +3097,16 @@ export interface RenderUiTemplateResponse {
30663097
Errors: RenderingError[] | undefined;
30673098
}
30683099

3100+
/**
3101+
* <p>The <code>ResourceConfig</code> to update <code>KeepAlivePeriodInSeconds</code>. Other fields in the <code>ResourceConfig</code> cannot be updated.</p>
3102+
*/
3103+
export interface ResourceConfigForUpdate {
3104+
/**
3105+
* <p>The <code>KeepAlivePeriodInSeconds</code> value specified in the <code>ResourceConfig</code> to update.</p>
3106+
*/
3107+
KeepAlivePeriodInSeconds: number | undefined;
3108+
}
3109+
30693110
export interface RetryPipelineExecutionRequest {
30703111
/**
30713112
* <p>The Amazon Resource Name (ARN) of the pipeline execution.</p>
@@ -4960,6 +5001,11 @@ export interface UpdateTrainingJobRequest {
49605001
* metrics.</p>
49615002
*/
49625003
ProfilerRuleConfigurations?: ProfilerRuleConfiguration[];
5004+
5005+
/**
5006+
* <p>The training job <code>ResourceConfig</code> to update warm pool retention length.</p>
5007+
*/
5008+
ResourceConfig?: ResourceConfigForUpdate;
49635009
}
49645010

49655011
export interface UpdateTrainingJobResponse {
@@ -5256,6 +5302,13 @@ export interface SearchRequest {
52565302
MaxResults?: number;
52575303
}
52585304

5305+
/**
5306+
* @internal
5307+
*/
5308+
export const ListMonitoringSchedulesResponseFilterSensitiveLog = (obj: ListMonitoringSchedulesResponse): any => ({
5309+
...obj,
5310+
});
5311+
52595312
/**
52605313
* @internal
52615314
*/
@@ -5844,6 +5897,13 @@ export const RenderUiTemplateResponseFilterSensitiveLog = (obj: RenderUiTemplate
58445897
...obj,
58455898
});
58465899

5900+
/**
5901+
* @internal
5902+
*/
5903+
export const ResourceConfigForUpdateFilterSensitiveLog = (obj: ResourceConfigForUpdate): any => ({
5904+
...obj,
5905+
});
5906+
58475907
/**
58485908
* @internal
58495909
*/

clients/client-sagemaker/src/protocols/Aws_json1_1.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,6 @@ import {
13921392
ListMonitoringExecutionsRequest,
13931393
ListMonitoringExecutionsResponse,
13941394
ListMonitoringSchedulesRequest,
1395-
ListMonitoringSchedulesResponse,
13961395
MetricData,
13971396
ModelConfiguration,
13981397
ModelMetadataFilter,
@@ -1425,11 +1424,13 @@ import {
14251424
TrialComponentSource,
14261425
TrialSource,
14271426
UiTemplateInfo,
1427+
WarmPoolStatus,
14281428
Workforce,
14291429
WorkforceVpcConfigResponse,
14301430
Workteam,
14311431
} from "../models/models_2";
14321432
import {
1433+
ListMonitoringSchedulesResponse,
14331434
ListNotebookInstanceLifecycleConfigsInput,
14341435
ListNotebookInstanceLifecycleConfigsOutput,
14351436
ListNotebookInstancesInput,
@@ -1502,6 +1503,7 @@ import {
15021503
RenderingError,
15031504
RenderUiTemplateRequest,
15041505
RenderUiTemplateResponse,
1506+
ResourceConfigForUpdate,
15051507
RetryPipelineExecutionRequest,
15061508
RetryPipelineExecutionResponse,
15071509
SearchExpression,
@@ -20136,6 +20138,7 @@ const serializeAws_json1_1ListTrainingJobsRequest = (input: ListTrainingJobsRequ
2013620138
...(input.SortBy != null && { SortBy: input.SortBy }),
2013720139
...(input.SortOrder != null && { SortOrder: input.SortOrder }),
2013820140
...(input.StatusEquals != null && { StatusEquals: input.StatusEquals }),
20141+
...(input.WarmPoolStatusEquals != null && { WarmPoolStatusEquals: input.WarmPoolStatusEquals }),
2013920142
};
2014020143
};
2014120144

@@ -21598,11 +21601,18 @@ const serializeAws_json1_1ResourceConfig = (input: ResourceConfig, context: __Se
2159821601
InstanceGroups: serializeAws_json1_1InstanceGroups(input.InstanceGroups, context),
2159921602
}),
2160021603
...(input.InstanceType != null && { InstanceType: input.InstanceType }),
21604+
...(input.KeepAlivePeriodInSeconds != null && { KeepAlivePeriodInSeconds: input.KeepAlivePeriodInSeconds }),
2160121605
...(input.VolumeKmsKeyId != null && { VolumeKmsKeyId: input.VolumeKmsKeyId }),
2160221606
...(input.VolumeSizeInGB != null && { VolumeSizeInGB: input.VolumeSizeInGB }),
2160321607
};
2160421608
};
2160521609

21610+
const serializeAws_json1_1ResourceConfigForUpdate = (input: ResourceConfigForUpdate, context: __SerdeContext): any => {
21611+
return {
21612+
...(input.KeepAlivePeriodInSeconds != null && { KeepAlivePeriodInSeconds: input.KeepAlivePeriodInSeconds }),
21613+
};
21614+
};
21615+
2160621616
const serializeAws_json1_1ResourceLimits = (input: ResourceLimits, context: __SerdeContext): any => {
2160721617
return {
2160821618
...(input.MaxNumberOfTrainingJobs != null && { MaxNumberOfTrainingJobs: input.MaxNumberOfTrainingJobs }),
@@ -22717,6 +22727,9 @@ const serializeAws_json1_1UpdateTrainingJobRequest = (
2271722727
context
2271822728
),
2271922729
}),
22730+
...(input.ResourceConfig != null && {
22731+
ResourceConfig: serializeAws_json1_1ResourceConfigForUpdate(input.ResourceConfig, context),
22732+
}),
2272022733
...(input.TrainingJobName != null && { TrainingJobName: input.TrainingJobName }),
2272122734
};
2272222735
};
@@ -26646,6 +26659,8 @@ const deserializeAws_json1_1DescribeTrainingJobResponse = (
2664626659
TrainingTimeInSeconds: __expectInt32(output.TrainingTimeInSeconds),
2664726660
TuningJobArn: __expectString(output.TuningJobArn),
2664826661
VpcConfig: output.VpcConfig != null ? deserializeAws_json1_1VpcConfig(output.VpcConfig, context) : undefined,
26662+
WarmPoolStatus:
26663+
output.WarmPoolStatus != null ? deserializeAws_json1_1WarmPoolStatus(output.WarmPoolStatus, context) : undefined,
2664926664
} as any;
2665026665
};
2665126666

@@ -32300,6 +32315,7 @@ const deserializeAws_json1_1ResourceConfig = (output: any, context: __SerdeConte
3230032315
InstanceGroups:
3230132316
output.InstanceGroups != null ? deserializeAws_json1_1InstanceGroups(output.InstanceGroups, context) : undefined,
3230232317
InstanceType: __expectString(output.InstanceType),
32318+
KeepAlivePeriodInSeconds: __expectInt32(output.KeepAlivePeriodInSeconds),
3230332319
VolumeKmsKeyId: __expectString(output.VolumeKmsKeyId),
3230432320
VolumeSizeInGB: __expectInt32(output.VolumeSizeInGB),
3230532321
} as any;
@@ -33009,6 +33025,8 @@ const deserializeAws_json1_1TrainingJobSummary = (output: any, context: __SerdeC
3300933025
TrainingJobArn: __expectString(output.TrainingJobArn),
3301033026
TrainingJobName: __expectString(output.TrainingJobName),
3301133027
TrainingJobStatus: __expectString(output.TrainingJobStatus),
33028+
WarmPoolStatus:
33029+
output.WarmPoolStatus != null ? deserializeAws_json1_1WarmPoolStatus(output.WarmPoolStatus, context) : undefined,
3301233030
} as any;
3301333031
};
3301433032

@@ -33873,6 +33891,14 @@ const deserializeAws_json1_1VpcSecurityGroupIds = (output: any, context: __Serde
3387333891
return retVal;
3387433892
};
3387533893

33894+
const deserializeAws_json1_1WarmPoolStatus = (output: any, context: __SerdeContext): WarmPoolStatus => {
33895+
return {
33896+
ResourceRetainedBillableTimeInSeconds: __expectInt32(output.ResourceRetainedBillableTimeInSeconds),
33897+
ReusedByJob: __expectString(output.ReusedByJob),
33898+
Status: __expectString(output.Status),
33899+
} as any;
33900+
};
33901+
3387633902
const deserializeAws_json1_1Workforce = (output: any, context: __SerdeContext): Workforce => {
3387733903
return {
3387833904
CognitoConfig:

0 commit comments

Comments
 (0)