Show HN: A simple scheduler for running jobs on GPUs
github.com
github.com
simple_gpu_scheduler --gpus 0 1 2 < gpu_commands.txt
parallel -j3 --shuf CUDA_VISIBLE_DEVICES='{=1 $_=slot()-1 =} {=uq;=}' < gpu_commands.txt
simple_hypersearch "python3 train_dnn.py --lr {lr} --batch_size {bs}" -p lr 0.001 0.0005 0.0001 -p bs 32 64 128 | simple_gpu_scheduler --gpus 0,1,2
parallel --header : --shuf -j3 -v CUDA_VISIBLE_DEVICES='{=1 $_=slot()-1 =}' python3 train_dnn.py --lr {lr} --batch_size {bs} ::: lr 0.001 0.0005 0.0001 ::: bs 32 64 128
simple_hypersearch "python3 train_dnn.py --lr {lr} --batch_size {bs}" --n-samples 5 -p lr 0.001 0.0005 0.0001 -p bs 32 64 128 | simple_gpu_scheduler --gpus 0,1,2
parallel --header : --shuf CUDA_VISIBLE_DEVICES='{=1 $_=slot()-1; seq() > 5 and skip() =}' python3 train_dnn.py --lr {lr} --batch_size {bs} ::: lr 0.001 0.0005 0.0001 ::: bs 32 64 128
touch gpu.queue
tail -f -n 0 gpu.queue | simple_gpu_scheduler --gpus 0,1,2 &
echo "my_command_with | and stuff > logfile" >> gpu.queue
touch gpu.queue
tail -f -n 0 gpu.queue | parallel -j3 CUDA_VISIBLE_DEVICES='{=1 $_=slot()-1 =} {=uq;=}' &
# Needed to fill job slots once
seq 3 | parallel echo true >> gpu.queue
# Add jobs
echo "my_command_with | and stuff > logfile" >> gpu.queue
# Needed to flush output from completed jobs
seq 3 | parallel echo true >> gpu.queue The package can simply be installed from pypi
$ pip install simple_gpu_scheduler
When I run this, I get: ERROR: Could not find a version that satisfies the requirement simple_gpu_scheduler (from versions: none)
ERROR: No matching distribution found for simple_gpu_scheduler
on Ubuntu 16.04. Admittedly I don't know much about Python or pypi so perhaps the issue is on my end. Nonetheless, I'm not 100% sure how to resolve this. $ python3 -m pip3 install --user simple_gpu_scheduler
/usr/bin/python3: No module named pip3
$ python3 -m pip install --user simple_gpu_scheduler
ERROR: Could not find a version that satisfies the requirement simple_gpu_scheduler (from versions: none)
ERROR: No matching distribution found for simple_gpu_scheduler
$ python3 --version
Python 3.5.2
$ python3 -m pip --version
pip 19.3 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
If it requires Python 3.6, then it's not compatible with Ubuntu 16.04 LTS out of the box which uses 3.5What stopped you from using Slurm?
I can imagine it would be excruciating to explain our requirements to an external IT department and then go back and forth clarifying what we want, make them learn stuff they'd otherwise not need, convince them that we really need it, wait until they have time...
The downside is that things are not "professionally set up" (we're computer scientists but not pro admins), but at least if there's a deadline and something isn't working, we'll surely fix it because we have skin in the game.
> Note that the minimum index value is zero and the maximum value is a Slurm configuration parameter (MaxArraySize minus one).
Note that they say "the maximum value is a Slurm configuration parameter", not "the maximum value minus minimum value is a Slurm configuration parameter". The name of the parameter is confusing though, I admit.
Also, they prioritize paying customers when responding to bug tickets. Slurm is free software but if you want to interact with them, you need to pay. Nevertheless, for simple use cases (just scheduling a bunch of jobs) it's very comfortable to use. If you get into more complex territory (like array jobs), you'll need to read more docs.
And it scales very nicely from just one workstation up to the largest HPC clusters on the planet with complex accounting, multi-node jobs and so on.
(The name MaxArraySize definitely makes it seem more like this is a bug than intended, albeit documented, behavior.)
I looked into submitting a patch but unfortunately MaxArraySize is used in more places than I would have guessed, and lost interest in trying to test all of them.
In fact, I would go as far as to say that this scheduler is written in the spirit of Unix: make a task easy and provide a simple, chainable interface.