Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Sep 13, 2024
2 parents 7b79cbb + 0bc468c commit 00b1f8f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/unittest/linux/scripts/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
else
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
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/$CU_VERSION
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
fi
else
printf "Failed to install pytorch"
Expand Down
2 changes: 1 addition & 1 deletion .github/unittest/linux_libs/scripts_brax/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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/cu121
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/unittest/linux_libs/scripts_openx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
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/cu121
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121 -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 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
fi
elif [[ "$TORCH_VERSION" == "stable" ]]; then
if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
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/cu121
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/unittest/linux_optdeps/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
git submodule sync && git submodule update --init --recursive

printf "Installing PyTorch with %s\n" "${CU_VERSION}"
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U

# install tensordict
if [[ "$RELEASE" == 0 ]]; then
Expand Down
2 changes: 2 additions & 0 deletions test/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
_split_and_pad_sequence,
)

TORCH_VERSION = torch.__version__

# Capture all warnings
pytestmark = [
Expand Down Expand Up @@ -15644,6 +15645,7 @@ def __init__(self):
assert p.device == dest


@pytest.mark.skipif(TORCH_VERSION < "2.5", reason="requires torch>=2.5")
def test_exploration_compile():
m = ProbabilisticTensorDictModule(
in_keys=["loc", "scale"],
Expand Down
7 changes: 6 additions & 1 deletion torchrl/modules/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
import numpy as np
import torch
from torch import distributions as D, nn
from torch.compiler import assume_constant_result

try:
from torch.compiler import assume_constant_result
except ImportError:
from torch._dynamo import assume_constant_result

from torch.distributions import constraints
from torch.distributions.transforms import _InverseTransform

Expand Down
2 changes: 1 addition & 1 deletion torchrl/objectives/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

try:
from torch.compiler import is_dynamo_compiling
except ImportError:
except ModuleNotFoundError:
from torch._dynamo import is_compiling as is_dynamo_compiling


Expand Down

0 comments on commit 00b1f8f

Please sign in to comment.