forked from pytorch/rl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Environment, Docs] SMACv2 and docs on action masking (pytorch#1466)
Signed-off-by: Matteo Bettini <[email protected]> Co-authored-by: vmoens <[email protected]>
- Loading branch information
1 parent
f5fa9de
commit 2f80e17
Showing
11 changed files
with
1,352 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
.github/unittest/linux_libs/scripts_smacv2/environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
channels: | ||
- pytorch | ||
- defaults | ||
dependencies: | ||
- pip | ||
- pip: | ||
- cloudpickle | ||
- gym | ||
- gym-notices | ||
- importlib-metadata | ||
- zipp | ||
- pytest | ||
- pytest-cov | ||
- pytest-mock | ||
- pytest-instafail | ||
- pytest-rerunfailures | ||
- pytest-error-for-skips | ||
- expecttest | ||
- pyyaml | ||
- numpy==1.23.0 | ||
- git+https://github.com/oxwhirl/smacv2.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/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 | ||
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]))")" | ||
fi | ||
|
||
# submodules | ||
git submodule sync && git submodule update --init --recursive | ||
|
||
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 | ||
# conda install -y pytorch cpuonly -c pytorch-nightly | ||
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall | ||
else | ||
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall | ||
fi | ||
|
||
# install tensordict | ||
pip install git+https://github.com/pytorch-labs/tensordict.git | ||
|
||
# smoke test | ||
python -c "import tensordict" | ||
|
||
printf "* Installing torchrl\n" | ||
python setup.py develop | ||
python -c "import torchrl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.