Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/unittest/linux/scripts/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [[ $OSTYPE != 'darwin'* ]]; then
apt-get install -y libfreetype6-dev pkg-config

apt-get install -y libglfw3 libosmesa6 libglew-dev
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2 xvfb
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2 xvfb ffmpeg

if [ "${CU_VERSION:-}" == cpu ] ; then
apt-get upgrade -y libstdc++6
Expand Down Expand Up @@ -205,15 +205,15 @@ git submodule sync && git submodule update --init --recursive
printf "Installing PyTorch with %s\n" "${CU_VERSION}"
if [[ "$TORCH_VERSION" == "nightly" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
uv_pip_install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
uv_pip_install --upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
else
uv_pip_install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
uv_pip_install --upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
uv_pip_install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv_pip_install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cpu
else
uv_pip_install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION
uv_pip_install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION
fi
else
printf "Failed to install pytorch"
Expand Down
4 changes: 2 additions & 2 deletions .github/unittest/linux/scripts/run_setup_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ else
fi

if [[ "$TORCH_VERSION" == "nightly" ]]; then
uv_pip_install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
uv_pip_install --upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
else
uv_pip_install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv_pip_install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cpu
fi

# tensordict is a hard dependency of torchrl; install it explicitly since we test
Expand Down
4 changes: 2 additions & 2 deletions .github/unittest/linux_libs/scripts_minari/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
uv pip install torch --index-url https://download.pytorch.org/whl/cpu
uv pip install torch --index-url https://download.pytorch.org/whl/cpu -U
else
uv pip install torch --index-url https://download.pytorch.org/whl/cu128
uv pip install torch --index-url https://download.pytorch.org/whl/cu128 -U
fi
else
printf "Failed to install pytorch"
Expand Down
2 changes: 1 addition & 1 deletion .github/unittest/linux_libs/scripts_vd4rl/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
else
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu128 -U
fi
else
printf "Failed to install pytorch"
Expand Down
4 changes: 2 additions & 2 deletions .github/unittest/linux_libs/scripts_vmas/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch --index-url https://download.pytorch.org/whl/cpu
pip3 install torch --index-url https://download.pytorch.org/whl/cpu -U
else
pip3 install torch --index-url https://download.pytorch.org/whl/cu128
pip3 install torch --index-url https://download.pytorch.org/whl/cu128 -U
fi
else
printf "Failed to install pytorch"
Expand Down
2 changes: 1 addition & 1 deletion .github/unittest/linux_optdeps/scripts/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [[ $OSTYPE != 'darwin'* ]]; then
apt-get install -y vim git wget cmake

apt-get install -y libglfw3 libosmesa6 libglew-dev
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2 xvfb ffmpeg

if [ "${CU_VERSION:-}" == cpu ] ; then
# solves version `GLIBCXX_3.4.29' not found for tensorboard
Expand Down
8 changes: 4 additions & 4 deletions .github/unittest/linux_sota/scripts/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ git submodule sync && git submodule update --init --recursive
printf "Installing PyTorch with %s\n" "${CU_VERSION}"
if [[ "$TORCH_VERSION" == "nightly" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
uv pip install --pre torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/nightly/cpu
uv pip install --upgrade --pre torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/nightly/cpu
else
uv pip install --pre torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
uv pip install --upgrade --pre torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
uv pip install torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/cpu
uv pip install --upgrade torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/cpu
else
uv pip install torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/$CU_VERSION
uv pip install --upgrade torch torchvision "numpy==1.26.4" --index-url https://download.pytorch.org/whl/$CU_VERSION
fi
else
printf "Failed to install pytorch"
Expand Down
6 changes: 3 additions & 3 deletions .github/unittest/windows_optdepts/scripts/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ python -m pip install "numpy<2.0"
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
if [[ "$TORCH_VERSION" == "nightly" ]]; then
if $torch_cuda ; then
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118 -U
else
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu -U
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if $torch_cuda ; then
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118
python -m pip install torch --index-url https://download.pytorch.org/whl/cu118 -U
else
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu -U
fi
else
printf "Failed to install pytorch"
Expand Down
5 changes: 1 addition & 4 deletions torchrl/envs/batched_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,12 +1418,11 @@ class ParallelEnv(BatchedEnvBase, metaclass=_PEnvMeta):

def _start_workers(self) -> None:
import torchrl
from torchrl.envs.env_creator import EnvCreator

self._timeout = 10.0
self.BATCHED_PIPE_TIMEOUT = torchrl._utils.BATCHED_PIPE_TIMEOUT

from torchrl.envs.env_creator import EnvCreator

num_threads = max(
1, torch.get_num_threads() - self.num_workers
) # 1 more thread for this proc
Expand Down Expand Up @@ -1478,8 +1477,6 @@ def look_for_cuda(tensor, has_cuda=has_cuda):
env_fun = self.create_env_fn[idx]
if not isinstance(env_fun, (EnvCreator, CloudpickleWrapper)):
env_fun = CloudpickleWrapper(env_fun)
import torchrl

kwargs[idx].update(
{
"parent_pipe": parent_pipe,
Expand Down
Loading