Configuring custom GRES settings in AWS PCS
Slurm uses gres.conf to manage Generic Resources (GRES), such as GPUs,
Multi-Process Service (MPS), and Multi-Instance GPU (MIG) devices, on compute nodes. AWS PCS lets
you customize gres.conf through the gresCustomSettings property of
slurmConfiguration during compute node group creation or update.
Unlike other custom settings, which are a flat list of parameter and value pairs,
gresCustomSettings is a list of records. Each record is a set
of gres.conf attributes that describes one GRES device or resource. For example,
the record Name=gpu Type=a100 File=/dev/nvidia[0-7] declares eight A100
GPUs.
In Slurm, a gres.conf record applies to every node in the cluster unless it
specifies a NodeName= prefix. AWS PCS always adds the NodeName= prefix
for the compute node group, so you don't specify it, and every record you supply applies only to
that compute node group. AWS PCS doesn't support cluster-wide gres.conf
records.
Configuring gres.conf settings
gres.conf custom settings can be configured through the AWS Console, CLI,
or SDKs during compute node group creation or modified later through update
operations.
Supported gres.conf settings for compute node groups
The following gres.conf attributes are supported in each record at the
compute node group level:
-
Note
AWS PCS supports
AutoDetecton Slurm version 25.11 and later.
For the meaning and accepted values of each attribute, see the Slurm gres.confName or an active AutoDetect value, and a GPU
record (Name=gpu) must specify File or MultipleFiles
unless an active AutoDetect value discovers the devices.
An active AutoDetect value is any value that turns
detection on, such as nvml or full. AutoDetect=off
turns detection off, so it is not an active value and can't stand alone in a record.
How AWS PCS applies your gres.conf records
A GRES configuration appears in two places in the Slurm configuration, and AWS PCS writes both of them:
-
The
gres.confrecords that you supply ingresCustomSettingsdescribe the devices that exist on the node. -
The
Gressetting inslurm.confdeclares what the scheduler can allocate, in the formname[:type]:count. You supply it as a custom Slurm setting for the compute node group, inslurmCustomSettings. For more information, see Custom Slurm settings for AWS PCS compute node groups.
AWS PCS renders your records into gres.conf and reconciles them with the GRES
configuration it manages:
-
If you declare a GPU record, it replaces the default GPU record that AWS PCS generates for the compute node group. A GPU record is a record that specifies
Name=gpuor anAutoDetectattribute. You can declare at most one GPU record for a compute node group. -
Records for other resources, such as
mps,shard, or a resource name of your own, are added alongside the AWS PCS defaults. -
AWS PCS derives the
GresTypessetting and thegres/*entries of theAccountingStorageTRESsetting inslurm.conffrom theGressetting.
On Slurm version 26.05 and later, AWS PCS sets AutoDetect=full by default on
GPU compute node groups when the node's socket layout is known, either because you set
Sockets in slurmCustomSettings for the compute node group, or
because AWS PCS detected the CPU topology automatically. When the socket layout is not
available, AWS PCS emits its GPU record without AutoDetect instead.
Constraints between gres.conf and the Gres setting
Slurm needs both sides of the GRES configuration to schedule a resource, and a resource
that appears in only one of them doesn't work. An entry in the Gres setting in slurm.conf
with no gres.conf record behind it makes the node report fewer resources than
are configured, and the node drains. A record with no Gres entry leaves the
device present on the node but not schedulable.
AWS PCS validates the two against each other when you create or update a compute node group, and rejects the request in the following cases:
-
A
slurm.confGresentry names a resource that nogres.confrecord declares. This includesgpu: agpuentry requires a GPU record ingresCustomSettings, even when the count is0. -
A
slurm.confGresentry declares a higher count of a resource than thegres.confrecords declare. A lower count is allowed, down to0: thegres.confrecords describe the devices that are present on the node, whileGresdeclares how many of them the scheduler can allocate. -
A
slurm.confGresentry specifies a GPU type that differs from theTypeof the GPU record ingres.conf.
The last two checks depend on what your records declare. AWS PCS can't count devices that
Slurm discovers when the node boots, so a record that only enables AutoDetect
accepts any gpu count and type in the Gres entry. This is how MIG
profiles pass validation. AWS PCS also skips the count check for shared GRES
(mps and shard), and skips the type check when the GPU record
declares no Type.
AWS PCS accepts a record that has no matching Gres entry. The resource exists
on the node, but jobs can't request it. Add the Gres entry to make it
schedulable.
Important
AWS PCS validates the syntax of your records and their consistency with the
Gres setting. It doesn't validate them against the hardware. A record whose
File, Cores, or Links layout doesn't match the
devices on the booted node makes the node drain. The same applies to MIG: the profiles
that you declare in Gres must match the profiles configured on the node. For
more information about diagnosing a drained node, see Troubleshoot invalid node registrations (INVALID_REG) in AWS PCS.