Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,16 @@ export enum InstanceClass {
*/
G6E = 'g6e',

/**
* Cost-efficient GPU-based instances for AI inference and spatial computing workloads, 7th generation
*/
GRAPHICS7_EFFICIENT = 'graphics7-efficient',

/**
* Cost-efficient GPU-based instances for AI inference and spatial computing workloads, 7th generation
*/
G7E = 'g7e',

/**
* Graphics-optimized instances, 6th generation
* Gr6 instances offer a 1:8 vCPU to RAM ratio, making them better suited for graphics workloads with higher memory requirements.
Expand Down Expand Up @@ -2064,6 +2074,8 @@ export class InstanceType {
[InstanceClass.G6]: 'g6',
[InstanceClass.GRAPHICS6_EFFICIENT]: 'g6e',
[InstanceClass.G6E]: 'g6e',
[InstanceClass.GRAPHICS7_EFFICIENT]: 'g7e',
[InstanceClass.G7E]: 'g7e',
[InstanceClass.GRAPHICS_RAM_6]: 'gr6',
[InstanceClass.GR6]: 'gr6',
[InstanceClass.PARALLEL2]: 'p2',
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-eks/lib/private/nodegroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export function isGpuInstanceType(instanceType: InstanceType): boolean {
const knownGpuInstanceTypes = [InstanceClass.P2, InstanceClass.P3, InstanceClass.P3DN, InstanceClass.P4DE, InstanceClass.P4D,
InstanceClass.P5, InstanceClass.P5E, InstanceClass.P5EN,
InstanceClass.G3S, InstanceClass.G3, InstanceClass.G4DN, InstanceClass.G4AD, InstanceClass.G5, InstanceClass.G5G, InstanceClass.G6,
InstanceClass.G6E, InstanceClass.INF1, InstanceClass.INF2, InstanceClass.TRN1, InstanceClass.TRN1N, InstanceClass.TRN2];
InstanceClass.G6E, InstanceClass.G7E, InstanceClass.INF1, InstanceClass.INF2, InstanceClass.TRN1, InstanceClass.TRN1N, InstanceClass.TRN2];
return knownGpuInstanceTypes.some((c) => instanceType.sameInstanceClassAs(InstanceType.of(c, InstanceSize.LARGE)));
}
27 changes: 27 additions & 0 deletions packages/aws-cdk-lib/aws-eks/test/nodegroup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,32 @@ describe('node group', () => {
});
});

/**
* g7e instances (NVIDIA Blackwell B200) should be recognised as GPU and select
* AL2_x86_64_GPU automatically, matching the behaviour of g6e instances.
*/
test('amiType should be AL2_x86_64_GPU with g7e instanceType', () => {
// GIVEN
const { stack, vpc } = testFixture();

// WHEN
const cluster = new eks.Cluster(stack, 'Cluster', {
vpc,
defaultCapacity: 0,
version: CLUSTER_VERSION,
kubectlLayer: new KubectlV31Layer(stack, 'KubectlLayer'),
});
new eks.Nodegroup(stack, 'Nodegroup', {
cluster,
instanceTypes: [new ec2.InstanceType('g7e.2xlarge')],
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::EKS::Nodegroup', {
AmiType: 'AL2_x86_64_GPU',
});
});

/**
* When LaunchTemplate is undefined, amiType is AL2_x86_64 and instanceTypes are not x86_64,
* we should throw an error.
Expand Down Expand Up @@ -1851,6 +1877,7 @@ describe('isGpuInstanceType', () => {
ec2.InstanceType.of(ec2.InstanceClass.P4D, ec2.InstanceSize.LARGE),
ec2.InstanceType.of(ec2.InstanceClass.G6, ec2.InstanceSize.MEDIUM),
ec2.InstanceType.of(ec2.InstanceClass.G6E, ec2.InstanceSize.XLARGE2),
ec2.InstanceType.of(ec2.InstanceClass.G7E, ec2.InstanceSize.XLARGE2),
ec2.InstanceType.of(ec2.InstanceClass.INF1, ec2.InstanceSize.XLARGE),
ec2.InstanceType.of(ec2.InstanceClass.INF2, ec2.InstanceSize.XLARGE),
ec2.InstanceType.of(ec2.InstanceClass.P3, ec2.InstanceSize.XLARGE),
Expand Down
Loading