Skip to content

Commit 8949b19

Browse files
author
Vincent Moens
committed
Update
[ghstack-poisoned]
2 parents c69bf38 + e673c97 commit 8949b19

File tree

120 files changed

+5073
-2185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5073
-2185
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
- chess
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
8+
set -e
9+
10+
eval "$(./conda/bin/conda shell.bash hook)"
11+
conda activate ./env
12+
13+
if [ "${CU_VERSION:-}" == cpu ] ; then
14+
version="cpu"
15+
else
16+
if [[ ${#CU_VERSION} -eq 4 ]]; then
17+
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
18+
elif [[ ${#CU_VERSION} -eq 5 ]]; then
19+
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
20+
fi
21+
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION ($CU_VERSION)"
22+
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
23+
fi
24+
25+
# submodules
26+
git submodule sync && git submodule update --init --recursive
27+
28+
printf "Installing PyTorch with cu121"
29+
if [[ "$TORCH_VERSION" == "nightly" ]]; then
30+
if [ "${CU_VERSION:-}" == cpu ] ; then
31+
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu -U
32+
else
33+
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 -U
34+
fi
35+
elif [[ "$TORCH_VERSION" == "stable" ]]; then
36+
if [ "${CU_VERSION:-}" == cpu ] ; then
37+
pip3 install torch --index-url https://download.pytorch.org/whl/cpu
38+
else
39+
pip3 install torch --index-url https://download.pytorch.org/whl/cu121
40+
fi
41+
else
42+
printf "Failed to install pytorch"
43+
exit 1
44+
fi
45+
46+
# install tensordict
47+
if [[ "$RELEASE" == 0 ]]; then
48+
pip3 install git+https://github.com/pytorch/tensordict.git
49+
else
50+
pip3 install tensordict
51+
fi
52+
53+
# smoke test
54+
python -c "import functorch;import tensordict"
55+
56+
printf "* Installing torchrl\n"
57+
python setup.py develop
58+
59+
# smoke test
60+
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)