-
Notifications
You must be signed in to change notification settings - Fork 365
/
Copy pathinstall.sh
62 lines (51 loc) · 1.81 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/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
# We skip pytorch install due to vllm requirements
#printf "Installing PyTorch with cu128"
#if [[ "$TORCH_VERSION" == "nightly" ]]; then
# if [ "${CU_VERSION:-}" == cpu ] ; then
# pip3 install --pre torch "numpy<2.0.0" --index-url https://download.pytorch.org/whl/nightly/cpu -U
# else
# pip3 install --pre torch "numpy<2.0.0" --index-url https://download.pytorch.org/whl/nightly/cu128 -U
# fi
#elif [[ "$TORCH_VERSION" == "stable" ]]; then
# if [ "${CU_VERSION:-}" == cpu ] ; then
# pip3 install torch "numpy<2.0.0" --index-url https://download.pytorch.org/whl/cpu
# else
# pip3 install torch "numpy<2.0.0" --index-url https://download.pytorch.org/whl/cu128
# fi
#else
# printf "Failed to install pytorch"
# exit 1
#fi
# install tensordict
if [[ "$RELEASE" == 0 ]]; then
pip3 install git+https://github.com/pytorch/tensordict.git
else
pip3 install tensordict
fi
# smoke test
python -c "import tensordict"
printf "* Installing torchrl\n"
python setup.py develop
# smoke test
python -c "import torchrl"