Skip to content

Commit 5ec5981

Browse files
author
Vincent Moens
committed
Update
[ghstack-poisoned]
2 parents 11f7d8a + 93115f8 commit 5ec5981

File tree

441 files changed

+22992
-9474
lines changed

Some content is hidden

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

441 files changed

+22992
-9474
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
pip install --upgrade setuptools
4+
5+
export TORCHRL_BUILD_VERSION=0.8.0

.github/scripts/pre-build-script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
pip install --upgrade setuptools
4+
5+
${CONDA_RUN} pip install "pybind11[global]"
6+
${CONDA_RUN} conda install anaconda::cmake -y
7+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U

.github/scripts/td_script.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
#!/bin/bash
22

3-
export TORCHRL_BUILD_VERSION=0.6.1
3+
export TORCHRL_BUILD_VERSION=0.8.0
4+
pip install --upgrade setuptools
45

5-
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U
6+
# Check if ARCH is set to aarch64
7+
ARCH=${ARCH:-} # This sets ARCH to an empty string if it's not defined
8+
9+
if pip list | grep -q torch; then
10+
echo "Torch is installed."
11+
12+
# ${CONDA_RUN} conda install 'anaconda::cmake>=3.22' -y
13+
14+
${CONDA_RUN} pip install "pybind11[global]"
15+
16+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U --no-deps
17+
elif [[ -n "${SMOKE_TEST_SCRIPT:-}" ]]; then
18+
${CONDA_RUN} ${PIP_INSTALL_TORCH}
19+
# TODO: revert when nightlies of tensordict are fixed
20+
# if [[ "$ARCH" == "aarch64" ]]; then
21+
22+
23+
# ${CONDA_RUN} conda install 'anaconda::cmake>=3.22' -y
24+
25+
${CONDA_RUN} pip install "pybind11[global]"
26+
27+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U --no-deps
28+
else
29+
echo "Torch is not installed - tensordict will be installed later."
30+
fi

.github/scripts/version_script.bat

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
11
@echo off
2-
set TORCHRL_BUILD_VERSION=0.6.1
2+
set TORCHRL_BUILD_VERSION=0.8.0
33
echo TORCHRL_BUILD_VERSION is set to %TORCHRL_BUILD_VERSION%
4+
5+
@echo on
6+
7+
set VC_VERSION_LOWER=17
8+
set VC_VERSION_UPPER=18
9+
if "%VC_YEAR%" == "2019" (
10+
set VC_VERSION_LOWER=16
11+
set VC_VERSION_UPPER=17
12+
)
13+
if "%VC_YEAR%" == "2017" (
14+
set VC_VERSION_LOWER=15
15+
set VC_VERSION_UPPER=16
16+
)
17+
18+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do (
19+
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
20+
set "VS15INSTALLDIR=%%i"
21+
set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat"
22+
goto vswhere
23+
)
24+
)
25+
26+
:vswhere
27+
if "%VSDEVCMD_ARGS%" == "" (
28+
call "%VS15VCVARSALL%" x64 || exit /b 1
29+
) else (
30+
call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1
31+
)
32+
33+
@echo on
34+
35+
if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
36+
37+
set DISTUTILS_USE_SDK=1
38+
39+
:: Upgrade setuptools before installing PyTorch
40+
pip install --upgrade setuptools==72.1.0 || exit /b 1
41+
42+
set args=%1
43+
shift
44+
:start
45+
if [%1] == [] goto done
46+
set args=%args% %1
47+
shift
48+
goto start
49+
50+
:done
51+
if "%args%" == "" (
52+
echo Usage: vc_env_helper.bat [command] [args]
53+
echo e.g. vc_env_helper.bat cl /c test.cpp
54+
)
55+
56+
%args% || exit /b 1

.github/unittest/helpers/coverage_run_parallel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def write_config(config_path: Path, argv: List[str]) -> None:
2828
argv: Arguments passed to this script, which need to be converted to config file entries
2929
"""
3030
assert not config_path.exists(), "Temporary coverage config exists already"
31-
cmdline = " ".join(shlex.quote(arg) for arg in argv[1:])
32-
with open(str(config_path), "wt", encoding="utf-8") as fh:
31+
cmdline = shlex.join(argv[1:])
32+
with open(str(config_path), "w", encoding="utf-8") as fh:
3333
fh.write(
3434
f"""# .coveragerc to control coverage.py
3535
[run]

.github/unittest/linux/scripts/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ dependencies:
1717
- pytest-instafail
1818
- pytest-rerunfailures
1919
- pytest-timeout
20+
- pytest-asyncio
2021
- expecttest
22+
- pybind11[global]
2123
- pyyaml
2224
- scipy
2325
- hydra-core

.github/unittest/linux/scripts/run_all.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ set -v
99

1010
if [[ $OSTYPE != 'darwin'* ]]; then
1111
apt-get update && apt-get upgrade -y
12-
apt-get install -y vim git wget libsdl2-dev libsdl2-2.0-0
12+
apt-get install -y vim git wget libsdl2-dev libsdl2-2.0-0 cmake
1313

1414
apt-get install -y libglfw3 libgl1-mesa-glx libosmesa6 libglew-dev
15-
apt-get install -y libglvnd0 libgl1 libglx0 libegl1 libgles2
15+
apt-get install -y libglvnd0 libgl1 libglx0 libegl1 libgles2 xvfb
1616

1717
if [ "${CU_VERSION:-}" == cpu ] ; then
1818
# solves version `GLIBCXX_3.4.29' not found for tensorboard
@@ -76,11 +76,12 @@ else
7676
export MUJOCO_GL=egl
7777
fi
7878

79-
export DISPLAY=:0
8079
export SDL_VIDEODRIVER=dummy
8180

8281
# legacy from bash scripts: remove?
83-
conda env config vars set MUJOCO_GL=$MUJOCO_GL PYOPENGL_PLATFORM=$MUJOCO_GL DISPLAY=:0 SDL_VIDEODRIVER=dummy LAZY_LEGACY_OP=False RL_LOGGING_LEVEL=DEBUG
82+
conda env config vars set \
83+
MAX_IDLE_COUNT=1000 \
84+
MUJOCO_GL=$MUJOCO_GL PYOPENGL_PLATFORM=$MUJOCO_GL DISPLAY=:99 SDL_VIDEODRIVER=dummy LAZY_LEGACY_OP=False RL_LOGGING_LEVEL=DEBUG TOKENIZERS_PARALLELISM=true
8485

8586
pip3 install pip --upgrade
8687
pip install virtualenv
@@ -95,9 +96,9 @@ echo "installing gymnasium"
9596
if [[ "$PYTHON_VERSION" == "3.12" ]]; then
9697
pip3 install ale-py
9798
pip3 install sympy
98-
pip3 install "gymnasium[accept-rom-license,mujoco]<1.0" mo-gymnasium[mujoco]
99+
pip3 install "gymnasium[mujoco]>=1.1" mo-gymnasium[mujoco]
99100
else
100-
pip3 install "gymnasium[atari,accept-rom-license,mujoco]<1.0" mo-gymnasium[mujoco]
101+
pip3 install "gymnasium[atari,mujoco]>=1.1" mo-gymnasium[mujoco]
101102
fi
102103
pip3 install "mujoco" -U
103104

@@ -200,6 +201,8 @@ export CKPT_BACKEND=torch
200201
export MAX_IDLE_COUNT=100
201202
export BATCHED_PIPE_TIMEOUT=60
202203

204+
Xvfb :99 -screen 0 1024x768x24 &
205+
203206
pytest test/smoke_test.py -v --durations 200
204207
pytest test/smoke_test_deps.py -v --durations 200 -k 'test_gym or test_dm_control_pixels or test_dm_control or test_tb'
205208
if [ "${CU_VERSION:-}" != cpu ] ; then

.github/unittest/linux_distributed/scripts/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ dependencies:
1616
- pytest-mock
1717
- pytest-instafail
1818
- pytest-rerunfailures
19+
- pytest-asyncio
1920
- expecttest
21+
- pybind11[global]
2022
- pyyaml
2123
- scipy
2224
- hydra-core

.github/unittest/linux_distributed/scripts/setup_env.sh

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ fi
6464

6565
export MUJOCO_GL=$PRIVATE_MUJOCO_GL
6666
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
67-
DISPLAY=unix:0.0 \
67+
MAX_IDLE_COUNT=1000 \
68+
DISPLAY=:99 \
6869
MJLIB_PATH=$root_dir/.mujoco/mujoco-2.1.1/lib/libmujoco.so.2.1.1 \
6970
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root_dir/.mujoco/mujoco210/bin \
7071
SDL_VIDEODRIVER=dummy \
7172
MUJOCO_GL=$PRIVATE_MUJOCO_GL \
72-
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL
73+
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL \
74+
TOKENIZERS_PARALLELISM=true
7375

7476
# Software rendering requires GLX and OSMesa.
7577
if [ $PRIVATE_MUJOCO_GL == 'egl' ] || [ $PRIVATE_MUJOCO_GL == 'osmesa' ] ; then
@@ -94,32 +96,8 @@ if [[ $OSTYPE != 'darwin'* ]]; then
9496
# install ale-py: manylinux names are broken for CentOS so we need to manually download and
9597
# rename them
9698
PY_VERSION=$(python --version)
97-
echo "installing ale-py for ${PY_PY_VERSION}"
98-
if [[ $PY_VERSION == *"3.7"* ]]; then
99-
wget https://files.pythonhosted.org/packages/ab/fd/6615982d9460df7f476cad265af1378057eee9daaa8e0026de4cedbaffbd/ale_py-0.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
100-
pip install ale_py-0.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
101-
rm ale_py-0.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
102-
elif [[ $PY_VERSION == *"3.8"* ]]; then
103-
wget https://files.pythonhosted.org/packages/0f/8a/feed20571a697588bc4bfef05d6a487429c84f31406a52f8af295a0346a2/ale_py-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
104-
pip install ale_py-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
105-
rm ale_py-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
106-
elif [[ $PY_VERSION == *"3.9"* ]]; then
107-
wget https://files.pythonhosted.org/packages/a0/98/4316c1cedd9934f9a91b6e27a9be126043b4445594b40cfa391c8de2e5e8/ale_py-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
108-
pip install ale_py-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
109-
rm ale_py-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
110-
elif [[ $PY_VERSION == *"3.10"* ]]; then
111-
wget https://files.pythonhosted.org/packages/60/1b/3adde7f44f79fcc50d0a00a0643255e48024c4c3977359747d149dc43500/ale_py-0.8.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
112-
mv ale_py-0.8.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl ale_py-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
113-
pip install ale_py-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
114-
rm ale_py-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
115-
elif [[ $PY_VERSION == *"3.11"* ]]; then
116-
wget https://files.pythonhosted.org/packages/60/1b/3adde7f44f79fcc50d0a00a0643255e48024c4c3977359747d149dc43500/ale_py-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
117-
mv ale_py-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl ale_py-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
118-
pip install ale_py-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
119-
rm ale_py-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
120-
fi
12199
echo "installing gymnasium"
122-
pip install "gymnasium[atari,accept-rom-license]<1.0"
100+
pip install "gymnasium[atari]>=1.1"
123101
else
124-
pip install "gymnasium[atari,accept-rom-license]<1.0"
102+
pip install "gymnasium[atari]>=1.1"
125103
fi

.github/unittest/linux_libs/scripts_ataridqn/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ dependencies:
1515
- pytest-instafail
1616
- pytest-rerunfailures
1717
- pytest-error-for-skips
18+
- pytest-asyncio
1819
- expecttest
20+
- pybind11[global]
1921
- pyyaml
2022
- scipy
2123
- hydra-core

.github/unittest/linux_libs/scripts_ataridqn/install.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ unset PYTORCH_VERSION
44
# For unittest, nightly PyTorch is used as the following section,
55
# so no need to set PYTORCH_VERSION.
66
# 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
97

108
set -e
119

@@ -28,18 +26,18 @@ fi
2826
# submodules
2927
git submodule sync && git submodule update --init --recursive
3028

31-
printf "Installing PyTorch with cu121"
29+
printf "Installing PyTorch with cu128"
3230
if [[ "$TORCH_VERSION" == "nightly" ]]; then
3331
if [ "${CU_VERSION:-}" == cpu ] ; then
3432
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
3533
else
36-
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu121 -U
34+
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu128 -U
3735
fi
3836
elif [[ "$TORCH_VERSION" == "stable" ]]; then
3937
if [ "${CU_VERSION:-}" == cpu ] ; then
4038
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
4139
else
42-
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121
40+
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu128
4341
fi
4442
else
4543
printf "Failed to install pytorch"

.github/unittest/linux_libs/scripts_ataridqn/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
eval "$(./conda/bin/conda shell.bash hook)"
66
conda activate ./env
77

8-
apt-get update && apt-get remove swig -y && apt-get install -y git gcc patchelf libosmesa6-dev libgl1-mesa-glx libglfw3 swig3.0
8+
apt-get update && apt-get remove swig -y && apt-get install -y git gcc patchelf libosmesa6-dev libgl1-mesa-glx libglfw3 swig3.0 cmake
99
ln -s /usr/bin/swig3.0 /usr/bin/swig
1010

1111
export LAZY_LEGACY_OP=False

.github/unittest/linux_libs/scripts_ataridqn/setup_env.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,31 @@
88
set -e
99
set -v
1010

11-
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
12-
# Avoid error: "fatal: unsafe repository"
13-
apt-get update && apt-get install -y git wget gcc g++ unzip curl
1411

12+
apt-get update && apt-get upgrade -y && apt-get install -y git cmake
13+
# Avoid error: "fatal: unsafe repository"
1514
git config --global --add safe.directory '*'
15+
apt-get install -y wget \
16+
gcc \
17+
g++ \
18+
unzip \
19+
curl \
20+
patchelf \
21+
libosmesa6-dev \
22+
libgl1-mesa-glx \
23+
libglfw3 \
24+
swig3.0 \
25+
libglew-dev \
26+
libglvnd0 \
27+
libgl1 \
28+
libglx0 \
29+
libegl1 \
30+
libgles2
31+
32+
# Upgrade specific package
33+
apt-get upgrade -y libstdc++6
34+
35+
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1636
root_dir="$(git rev-parse --show-toplevel)"
1737
conda_dir="${root_dir}/conda"
1838
env_dir="${root_dir}/env"

.github/unittest/linux_libs/scripts_brax/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ dependencies:
1313
- pytest-instafail
1414
- pytest-rerunfailures
1515
- pytest-error-for-skips
16+
- pytest-asyncio
1617
- expecttest
18+
- pybind11[global]
1719
- pyyaml
1820
- scipy
1921
- hydra-core

.github/unittest/linux_libs/scripts_brax/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ fi
2525
# submodules
2626
git submodule sync && git submodule update --init --recursive
2727

28-
printf "Installing PyTorch with cu121"
28+
printf "Installing PyTorch with cu128"
2929
if [[ "$TORCH_VERSION" == "nightly" ]]; then
3030
if [ "${CU_VERSION:-}" == cpu ] ; then
3131
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu -U
3232
else
33-
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 -U
33+
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128 -U
3434
fi
3535
elif [[ "$TORCH_VERSION" == "stable" ]]; then
3636
if [ "${CU_VERSION:-}" == cpu ] ; then
3737
pip3 install torch --index-url https://download.pytorch.org/whl/cpu -U
3838
else
39-
pip3 install torch --index-url https://download.pytorch.org/whl/cu121
39+
pip3 install torch --index-url https://download.pytorch.org/whl/cu128
4040
fi
4141
else
4242
printf "Failed to install pytorch"

.github/unittest/linux_libs/scripts_brax/run_all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -euxo pipefail
44

5-
yum makecache
6-
yum install -y glfw glew mesa-libGL mesa-libGL-devel mesa-libOSMesa-devel egl-utils freeglut
5+
apt update
6+
apt install -y libglfw3 libglfw3-dev libglew-dev libgl1-mesa-glx libgl1-mesa-dev mesa-common-dev libegl1-mesa-dev freeglut3 freeglut3-dev
77

88
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
99
bash ${this_dir}/setup_env.sh

.github/unittest/linux_libs/scripts_brax/setup_env.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,30 @@
77

88
set -euxo pipefail
99

10-
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
10+
apt-get update && apt-get upgrade -y && apt-get install -y git cmake
1111
# Avoid error: "fatal: unsafe repository"
1212
git config --global --add safe.directory '*'
13+
apt-get install -y wget \
14+
gcc \
15+
g++ \
16+
unzip \
17+
curl \
18+
patchelf \
19+
libosmesa6-dev \
20+
libgl1-mesa-glx \
21+
libglfw3 \
22+
swig3.0 \
23+
libglew-dev \
24+
libglvnd0 \
25+
libgl1 \
26+
libglx0 \
27+
libegl1 \
28+
libgles2
29+
30+
# Upgrade specific package
31+
apt-get upgrade -y libstdc++6
32+
33+
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1334
root_dir="$(git rev-parse --show-toplevel)"
1435
conda_dir="${root_dir}/conda"
1536
env_dir="${root_dir}/env"

0 commit comments

Comments
 (0)