Lesson 5 of 8 Performance and Purpose-Built Data Stores

Designing High-Performance Compute Environments

This lesson explains how the right instance family, placement and network adapter change the run time and cost of simulations, ML training, rendering and low-latency processing by an order of magnitude.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose an instance family from the limiting resource.
  • Distinguish tightly and loosely coupled workloads.
  • Explain when to use cluster placement groups and EFA.
  • Describe ParallelCluster, Parallel Computing Service and AWS Batch.

Instance families

The right instance family follows from the resource that limits performance. Compute-bound work runs on C instances, and tightly coupled HPC on Hpc instances. Memory-bound work, such as large in-memory databases, runs on R, X and High Memory instances. Work limited by storage I/O runs on I instances with local NVMe storage. GPU and machine learning work runs on P and G instances, on Trn instances with AWS Trainium for training, and on Inf instances with AWS Inferentia for inference. Graviton instances, based on Arm, give the best price performance for supported workloads. The following table summarises the families.

BottleneckFamily
ComputeC, and Hpc instances for tightly coupled HPC
MemoryR, X, and High Memory instances
Storage I/O (NVMe)I
GPU and MLP, G, Trn (Trainium for training), Inf (Inferentia for inference)
Price performanceGraviton (Arm)

Larger sizes also give more network bandwidth and EBS throughput.

Tightly and loosely coupled workloads

High-performance computing (HPC) workloads fall into two groups that need opposite designs. Tightly coupled workloads, such as weather simulation and computational fluid dynamics, split one problem across many nodes that exchange data constantly through the Message Passing Interface (MPI), so network latency limits the whole job. They run in a cluster placement group with the Elastic Fabric Adapter (EFA), in one Availability Zone, on instances of one type. Loosely coupled workloads, such as rendering frames, Monte Carlo risk calculations or processing genomics samples, consist of independent tasks that barely communicate. They are spread across Availability Zones and instance types, often on Spot Instances and managed by AWS Batch. The following table summarises the comparison.

Tightly coupled
ExampleWeather simulation, computational fluid dynamics
CommunicationConstant, between all nodes (MPI)
DesignCluster placement group, EFA, one AZ, instances of one type
Loosely coupled
ExampleRendering frames, Monte Carlo risk, genomics per sample
CommunicationNone or little between tasks
DesignSpread across AZs and instance types, Spot, AWS Batch

Networking and placement

Three tools provide the network performance that tightly coupled workloads need. A cluster placement group places instances physically close together in one Availability Zone, for the lowest latency and highest throughput between them. The Elastic Fabric Adapter (EFA) lets MPI and NCCL (the NVIDIA library for GPU communication) bypass the operating system's network stack, which cuts latency further. Enhanced networking with the Elastic Network Adapter (ENA) and jumbo frames raise bandwidth and packets per second within a VPC. The following table summarises the tools.

ToolProvides
Cluster placement groupsInstances close together in one AZ for low latency and high throughput
Elastic Fabric Adapter (EFA)OS-bypass networking for MPI and NCCL
Enhanced networking (ENA), jumbo framesHigher bandwidth and packets per second within a VPC

Managing clusters

HPC clusters are created and operated with purpose-built services rather than by hand. AWS ParallelCluster creates clusters with schedulers such as Slurm from a configuration file, including compute queues, shared storage and EFA networking, and scales compute nodes with the job queue. AWS Parallel Computing Service provides managed Slurm clusters, so the scheduler itself is operated by AWS. AWS Batch schedules containerised jobs on EC2, Spot or Fargate, which suits loosely coupled work.

For machine learning, SageMaker HyperPod runs large training clusters that recover automatically from node failures, and Capacity Blocks for ML reserve GPU instances for a defined future window, so a training run can be scheduled with certainty that its accelerators will be available.

Worked example

A computational fluid dynamics cluster

Engineers run MPI simulations across 64 nodes; performance is limited by inter-node latency. AWS ParallelCluster builds the environment from a configuration file:

Region: eu-west-1
Image:
  Os: alinux2023
HeadNode:
  InstanceType: c7i.xlarge
  Networking: { SubnetId: subnet-0private1 }
Scheduling:
  Scheduler: slurm
  SlurmQueues:
    - Name: cfd
      ComputeResources:
        - Name: hpc7g
          InstanceType: hpc7g.16xlarge
          MinCount: 0
          MaxCount: 64
          Efa: { Enabled: true }
      Networking:
        SubnetIds: [subnet-0private1]
        PlacementGroup: { Enabled: true }

Every element answers a specific bottleneck: Hpc instances provide high core counts and memory bandwidth, EFA provides OS-bypass networking for MPI, the cluster placement group keeps nodes physically close, and MinCount: 0 means compute nodes exist only while jobs run. The single-subnet, single-AZ layout is a deliberate trade of availability for performance, acceptable because a failed job can be rerun.

Check yourself

What does an Elastic Fabric Adapter provide for HPC workloads?

Show answer

Low-latency, OS-bypass networking for tightly coupled MPI workloads, used together with cluster placement groups.

Exam Tips

Remember for the exam

  • Tightly coupled HPC calls for a cluster placement group and EFA.
  • Loosely coupled batch work suits AWS Batch with Spot across many instance types.
  • To create and manage HPC clusters with Slurm, use AWS ParallelCluster or Parallel Computing Service.
  • For better price performance on general workloads, use Graviton.
  • For GPU capacity for a fixed training window, use Capacity Blocks for ML.