Skip to content

Commit

Permalink
feat(client-sagemaker): Heterogeneous clusters: the ability to launch…
Browse files Browse the repository at this point in the history
… training jobs with multiple instance types. This enables running component of the training job on the instance type that is most suitable for it. e.g. doing data processing and augmentation on CPU instances and neural network training on GPU instances
  • Loading branch information
awstools committed Jul 7, 2022
1 parent 5d50be7 commit 0dd0bdd
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 88 deletions.
3 changes: 1 addition & 2 deletions clients/client-sagemaker/src/commands/CreateImageCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { CreateImageRequest } from "../models/models_0";
import { CreateImageResponse } from "../models/models_1";
import { CreateImageRequest, CreateImageResponse } from "../models/models_1";
import {
deserializeAws_json1_1CreateImageCommand,
serializeAws_json1_1CreateImageCommand,
Expand Down
82 changes: 44 additions & 38 deletions clients/client-sagemaker/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,12 @@ export interface S3DataSource {
* manifest file.</p>
*/
AttributeNames?: string[];

/**
* <p>A list of names of instance groups that get data
* from the S3 data source.</p>
*/
InstanceGroupNames?: string[];
}

export namespace S3DataSource {
Expand Down Expand Up @@ -1301,6 +1307,37 @@ export enum TrainingInstanceType {
ML_P4D_24XLARGE = "ml.p4d.24xlarge",
}

/**
* <p>Defines an instance group for heterogeneous cluster training.
* When requesting a training job using the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a> API,
* you can configure up to 5 different ML training instance groups.</p>
*/
export interface InstanceGroup {
/**
* <p>Specifies the instance type of the instance group.</p>
*/
InstanceType: TrainingInstanceType | string | undefined;

/**
* <p>Specifies the number of instances of the instance group.</p>
*/
InstanceCount: number | undefined;

/**
* <p>Specifies the name of the instance group.</p>
*/
InstanceGroupName: string | undefined;
}

export namespace InstanceGroup {
/**
* @internal
*/
export const filterSensitiveLog = (obj: InstanceGroup): any => ({
...obj,
});
}

/**
* <p>Describes the resources, including ML compute instances and ML storage volumes, to
* use for model training. </p>
Expand All @@ -1309,13 +1346,13 @@ export interface ResourceConfig {
/**
* <p>The ML compute instance type. </p>
*/
InstanceType: TrainingInstanceType | string | undefined;
InstanceType?: TrainingInstanceType | string;

/**
* <p>The number of ML compute instances to use. For distributed training, provide a
* value greater than 1. </p>
*/
InstanceCount: number | undefined;
InstanceCount?: number;

/**
* <p>The size of the ML storage volume that you want to provision. </p>
Expand Down Expand Up @@ -1369,6 +1406,11 @@ export interface ResourceConfig {
* </ul>
*/
VolumeKmsKeyId?: string;

/**
* <p>The configuration of a heterogeneous cluster in JSON format.</p>
*/
InstanceGroups?: InstanceGroup[];
}

export namespace ResourceConfig {
Expand Down Expand Up @@ -12000,39 +12042,3 @@ export namespace CreateHyperParameterTuningJobResponse {
...obj,
});
}

export interface CreateImageRequest {
/**
* <p>The description of the image.</p>
*/
Description?: string;

/**
* <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
*/
DisplayName?: string;

/**
* <p>The name of the image. Must be unique to your account.</p>
*/
ImageName: string | undefined;

/**
* <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf.</p>
*/
RoleArn: string | undefined;

/**
* <p>A list of tags to apply to the image.</p>
*/
Tags?: Tag[];
}

export namespace CreateImageRequest {
/**
* @internal
*/
export const filterSensitiveLog = (obj: CreateImageRequest): any => ({
...obj,
});
}
70 changes: 36 additions & 34 deletions clients/client-sagemaker/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,42 @@ import {
VpcConfig,
} from "./models_0";

export interface CreateImageRequest {
/**
* <p>The description of the image.</p>
*/
Description?: string;

/**
* <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
*/
DisplayName?: string;

/**
* <p>The name of the image. Must be unique to your account.</p>
*/
ImageName: string | undefined;

/**
* <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf.</p>
*/
RoleArn: string | undefined;

/**
* <p>A list of tags to apply to the image.</p>
*/
Tags?: Tag[];
}

export namespace CreateImageRequest {
/**
* @internal
*/
export const filterSensitiveLog = (obj: CreateImageRequest): any => ({
...obj,
});
}

export interface CreateImageResponse {
/**
* <p>The Amazon Resource Name (ARN) of the image.</p>
Expand Down Expand Up @@ -11306,37 +11342,3 @@ export namespace EndpointOutputConfiguration {
...obj,
});
}

/**
* <p>The metrics of recommendations.</p>
*/
export interface RecommendationMetrics {
/**
* <p>Defines the cost per hour for the instance. </p>
*/
CostPerHour: number | undefined;

/**
* <p>Defines the cost per inference for the instance .</p>
*/
CostPerInference: number | undefined;

/**
* <p>The expected maximum number of requests per minute for the instance.</p>
*/
MaxInvocations: number | undefined;

/**
* <p>The expected model latency at maximum invocation per minute for the instance.</p>
*/
ModelLatency: number | undefined;
}

export namespace RecommendationMetrics {
/**
* @internal
*/
export const filterSensitiveLog = (obj: RecommendationMetrics): any => ({
...obj,
});
}
40 changes: 34 additions & 6 deletions clients/client-sagemaker/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ import {
RecommendationJobInputConfig,
RecommendationJobStoppingConditions,
RecommendationJobType,
RecommendationMetrics,
RootAccess,
RuleEvaluationStatus,
ServiceCatalogProvisioningDetails,
Expand All @@ -143,6 +142,40 @@ import {
TrialComponentStatus,
} from "./models_1";

/**
* <p>The metrics of recommendations.</p>
*/
export interface RecommendationMetrics {
/**
* <p>Defines the cost per hour for the instance. </p>
*/
CostPerHour: number | undefined;

/**
* <p>Defines the cost per inference for the instance .</p>
*/
CostPerInference: number | undefined;

/**
* <p>The expected maximum number of requests per minute for the instance.</p>
*/
MaxInvocations: number | undefined;

/**
* <p>The expected model latency at maximum invocation per minute for the instance.</p>
*/
ModelLatency: number | undefined;
}

export namespace RecommendationMetrics {
/**
* @internal
*/
export const filterSensitiveLog = (obj: RecommendationMetrics): any => ({
...obj,
});
}

/**
* <p>A list of environment parameters suggested by the Amazon SageMaker Inference Recommender.</p>
*/
Expand Down Expand Up @@ -10973,8 +11006,3 @@ export namespace ListProcessingJobsResponse {
...obj,
});
}

export enum ProjectSortBy {
CREATION_TIME = "CreationTime",
NAME = "Name",
}
6 changes: 5 additions & 1 deletion clients/client-sagemaker/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import {
PipelineExperimentConfig,
PipelineStatus,
ProcessingJobStatus,
ProjectSortBy,
ProjectStatus,
ResourceType,
SecondaryStatus,
Expand All @@ -111,6 +110,11 @@ import {
Workteam,
} from "./models_2";

export enum ProjectSortBy {
CREATION_TIME = "CreationTime",
NAME = "Name",
}

export enum ProjectSortOrder {
ASCENDING = "Ascending",
DESCENDING = "Descending",
Expand Down
Loading

0 comments on commit 0dd0bdd

Please sign in to comment.