Skip to content

Commit 6d217c6

Browse files
author
Vincent Moens
authored
[Feature] V-D4RL (#1756)
1 parent d125dd9 commit 6d217c6

File tree

32 files changed

+1077
-42
lines changed

32 files changed

+1077
-42
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
channels:
2+
- pytorch
3+
- defaults
4+
dependencies:
5+
- pip
6+
- pip:
7+
- hypothesis
8+
- future
9+
- cloudpickle
10+
- pytest
11+
- pytest-cov
12+
- pytest-mock
13+
- pytest-instafail
14+
- pytest-rerunfailures
15+
- pytest-error-for-skips
16+
- expecttest
17+
- pyyaml
18+
- scipy
19+
- hydra-core
20+
- huggingface_hub
21+
- tqdm
22+
- h5py
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
3+
unset PYTORCH_VERSION
4+
# For unittest, nightly PyTorch is used as the following section,
5+
# so no need to set PYTORCH_VERSION.
6+
# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config.
7+
apt-get update && apt-get install -y git wget gcc g++
8+
#apt-get update && apt-get install -y git wget freeglut3 freeglut3-dev
9+
10+
set -e
11+
12+
eval "$(./conda/bin/conda shell.bash hook)"
13+
conda activate ./env
14+
15+
if [ "${CU_VERSION:-}" == cpu ] ; then
16+
version="cpu"
17+
else
18+
if [[ ${#CU_VERSION} -eq 4 ]]; then
19+
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
20+
elif [[ ${#CU_VERSION} -eq 5 ]]; then
21+
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
22+
fi
23+
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION ($CU_VERSION)"
24+
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
25+
fi
26+
27+
28+
# submodules
29+
git submodule sync && git submodule update --init --recursive
30+
31+
printf "Installing PyTorch with %s\n" "${CU_VERSION}"
32+
if [ "${CU_VERSION:-}" == cpu ] ; then
33+
# conda install -y pytorch torchvision cpuonly -c pytorch-nightly
34+
# use pip to install pytorch as conda can frequently pick older release
35+
# conda install -y pytorch cpuonly -c pytorch-nightly
36+
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
37+
else
38+
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu121
39+
fi
40+
41+
# install tensordict
42+
pip install git+https://github.com/pytorch/tensordict.git
43+
44+
# smoke test
45+
python -c "import functorch;import tensordict"
46+
47+
printf "* Installing torchrl\n"
48+
python setup.py develop
49+
50+
# smoke test
51+
python -c "import torchrl"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
eval "$(./conda/bin/conda shell.bash hook)"
6+
conda activate ./env

0 commit comments

Comments
 (0)