To install with conda:
pip install -r requirements.txt
pip install -e custom_envs
To install with Docker:
- Install Docker
- In
docker_build_local.shanddocker_run_local.sh, replacenicholascorradowith your Docker Hub username. - Run
./docker_build.sh - Run
./docker_run.sh
Build your Docker image:
- Install Docker
- In
docker_build_chtc.sh, replacenicholascorradowith your Docker Hub username. - Run
./docker_build_chtc.sh
After pushing your Docker image:
- In
job.sub, updatecontainer_image = docker://nicholascorrado/multitask-rlto point to your new Docker image.
You'll be using two terminal windows for this. One will be logged in to CHTC, and the other will be in the chtc directory on your local machine.
In this workflow, we transfer the code from our local machine to staging. Note that this means that any changes you've made locally to your code will be present when we run CHTC jobs. This workflow is nice because we can test out small code changes on CHTC without committing to the repo for every little change.
- On your local machine, do the following to make MultiTaskRL.tar.gz and copy it over to your staging directory. You'll need to edit
transfer_to_chtc.shso it uses your account rather than mine.cd chtc ./transfer_to_chtc.sh - Generate a text file containing the commands you want to run and place it in
chtc/commands. You can use a script to generate many commands. Seechtc/gen_commandsfor an example. The file should be formatted as follows:MEMORY,DISK,PYTHON COMMAND1,10,python ppo_continuous_action.py --env_id Hopper-v5 --learning_rate 0.0003 --num_steps 8192 --output_subdir lr_0.0003/ns_8192 --total_timesteps 1000000 - In CHTC,
git clonethis repo to your submit node (or do agit pullif your repo is already cloned). - In CHTC, copy the commands you generated to a new file
chtc/commands/{commands_file.txt}. - In CHTC,
cdto thechtcdirectory, and runsubmit.sh {commands_file.txt} {n}wherecommands_file.txtis in thecommandsdirectory, andndenote the number of trials you want to run each command for. For instance,n=10will run each experiment 10 times with seeds 0-9. - Results will be saved to
results/{commands_file}and job logs are saved tologs/{commands_file}.
After a job finishes, check the memory and disk usage in the the .log output to ensure you requested an appropriate amount.
If you requested much more than was actually used by the job, reduce it.
- On your local machine, do the following to make MultiTaskRL.tar.gz and copy it over to your staging directory. You'll need to edit
transfer_to_chtc.shso it uses your account rather than mine.cd chtc ./transfer_to_chtc.sh - In CHTC: In
job_i.sub, updatecontainer_image = docker://nicholascorrado/multitask-rlto point to your new Docker image. - In CHTC: Run
./submit_interactive.shto start an interactive session. - Once your interactive job starts, copy the following from
job.shinto the terminal to setup the code:CODENAME=MultiTaskRL cp /staging/ncorrado/${CODENAME}.tar.gz . tar -xzf ${CODENAME}.tar.gz rm ${CODENAME}.tar.gz cd MultiTaskRL export PYTHONPATH=custom-envs:$PYTHONPATH # pip install -e fails on chtc because we don't have admin privileges . mkdir gymnasium_local python -m pip install 'gymnasium[mujoco]==0.29.1' --target gymnasium_local python -m pip install 'mujoco==2.3.5' --target mujoco_local export PYTHONPATH=gymnasium_local:$PYTHONPATH export PYTHONPATH=mujoco_local:$PYTHONPATH - Now you can test out commands in the interactive job. If they run here, they will likely run when you submit them as non-interactive jobs.