Running GPU jobs¶
To schedule a job on a GPU, provide the --gres=gpu:<count> option in the submission script. The following example schedules a job on a GPU node then lists the GPU card it was assigned
Note
Make sure to include -p gpu/-p interruptible_gpu in either the submission script or the command line when submitting the job or requesting a session (srun/salloc).
1 2 3 4 5 6 7 8 | |
In the above example, it calls for 2 GPUs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Note
The maximum number of 8 GPUs can be concurrently requested. For further scheduler policy information, see the following.
Note
A GPU enabled application will mostly likely make use of the NVidia CUDA libraries, to load the CUDA module use module load cuda in the job submission script.
Testing on the GPU¶
The interruptible_gpu partition gives access to all GPUs in CREATE, leading to a larger pool size that serves well as both a mechanism for testing GPU scheduling and making use of unused private resources, as detailed in our scheduler policy.
So it is still important to take note that, although faster scheduling may be facilitated, jobs may be cancelled at anytime.
Additionally, as the interruptible_gpu can be made up of a broad mix of GPU architectures, it may be useful to provide the following --constraint scheduler option with the job submissions:
1 | |
or a newer version:
1 | |
Note
Remember to replace the <count> with a number.
Constraints¶
The --constraint flage allows the scheduler to restrict the pool of GPUs.
How to find available constraints¶
To list all the nodes in a given partition(s) with groups that can access them and the features available, user sinfo, e.g.
1 | |
Which would output:
1 2 3 4 5 6 | |
This lists the following information::
%P: partition name e.g.gpu,interruptible_gpu%n: hostname e.g.erc-hpc-comp242%g: groups that can use said nodes e.g.er_hpc_create_users%f: available features e.g.icelake,a100,a100_40g, etc.
The above command helps list all gpu and interruptible_gpu partitions. To list all partitions, just remove the -p flag e.g.
1 | |
Example constraints¶
Now with the information provided we can set up example constraints:
--constraint="icelake": The scheduler restricts it to Icelake GPU nodes.--constraint="icelake&a100": The scheduler restricts to nodes with both Icelake and A100.--constraint="icelake|a100": The scheduler restricts to nodes with either Icelake or A100.--constraint="[icelake|a100|a100_40g|ib]": The scheduler restricts to nodes with either Icelake, A100, A100 40GB or IB.--constraint=icelake*2: The scheduler needs at least 2 nodes with Icelake.
For further information on --constraints flag for sbatch, please consult the SLURM documentation.
GPU credits for priority usage¶
Note
Information about paying for GPU access and costs can be found in the GPU pay per use section.
Each tier in the GPU pay per user table has a corresponding partition that gives access to the GPUs in that tier:
- Tier 1:
- Partition name:
tier1_gpu - GPUs available: B200, H200
- Partition name:
- Tier 2:
- Partition name:
tier2_gpu - GPUs available: B200, H200
- Partition name:
- Tier 3:
- Partition name:
tier2_gpu - GPUs available: B200, H200
- Partition name:
To use GPU credits, the project (account) the credits have been allocated to and a partition need to be specifed e.g.
1 | |
This can be combined with a --constraint to further specify the GPU (or any other feature required).