View a markdown version of this page

Detecting and repairing hardware faults with instance health checks - AWS PCS

Detecting and repairing hardware faults with instance health checks

A fault in an instance's GPU or accelerator can stop or slow every job that runs on the compute node. Amazon EC2 status checks can miss these faults, because they check whether the instance and its host are reachable and working, not whether its GPUs or accelerators work correctly. Instance health checks find them and act on the compute node through Slurm, so that the scheduler stops placing jobs there.

Prerequisites

To use instance health checks, you need the following:

  • The cluster must use Slurm version 26.05 or later.

  • The AMI must have AWS PCS agent version 1.6.0-1 or later. With an older agent, compute nodes start with no checks, and AWS PCS reports no error. For more information, see AWS PCS agent versions.

  • The AMI must use a supported operating system other than Amazon Linux 2.

  • For GPU instances, the AMI must have the NVIDIA driver and NVIDIA Data Center GPU Manager (DCGM) version 4. Also enable GPU persistence mode (nvidia-persistenced); without it, every deep health check reports a Warning. For more information, see Every deep health check reports a Warning.

  • For deep health checks, every instance type in the compute node group must have an NVIDIA GPU. Health monitoring has no instance type requirement.

Instance health checks don't need additional IAM permissions.

Turning on health monitoring with the default settings

To turn on health monitoring for a compute node group that doesn't have instance health checks yet, run the following command. To turn it on when you create a compute node group, add the same option to create-compute-node-group.

aws pcs update-compute-node-group --region region \ --cluster-identifier my-cluster \ --compute-node-group-identifier my-node-group \ --instance-health-checks '{"healthMonitoring": {"mode": "STANDARD"}}'

Replace region with the ID of the AWS Region where your cluster is. This configuration does the following:

  • An agent on each instance checks the GPUs, AWS Neuron devices, and Elastic Fabric Adapter (EFA) devices for faults while the compute node runs jobs.

  • When the agent finds a fault that needs repair, AWS PCS applies the default repair action, AUTO.

  • Deep health checks stay off.

In the console, turn on Enable health monitoring in the Instance health checks section of the create or edit page. For all the settings and the console steps, see Configuring instance health checks.

Important

Like other changes to a compute node group, changing instance health checks drains the compute nodes and replaces their instances. Make the change when the compute node group has few running jobs.

Checking that health monitoring is running

After instances launch with the new settings, run the following command on a login node, for a compute node whose instance is running.

scontrol show node node-name | grep Comment

The output looks like the following.

Comment={"health":"healthy","monitors":[{"monitor_type":"AcceleratedHardwareReady","status":"healthy","codes":[]},{"monitor_type":"NetworkingReady","status":"healthy","codes":[]}]}

The Comment field shows the agent's result, for example "health":"healthy". On an instance without GPUs, Neuron devices, or EFA devices, it shows "health":"not-monitoring". If the Comment is empty, see Health checks are turned on, but nothing runs. To read the results, see Checking compute node health in Slurm.

Choosing a configuration

Change the default settings in the following cases.

You want to find faults before jobs run on a new instance

Also turn on deep health checks. Start with the QUICK or MEDIUM profile. For the start time limit, see Start time limit.

{"healthMonitoring": {"mode": "STANDARD"}, "deepHealthChecks": {"onStart": {"profile": "MEDIUM"}}}

For more information, see Running deep health checks when compute nodes start.

You want to keep a faulty instance to investigate it

Use the ISOLATE repair action. The compute node stays out of service, and its instance keeps running and is billed, until you return it to service. A compute node above the group's minimum instance count is still scaled down when its idle time is reached, even while it is isolated, and AWS PCS terminates its instance.

{"healthMonitoring": {"mode": "STANDARD", "repairAction": "ISOLATE"}}
You want to see what health checks find before they act

Use the NONE repair action. The agent reports faults in the compute node's Comment field and changes nothing. Change the repair action when you trust the results.

{"healthMonitoring": {"mode": "STANDARD", "repairAction": "NONE"}}

Repair actions

Each fault that a health check finds has a condition code, such as GPU_ECC_DBE, and a severity. Only a fault with Fatal severity starts the repair action. AWS PCS reports a Warning fault but doesn't act on it.

The repair action is what AWS PCS does with the compute node when a health check finds a Fatal fault, as the following table shows.

Repair actions

Repair action

Slurm state

What happens

AUTO (default)

Console: Automatic

Depends on the action

AWS PCS chooses the action.

REPLACE

Console: Replace

POWER_DOWN_ASAP

The compute node takes no new jobs. Its running jobs finish, and then AWS PCS replaces the instance. If a deep health check finds the fault while the instance starts, AWS PCS replaces the instance immediately.

ISOLATE

Console: Isolate

FAIL

The compute node takes no new jobs, and its running jobs continue. It stays in the FAIL state until you return it to service, so you can investigate the instance, which keeps running and is billed. AWS PCS still scales down a compute node above the group's minimum instance count when its idle time is reached, and terminates its instance. To collect data before then, see Collecting diagnostic data from an instance.

NONE

Console: None

No change

AWS PCS doesn't change the compute node's state. The health check writes the fault to the compute node's Slurm Comment field.

AWS PCS never returns a compute node to service by itself. It stays out of service until you return it to service or AWS PCS replaces its instance. For more information, see Checking compute node health in Slurm.

Before you turn on instance health checks

AWS PCS doesn't limit how many compute nodes it repairs at once. If a problem affects many instances, start with the repair action NONE.