Resource sharing and booking#
There are two systems for resource sharing on GPU clusters: GPU sharing and CPU/memory sharing. GPU sharing is managed through a calendar. CPU and memory are shared using resource quotas (and the calendar).
GPU booking#
Please allocate your GPUs on the computer resource calendar.
Warning
IMPORTANT: If you donโt have writing permission on this calendar please contact your supervisor; all NeuroPoly accounts should have access by default.
Use this format: u918374@rosenberg:gpu[3].
Note that the GPUs are numbered from 0, as you can see in nvidia-smi.
To train, run your scripts like this:
u918374@rosenberg:~$ CUDA_VISIBLE_DEVICES="3" ./train.sh
You can book multiple GPUs just with commas: u918374@rosenberg:gpu[2,3,5]
and use them with
u918374@rosenberg:~$ CUDA_VISIBLE_DEVICES="2,3,5" ./train.sh
Running memory- and CPU-intensive tasks#
Note
At the moment, this section only applies to romane, tassan, and joplin.
Some context
In order to prevent unresponsive systems due to resource intensive ML processes, some clusters have strict resource controls in place. Essentially, we impose limits on the amount of CPU and RAM available to a user (i.e., a single core of the CPU and a few GB of RAM). Most regular commands (git, scp, etc) should run fine under these limitations.
Most commands (git, scp, tmux, etc) should run just fine without modification.
For processes that need to use the full resources of the system, we have dedicated โslotsโ with a share of the systemโs RAM and CPU.
To run a heavy process:
Book one or more GPU slots (See GPU booking above). For joplin, select a range of slots between 0 and 3, inclusive, representing ยผ of available CPUs each.
Use the
set_slotutility script to assign your process to the appropriate slice:
set_slot <slot_number> [command] [args...]
<slot_number>is 0, 1, 2, or 3, corresponding to the GPU you are using, e.g.,set_slot 0 ...for GPU0.If youโve reserved more than one slot, you can specify an inclusive range, e.g.,
set_slot 0-1 ...for slots 0 and 1.
[command] [args...]is the (optional) command as you would normally run it in the shell, e.g.,python model.py. If you donโt specify a command, youโll be placed in a bash shell.
For example:
set_slot 2 CUDA_VISIBLE_DEVICES=2 python3 myscript.py
set_slot 0-3
Special considerations#
Environment variables are not currently passed through by
set_slot. To run in a specific environment, for example a venv, useset_slotto start a shell (e.g.set_slot 0 bash) and then work in that shell. (NB: the shell will not persist unless you run it in tmux or screen).If you need
condainsideset_slot, runset_slotwithout specifying the command. This will place you inside a bash login shell, which will put the proper folder inside thePATHenvironment variable.If you need to access duke inside
set_slot, runset_slotinside a shell (e.g.,set_slot 0), then runcifscreds add duke.neuro.polymtl.cain that shell. This will ensure that duke is still accessible when you detach or logouttmux/screen: You must start your session before you use set_slot.
tmuxandscreenmanage their own child processes, and will bypass our systemd slices and run in the limited user resource pool. Do NOT doset_slot 3 tmux new -s mysession! If you are using a shell AND tmux/screen you should do so in this order:tmuxortmux new -s mysessionset_slot 0
set_slot does not know anything about GPUs, so you still need to set the options with your tooling to use the appropriate GPU, e.g.,
CUDA_VISIBLE_DEVICES
set_slot FAQ#
What happens if I forget to do this, and accidentally run my training without set_slot?#
Your training wonโt have enough resources to run properly
Your individual user session may be borked
Nobody elseโs sessions or work will be borked
What happens if I send my process to the wrong pool? (e.g. I did set_slot 1, when I meant set_slot 0)#
This wonโt affect which GPU will be used.
BUT, you might end up competing for resources with someone else.
Try not to do this, and ask for help if you realize that you have.
What resources are available to me for trainings?#
Right now each GPU pool is limited to:
romane: ~100GB of RAM and 14 CPUs
tassan: ~46GB of RAM ad 20 CPUs