From f6bb28f667dfa129a2af68d3ff4cce188f22c142 Mon Sep 17 00:00:00 2001 From: Tatsuya Mori Date: Fri, 5 Apr 2024 00:49:27 +0000 Subject: [PATCH 1/3] feat(ec2): support for g6 and gr6 instance types in aws-ec2 --- .../aws-cdk-lib/aws-ec2/lib/instance-types.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts index d4ee8c47e1d44..633959fdc9134 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -880,6 +880,26 @@ export enum InstanceClass { */ G5G = 'g5g', + /** + * Graphics-optimized instances powered by NVIDIA L4 Tensor Core GPUs, 6th generation + */ + GRAPHICS6 = 'graphics6', + + /** + * Graphics-optimized instances powered by NVIDIA L4 Tensor Core GPUs, 6th generation + */ + G6 = 'g6', + + /** + * Graphics-optimized instances powered by NVIDIA L4 Tensor Core GPUs with higher memory ratio, 6th generation + */ + GRAPHICS6_MEMORY = 'graphics6-memory', + + /** + * Graphics-optimized instances powered by NVIDIA L4 Tensor Core GPUs with higher memory ratio, 6th generation + */ + GR6 = 'gr6', + /** * Parallel-processing optimized instances, 2nd generation */ @@ -1556,6 +1576,10 @@ export class InstanceType { [InstanceClass.G5]: 'g5', [InstanceClass.GRAPHICS5_GRAVITON2]: 'g5g', [InstanceClass.G5G]: 'g5g', + [InstanceClass.GRAPHICS6]: 'g6', + [InstanceClass.G6]: 'g6', + [InstanceClass.GRAPHICS6_MEMORY]: 'gr6', + [InstanceClass.GR6]: 'gr6', [InstanceClass.PARALLEL2]: 'p2', [InstanceClass.P2]: 'p2', [InstanceClass.PARALLEL3]: 'p3', From 09cfe55c7068b26b43c39f0f2a4b993557a2845d Mon Sep 17 00:00:00 2001 From: Tatsuya Mori Date: Mon, 8 Apr 2024 16:16:34 +0000 Subject: [PATCH 2/3] Add g6 and g6r for isGpuInstanceType method --- packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts index d5ded21f4947a..5414cf520a3d8 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts @@ -597,6 +597,7 @@ function isGpuInstanceType(instanceType: InstanceType): boolean { //compare instanceType to known GPU InstanceTypes const knownGpuInstanceTypes = [InstanceClass.P2, InstanceClass.P3, InstanceClass.P3DN, InstanceClass.P4DE, InstanceClass.P4D, InstanceClass.G3S, InstanceClass.G3, InstanceClass.G4DN, InstanceClass.G4AD, InstanceClass.G5, InstanceClass.G5G, + InstanceClass.G6, InstanceClass.GR6, InstanceClass.INF1, InstanceClass.INF2]; return knownGpuInstanceTypes.some((c) => instanceType.sameInstanceClassAs(InstanceType.of(c, InstanceSize.LARGE))); } From 89b635ea6aae95c13495ae1c4566fb2501986699 Mon Sep 17 00:00:00 2001 From: Tatsuya Mori Date: Tue, 9 Apr 2024 00:29:29 +0000 Subject: [PATCH 3/3] fitting in one line --- packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts index 5414cf520a3d8..1780d87907af4 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts @@ -597,8 +597,7 @@ function isGpuInstanceType(instanceType: InstanceType): boolean { //compare instanceType to known GPU InstanceTypes const knownGpuInstanceTypes = [InstanceClass.P2, InstanceClass.P3, InstanceClass.P3DN, InstanceClass.P4DE, InstanceClass.P4D, InstanceClass.G3S, InstanceClass.G3, InstanceClass.G4DN, InstanceClass.G4AD, InstanceClass.G5, InstanceClass.G5G, - InstanceClass.G6, InstanceClass.GR6, - InstanceClass.INF1, InstanceClass.INF2]; + InstanceClass.G6, InstanceClass.GR6, InstanceClass.INF1, InstanceClass.INF2]; return knownGpuInstanceTypes.some((c) => instanceType.sameInstanceClassAs(InstanceType.of(c, InstanceSize.LARGE))); }