Skip to content

Commit 2f80e17

Browse files
matteobettinivmoens
authored andcommitted
[Environment, Docs] SMACv2 and docs on action masking (pytorch#1466)
Signed-off-by: Matteo Bettini <matbet@meta.com> Co-authored-by: vmoens <vincentmoens@gmail.com>
1 parent f5fa9de commit 2f80e17

File tree

11 files changed

+1352
-2
lines changed

11 files changed

+1352
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
channels:
2+
- pytorch
3+
- defaults
4+
dependencies:
5+
- pip
6+
- pip:
7+
- cloudpickle
8+
- gym
9+
- gym-notices
10+
- importlib-metadata
11+
- zipp
12+
- pytest
13+
- pytest-cov
14+
- pytest-mock
15+
- pytest-instafail
16+
- pytest-rerunfailures
17+
- pytest-error-for-skips
18+
- expecttest
19+
- pyyaml
20+
- numpy==1.23.0
21+
- git+https://github.com/oxwhirl/smacv2.git
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 %s\n" "${CU_VERSION}"
29+
if [ "${CU_VERSION:-}" == cpu ] ; then
30+
# conda install -y pytorch torchvision cpuonly -c pytorch-nightly
31+
# use pip to install pytorch as conda can frequently pick older release
32+
# conda install -y pytorch cpuonly -c pytorch-nightly
33+
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall
34+
else
35+
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall
36+
fi
37+
38+
# install tensordict
39+
pip install git+https://github.com/pytorch-labs/tensordict.git
40+
41+
# smoke test
42+
python -c "import tensordict"
43+
44+
printf "* Installing torchrl\n"
45+
python setup.py develop
46+
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)