Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Mar 31, 2022
0 parents commit 240975b
Show file tree
Hide file tree
Showing 165 changed files with 32,669 additions and 0 deletions.
442 changes: 442 additions & 0 deletions .circleci/config.yml

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions .circleci/unittest/linux/scripts/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
channels:
- pytorch
- defaults
dependencies:
- pip
- cmake >= 3.18
- pip:
- hypothesis
- protobuf
- future
- cloudpickle
- gym_retro
- gym
- pygame
- gym[accept-rom-license]
- gym[atari]
- moviepy
- tqdm
- pytest
- pytest-cov
- pytest-mock
- expecttest
- pyyaml
- scipy
- dm_control
- mujoco_py
62 changes: 62 additions & 0 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

unset PYTORCH_VERSION
# For unittest, nightly PyTorch is used as the following section,
# so no need to set PYTORCH_VERSION.
# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config.

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env

if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly"
version="cpu"
else
if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
elif [[ ${#CU_VERSION} -eq 5 ]]; then
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION ($CU_VERSION)"
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="cudatoolkit=${version}"
fi

case "$(uname -s)" in
Darwin*) os=MacOSX;;
*) os=Linux
esac

# submodules
git submodule sync && git submodule update --init --recursive

#printf "Installing PyTorch with %s\n" "${cudatoolkit}"
#if [ "${os}" == "MacOSX" ]; then
# conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
#else
# conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
#fi

#printf "Installing PyTorch with %s\n" "${CU_VERSION}"
if [ "${CU_VERSION:-}" == cpu ] ; then
# conda install -y pytorch torchvision cpuonly -c pytorch-nightly
# use pip to install pytorch as conda can frequently pick older release
pip install torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre
else
conda install -y pytorch torchvision cudatoolkit=10.2 -c pytorch-nightly
fi

printf "Installing functorch\n"
pip install ninja # Makes the build go faster
pip install "git+https://github.com/pytorch/functorch.git"

# smoke test
python -c "import functorch"

printf "* Installing torchrl\n"
python setup.py develop

# smoke test
python -c "import torchrl"
6 changes: 6 additions & 0 deletions .circleci/unittest/linux/scripts/post_process.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e

eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
Loading

0 comments on commit 240975b

Please sign in to comment.