Difference between revisions of "Account and QOS limits under SLURM"

From UFRC
Jump to navigation Jump to search
 
(9 intermediate revisions by 5 users not shown)
Line 8: Line 8:
  
 
==Account and QOS==
 
==Account and QOS==
 
+
===Using/Finding the resources from a secondary group===
===Using the resources from a secondary group===
+
To view instructions on using SLURM resources from one of your secondary groups, or find what those associations are, view [[Checking and Using Secondary Resources]]
By default, when you submit a job on HiPerGator, it will use the resources from your primary group. You can easily see your primary and secondary groups with the <code>id</code> command:
 
 
 
[agator@login4 ~]$ id
 
uid=12345(agator) gid=12345(gator-group) groups=12345(gator-group),12346(second-group),12347(third-group)
 
[agator@login4 ~]$
 
 
 
As shown above, our fictional user <code>agator</code>'s primary group is <code>gator-group</code> and they also have secondary groups of <code>second-group</code> and <code>third-group</code>.
 
 
 
To use the resources of one of their secondary groups rather than their primary group, <code>agator</code> can use the <code>--account</code> and <code>--qos</code> flags, in the submit script, in the <code>sbatch</code> command or in the boxes in the Open on Demand interface.
 
For example, to use the <code>orange-group</code> they could:
 
[[File:OOD.account qos.screenshot.png|thumb|right|How to set account and qos options to use resources from a secondary group in Open on Demand]]
 
# In a submit script, add these lines:<code><br>#SBATCH --account=second-group<br>#SBATCH --qos=second-group</code>
 
# In the <code>sbatch</code> command: <code>sbatch --account=second-group --qos=second-group my_script.sh</code>
 
# Using Open on Demand:
 
# '''Note:''' Jupyterhub can only use your primary group's resources and cannot be used for accessing secondary group resources.
 
# '''Note:''' To use a secondary group's Burst QOS the --account= parameter is still 'second-group', while the --qos= parameter is 'second-group-b'.  The QOS is different, but the account remains the same.  This may make more sense by viewing the output of the showAssoc command in the ''See your associations'' section immediately below.
 
 
 
===See your associations===
 
 
 
On the command line, you can view your SLURM associations with the <code>showAssoc</code> command:
 
$ showAssoc <username>
 
 
 
'''Example:''' <code>$ showAssoc magitz</code> output:
 
<pre style="color:black; background:WhiteSmoke; border:1px solid gray;">
 
              User    Account  Def Acct  Def QOS                                      QOS
 
------------------ ---------- ---------- --------- ----------------------------------------
 
magitz                zoo6927      ufhpc    ufhpc zoo6927,zoo6927-b                       
 
magitz                  ufhpc      ufhpc    ufhpc ufhpc,ufhpc-b                           
 
magitz                soltis      ufhpc    soltis soltis,soltis-b                         
 
magitz                  borum      ufhpc    borum borum,borum-b 
 
</pre>
 
The output shows that the user <code>magitz</code> has four account associations and  8 different QOSes.  By convention, a user's default account is always the account of their primary group.  Additionally, their default QOS is the investment (high-priority) QOS.  If a user does not explicitly request a specific account and QOS, the user's default account and QOS will be assigned to the job.
 
 
 
If the user <code>magitz</code> wanted to use the <code>borum</code> group's account - which he has access by virtue of the <code>borum</code> account association - he would specify the account and the chosen QOS in his batch script as follows:
 
<pre>
 
#SBATCH  --account=borum
 
#SBATCH  --qos=borum
 
</pre>
 
Or, for the burst QOS:
 
<pre>
 
#SBATCH  --account=borum
 
#SBATCH  --qos=borum-b
 
</pre>
 
Note that both <code>--account</code> and <code>--qos</code> must be specified.  Otherwise scheduler will assume the default <code>ufhpc</code> account is intended, and neither the <code>borum</code> nor <code>borum-b</code> QOSes will be available to the job. Consequently, scheduler would deny the submission. In addition, you cannot mix and match resources from different allocations.
 
 
 
These sbatch directives can also be given as command line arguments to <code>srun</code>. For example:
 
$ srun --account=borum --qos=borum-b <example_command>
 
 
 
===QOS Resource Limits===
 
 
 
CPU cores, Memory (RAM), GPU accelerators, software licenses, etc. are referred to as '''Trackable Resources''' (TRES) by the scheduler. The TRES available in a given QOS are determined by the group's investments and the QOS configuration.
 
 
 
View a trackable resource limits for a QOS:
 
$ showQos <specified_qos>
 
 
 
'''Example:''' <code>$ showQos borum</code> output:
 
<pre style="color:black; background:WhiteSmoke; border:1px solid gray;">
 
                Name                          Descr                                      GrpTRES  GrpCPUs
 
-------------------- ------------------------------ --------------------------------------------- --------
 
borum                borum qos                      cpu=9,gres/gpu=0,mem=32400M                          9
 
</pre>
 
 
 
We can see that the <code>borum</code> investment QOS has a pool of 9 CPU cores, 32GB of RAM, and no GPUs. This pool of resources is shared among all members of the <code>borum</code> group. 
 
 
 
 
 
Similarly, the <code>borum-b></code> burst QOS resource limits shown by <code lang=bash>$ showQos borum-b</code> are:
 
 
 
<pre style="color:black; background:WhiteSmoke; border:1px solid gray;">
 
                Name                          Descr                                      GrpTRES  GrpCPUs
 
-------------------- ------------------------------ --------------------------------------------- --------
 
borum-b              borum burst qos                cpu=81,gres/gpu=0,mem=291600M                      81
 
</pre>
 
 
 
 
 
There are additional base priority and run time limits associated with QOSes. To display them run
 
<pre>
 
$ sacctmgr show qos format="name%-20,Description%-30,priority,maxwall" <specified_qos>
 
</pre>
 
'''Example:''' <code>$ sacctmgr show qos format="name%-20,Description%-30,priority,maxwall" borum borum-b</code> output:
 
 
 
<pre style="color:black; background:WhiteSmoke; border:1px solid gray;">
 
                Name                          Descr  Priority    MaxWall
 
-------------------- ------------------------------ ---------- -----------
 
borum                borum qos                          36000 31-00:00:00
 
borum-b              borum burst qos                      900  4-00:00:00
 
</pre>
 
 
 
The investment and burst QOS jobs are limited to 31 and 4 day run times, respectively. Additionally, the base priority of a burst QOS job is 1/40th that of an investment QOS job. It is important to remember that the base priority is only one component of the jobs overall priority and that the priority will change over time as the job waits in the queue.
 
 
 
The burst QOS cpu and memory limits are nine times (9x) those of the investment QOS up to a certain limit and are intended to allow groups to take advantage of unused resources short periods of time by borrowing resources from other groups.
 
 
 
=== QOS Time Limits ===
 
* Jobs with longer time limits are more difficult to schedule.
 
* Long time limits make system maintenance harder. We have to perform maintenance on the systems (OS updates, security patches, etc.). If the allowable time limits were longer, it could make  important maintenance tasks virtually impossible. Of particular importance is the ability to install security updates on the systems quickly and efficiently. If we cannot install them because user jobs are running for months at a time, we have to choose to either kill the user jobs or risk security issues on the system, which could affect all users.
 
* The longer a job runs, the more likely it is to end prematurely due to random hardware failure.
 
 
 
Thus, if the application allows saving and resuming the analysis it is recommended that instead of running jobs for extremely long times, you utilize checkpointing of your jobs so that you can restart them and run shorter jobs instead.
 
 
 
The 31 day investment QOS time limit on HiPerGator is generous compared to other major institutions. Here are examples we were able to find.
 
{| class="wikitable"
 
|-
 
! Institution !! Maximum Runtime
 
|-
 
|New York University|| 4 days
 
|-
 
|University of Southern California|| 2 weeks for 1 node, otherwise 1 day
 
|-
 
|PennState|| 2 weeks for up to 32 cores (contributors), 4 days for up to 256 cores otherwise
 
|-
 
|UMBC|| 5 days
 
|-
 
|TACC: Lonestar|| 1 day
 
|-
 
|Princeton: Della|| 6 days
 
|-
 
|University of Maryland || 14 days
 
|}
 
  
 
=== CPU cores and Memory (RAM) Resource Use===
 
=== CPU cores and Memory (RAM) Resource Use===
Line 135: Line 18:
 
  --partition=bigmem
 
  --partition=bigmem
  
When a job is submitted, if no resource request is provided, the default limits of 1 CPU core, 600MB of memory, and a 10 minute time limit will be set on the job by the scheduler. Check the resource request if it's not clear why the job ended before the analysis was done. Premature exit can be due to the job exceeding the time limit or the application using more memory than the request.
+
When a job is submitted, if no resource request is provided, the default limits of 1 CPU core, 4gb of memory, and a 10 minute time limit will be set on the job by the scheduler. Check the resource request if it's not clear why the job ended before the analysis was done. Premature exit can be due to the job exceeding the time limit or the application using more memory than the request.
  
 
Run testing jobs to find out what resource a particular analysis needs. To make sure that the analysis is performed successfully without wasting valuable resources you must specify both the number of CPU cores and the amount of memory needed for the analysis in the job script. See [[Sample SLURM Scripts]] for examples of specifying CPU core requests depending on the nature of the application running in a job. Use <code>--mem</code> (total job memory on a node) or <code>--mem-per-cpu</code> (per-core memory) options to request memory. Use <code>--time</code> to set a time limit to an appropriate value within the QOS limit.
 
Run testing jobs to find out what resource a particular analysis needs. To make sure that the analysis is performed successfully without wasting valuable resources you must specify both the number of CPU cores and the amount of memory needed for the analysis in the job script. See [[Sample SLURM Scripts]] for examples of specifying CPU core requests depending on the nature of the application running in a job. Use <code>--mem</code> (total job memory on a node) or <code>--mem-per-cpu</code> (per-core memory) options to request memory. Use <code>--time</code> to set a time limit to an appropriate value within the QOS limit.
  
As jobs are submitted and the resources under a particular account are consumed the group may reach either the CPU or Memory group limit. The group has consumed all cores in a QOS if the scheduler shows <code>QOSGrpCpuLimit</code> or memory if the scheduler shows <code>QOSGrpMemLimit</code> in the reason a job is pending ('NODELIST(REASON)' column of the <code>squeue</code> command output).
+
As jobs are submitted and the resources under a particular account are consumed the group may reach either the CPU or Memory group limit. The group has consumed all cores in a QOS if the scheduler shows <code>QOSGrpCpuLimit</code> or memory if the scheduler shows <code>QOSGrpMemLimit</code> in the reason a job is pending ('NODELIST(REASON)' column of the <code>squeue</code> command output). '''Example:'''
 
 
'''Example:'''
 
 
<pre>
 
<pre>
 
             JOBID PARTITION    NAME    USER ST      TIME  NODES NODELIST(REASON)
 
             JOBID PARTITION    NAME    USER ST      TIME  NODES NODELIST(REASON)
Line 155: Line 36:
 
</pre>
 
</pre>
  
=== GPU Resource Limits ===
+
=== Time and Resource Limits ===
  
As per the [https://www.rc.ufl.edu/documentation/policies/scheduler/ Scheduler/Job Policy], there is no burst QOS for GPU jobs.  
+
See [[SLURM Partition Limits]] for partition time limits.
 +
 
 +
For details on the limits placed on time and resources like GPUs on SLURM, view [[QOS Limits]].
 +
 
 +
To view a summary of currently active jobs for a group, use the slurmInfo command from the [https://help.rc.ufl.edu/doc/UFRC_environment_module ufrc module].
 +
 
 +
    slurmInfo -pu -g <i>groupname</i>
  
 
==Choosing QOS for a Job==
 
==Choosing QOS for a Job==
Line 163: Line 50:
  
 
==Example==
 
==Example==
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
 
''Expand this section to view extended example.''
 
<div class="mw-collapsible-content" style="padding: 5px;">
 
 
A hypothetical group ($GROUP in the examples below) has an investment of 42 CPU cores and 148GB of memory. That's the group's so-called ''soft limit'' for HiPerGator jobs in the investment qos for up to 744 hour time limit at high priority. The hard limit accessible through the so-called ''burst qos'' is 9 times that giving a group potentially a total of 10x the invested resources i.e. 420 total CPU cores and 1480GB of total memory with burst qos providing 378 CPU cores and 1330GB of total memory for up to 96 hours at low base priority.
 
A hypothetical group ($GROUP in the examples below) has an investment of 42 CPU cores and 148GB of memory. That's the group's so-called ''soft limit'' for HiPerGator jobs in the investment qos for up to 744 hour time limit at high priority. The hard limit accessible through the so-called ''burst qos'' is 9 times that giving a group potentially a total of 10x the invested resources i.e. 420 total CPU cores and 1480GB of total memory with burst qos providing 378 CPU cores and 1330GB of total memory for up to 96 hours at low base priority.
  
Line 224: Line 108:
 
srun: Job allocation 123458 has been revoked
 
srun: Job allocation 123458 has been revoked
 
srun: Force Terminated job
 
srun: Force Terminated job
</pre></div></div>
+
</pre>
  
 
==Pending Job Reasons==
 
==Pending Job Reasons==
 
To reiterate, the following ''Reasons'' can be seen in the <code>NODELIST(REASON)</code> column of the <code>squeue</code> command when the group reaches the resource limit for a QOS:
 
To reiterate, the following ''Reasons'' can be seen in the <code>NODELIST(REASON)</code> column of the <code>squeue</code> command when the group reaches the resource limit for a QOS:
 
+
<div style="column-count:2">
 
;QOSGrpCpuLimit
 
;QOSGrpCpuLimit
 
All CPU cores available for the listed account within the respective QOS are in use.
 
All CPU cores available for the listed account within the respective QOS are in use.
 
 
;QOSGrpMemLimit
 
;QOSGrpMemLimit
 
All memory available for the listed account within the respective QOS as described in the previous section is in use.
 
All memory available for the listed account within the respective QOS as described in the previous section is in use.
 
+
</div>
{{Note|Once it has marked any jobs in the group's list of pending jobs with a reason of <code>QOSGrpCpuLimit</code> or <code>QOSGrpMemLimit</code>, SLURM may not evaluate other jobs and they may simply be listed with the <code>Priority</code> reason code. See [https://help.rc.ufl.edu/doc/Why_is_my_job_not_running Why is my job not running] for a list of reasons.|reminder}}
+
{{Note|Once it has marked any jobs in the group's list of pending jobs with a reason of <code>QOSGrpCpuLimit</code> or <code>QOSGrpMemLimit</code>, SLURM may not evaluate other jobs and they may simply be listed with the <code>Priority</code> reason code. See [https://help.rc.ufl.edu/doc/FAQ FAQ] at the bottom of the page for a list of reasons.|reminder}}

Latest revision as of 17:37, 26 July 2024

Every group on HiPerGator (HPG) must have an investment with a corresponding hardware allocation to be able to do any work on HPG. Each allocation is associated with a scheduler account. Each account has two quality of service (QOS) levels - high-priority investment QOS and a low-priority burst QOS. The latter allows short-term borrowing of unused resources from other groups' accounts. In turn, each user in a group has a scheduler account association. In the end, it is this association which determines which QOSes are available to a particular user. Users with secondary Linux group membership will have associations with QOSes from their secondary groups.

In summary, each HPG user has scheduler associations with group account based QOSes that determine what resources are available to the users's jobs. These QOSes can be thought of as pools of computational (CPU cores), memory (RAM), maximum run time (time limit) resources with associated starting priority levels that can be consumed by jobs to run applications according to QOS levels, which we will review below.

Account and QOS

Using/Finding the resources from a secondary group

To view instructions on using SLURM resources from one of your secondary groups, or find what those associations are, view Checking and Using Secondary Resources

CPU cores and Memory (RAM) Resource Use

CPU cores and RAM are allocated to jobs independently as requested in job scripts. Considerations for selecting how many CPU cores and how much memory to request for a job must take into account the QOS limits based on the group investment, the limitations of the hardware (compute nodes), and the desire to be a good neighbor on a shared resource like HiPerGator to ensure that system resources are allocated efficiently, used fairly, and everyone has a chance to get their work done without causing negative impacts on work performed by other researchers.

HiPerGator consists of many interconnected servers (compute nodes). The hardware resources of each compute node, including CPU cores, memory, memory bandwidth, network bandwidth, and local storage are limited. If any single one of the above resources is fully consumed the remaining unused resources can become effectively wasted, which makes it progressively harder or even impossible to achieve the shared goals of Research Computing and the UF Researcher Community stated above. See the Available Node Features for details on the hardware on compute nodes. Nodes with similar hardware are generally separated into partitions. If the job requires larger nodes or particular hardware make sure to explicitly specify a partition. Example:

--partition=bigmem

When a job is submitted, if no resource request is provided, the default limits of 1 CPU core, 4gb of memory, and a 10 minute time limit will be set on the job by the scheduler. Check the resource request if it's not clear why the job ended before the analysis was done. Premature exit can be due to the job exceeding the time limit or the application using more memory than the request.

Run testing jobs to find out what resource a particular analysis needs. To make sure that the analysis is performed successfully without wasting valuable resources you must specify both the number of CPU cores and the amount of memory needed for the analysis in the job script. See Sample SLURM Scripts for examples of specifying CPU core requests depending on the nature of the application running in a job. Use --mem (total job memory on a node) or --mem-per-cpu (per-core memory) options to request memory. Use --time to set a time limit to an appropriate value within the QOS limit.

As jobs are submitted and the resources under a particular account are consumed the group may reach either the CPU or Memory group limit. The group has consumed all cores in a QOS if the scheduler shows QOSGrpCpuLimit or memory if the scheduler shows QOSGrpMemLimit in the reason a job is pending ('NODELIST(REASON)' column of the squeue command output). Example:

             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
            123456    bigmem test_job     jdoe PD       0:00      1 (QOSGrpMemLimit)

Reaching a resource limit of a QOS does not interfere with job submission. However, the jobs with this reason will not run and will remain in the pending state until the QOS use falls below the limit.

If the resource request for submitted job is impossible to satisfy within either the QOS limits or HiPerGator compute node hardware for a particular partition the scheduler will refuse the job submission altogether and return the following error message,

sbatch: error: Batch job submission failed: Job violates accounting/QOS policy 
               (job submit limit, user's size and/or time limits)

Time and Resource Limits

See SLURM Partition Limits for partition time limits.

For details on the limits placed on time and resources like GPUs on SLURM, view QOS Limits.

To view a summary of currently active jobs for a group, use the slurmInfo command from the ufrc module.

   slurmInfo -pu -g groupname

Choosing QOS for a Job

For advice on choosing QOS, go to Choosing QOS for a Job.

Example

A hypothetical group ($GROUP in the examples below) has an investment of 42 CPU cores and 148GB of memory. That's the group's so-called soft limit for HiPerGator jobs in the investment qos for up to 744 hour time limit at high priority. The hard limit accessible through the so-called burst qos is 9 times that giving a group potentially a total of 10x the invested resources i.e. 420 total CPU cores and 1480GB of total memory with burst qos providing 378 CPU cores and 1330GB of total memory for up to 96 hours at low base priority.

Let's test:

 [marvin@gator ~]$ srun --mem=126gb --pty bash -i

srun: job 123456 queued and waiting for resources

#Looks good, let's terminate the request with Ctrl+C>

^C
srun: Job allocation 123456 has been revoked
srun: Force Terminated job 123456

On the other hand, going even 1gb over that limit results in the already encountered job limit error

[marvin@gator ~]$ srun --mem=127gb --pty bash -i
srun: error: Unable to allocate resources: Job violates accounting/QOS policy (job submit limit, user's size and/or time limits

At this point the group can try using the 'burst' QOS with

#SBATCH --qos=$GROUP-b

Let's test:

[marvin@gator3 ~]$ srun -p bigmem --mem=400gb --time=96:00:00 --qos=$GROUP-b --pty bash -i

srun: job  123457 queued and waiting for resources

#Looks good, let's terminate with Ctrl+C

^C
srun: Job allocation 123457 has been revoked
srun: Force Terminated job 123457

However, now there's the burst qos time limit to consider.

[marvin@gator ~]$ srun --mem=400gb --time=300:00:00 --pty bash -i

srun: error: Unable to allocate resources: Job violates accounting/QOS policy (job submit limit, user's size and/or time limits

Let's reduce the time limit to what burst qos supports and try again.

[marvin@gator ~]$ srun --mem=400gb --time=96:00:00 --pty bash -i

srun: job  123458 queued and waiting for resources

#Looks good, let's terminate with Ctrl+C

^C
srun: Job allocation 123458 has been revoked
srun: Force Terminated job

Pending Job Reasons

To reiterate, the following Reasons can be seen in the NODELIST(REASON) column of the squeue command when the group reaches the resource limit for a QOS:

QOSGrpCpuLimit

All CPU cores available for the listed account within the respective QOS are in use.

QOSGrpMemLimit

All memory available for the listed account within the respective QOS as described in the previous section is in use.

Once it has marked any jobs in the group's list of pending jobs with a reason of QOSGrpCpuLimit or QOSGrpMemLimit, SLURM may not evaluate other jobs and they may simply be listed with the Priority reason code. See FAQ at the bottom of the page for a list of reasons.