60 points · by ExpectationMax · 7y ago · 28 comments
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.5In 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.
What stopped you from using Slurm?