Slurm 的多实例类型分配 - Amazon ParallelCluster
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Slurm 的多实例类型分配

从 Amazon ParallelCluster 版本 3.3.0 开始,您可以将集群配置为从计算资源的一组已定义的实例类型中进行分配。分配可以基于 EC2 实例集低成本或最佳容量策略。

这组已定义的实例类型必须全部具有相同数量的 vCPU,或者如果禁用了多线程,则必须具有相同数量的内核。此外,这组实例类型必须具有相同制造商的相同数量的加速器。如果 Efa/Enabled 设置为 true,则实例必须支持 EFA。有关更多信息和要求,请参阅 Scheduling/SlurmQueues/AllocationStrategyComputeResources/Instances

根据 CapacityType 配置,您可以将 AllocationStrategy 设置为 lowest-pricecapacity-optimized

Instances 中,您可以配置一组实例类型。

注意

从 Amazon ParallelCluster 版本 3.7.0 开始,如果您在 Instances 中配置多种实例类型,则可以启用 EnableMemoryBasedScheduling

对于 Amazon ParallelCluster 版本 3.2.0 至 3.6.x,如果您在 Instances 中配置多种实例类型,则无法启用 EnableMemoryBasedScheduling

以下示例说明了如何查询 vCPU、EFA 支持和架构的实例类型。

查询具有 96 个 vCPU 和 x86_6_64 架构的 InstanceTypes。

$ aws ec2 describe-instance-types --region region-id \ --filters "Name=vcpu-info.default-vcpus,Values=96" "Name=processor-info.supported-architecture,Values=x86_64" \ --query "sort_by(InstanceTypes[*].{InstanceType:InstanceType,MemoryMiB:MemoryInfo.SizeInMiB,CurrentGeneration:CurrentGeneration,VCpus:VCpuInfo.DefaultVCpus,Cores:VCpuInfo.DefaultCores,Architecture:ProcessorInfo.SupportedArchitectures[0],MaxNetworkCards:NetworkInfo.MaximumNetworkCards,EfaSupported:NetworkInfo.EfaSupported,GpuCount:GpuInfo.Gpus[0].Count,GpuManufacturer:GpuInfo.Gpus[0].Manufacturer}, &InstanceType)" \ --output table

查询具有 64 个内核、EFA 支持和 arm64 架构的 InstanceTypes。

$ aws ec2 describe-instance-types --region region-id \ --filters "Name=vcpu-info.default-cores,Values=64" "Name=processor-info.supported-architecture,Values=arm64" "Name=network-info.efa-supported,Values=true" --query "sort_by(InstanceTypes[*].{InstanceType:InstanceType,MemoryMiB:MemoryInfo.SizeInMiB,CurrentGeneration:CurrentGeneration,VCpus:VCpuInfo.DefaultVCpus,Cores:VCpuInfo.DefaultCores,Architecture:ProcessorInfo.SupportedArchitectures[0],MaxNetworkCards:NetworkInfo.MaximumNetworkCards,EfaSupported:NetworkInfo.EfaSupported,GpuCount:GpuInfo.Gpus[0].Count,GpuManufacturer:GpuInfo.Gpus[0].Manufacturer}, &InstanceType)" \ --output table

下一个集群配置代码段示例显示了如何使用这些 InstanceType 和 AllocationStrategy 属性。

... Scheduling: Scheduler: slurm SlurmQueues: - Name: queue-1 CapacityType: ONDEMAND AllocationStrategy: lowest-price ... ComputeResources: - Name: computeresource1 Instances: - InstanceType: r6g.2xlarge - InstanceType: m6g.2xlarge - InstanceType: c6g.2xlarge MinCount: 0 MaxCount: 500 - Name: computeresource2 Instances: - InstanceType: m6g.12xlarge - InstanceType: x2gd.12xlarge MinCount: 0 MaxCount: 500 ...