|
41 | 41 | ) |
42 | 42 |
|
43 | 43 | # Since torchchat often uses main-branch features of pytorch, only the nightly |
44 | | -# pip versions will have the required features. The NIGHTLY_VERSION value should |
| 44 | +# pip versions will have the required features. The PYTORCH_NIGHTLY_VERSION value should |
45 | 45 | # agree with the third-party/pytorch pinned submodule commit. |
46 | 46 | # |
47 | 47 | # NOTE: If a newly-fetched version of the executorch repo changes the value of |
48 | | -# NIGHTLY_VERSION, you should re-run this script to install the necessary |
| 48 | +# PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary |
49 | 49 | # package versions. |
50 | | -NIGHTLY_VERSION=dev20240814 |
| 50 | +PYTORCH_NIGHTLY_VERSION=dev20240814 |
| 51 | + |
| 52 | +# Nightly version for torchvision |
| 53 | +VISION_NIGHTLY_VERSION=dev20240814 |
| 54 | + |
| 55 | +# Nightly version for torchao |
| 56 | +AO_NIGHTLY_VERSION=dev20240905 |
| 57 | + |
| 58 | +# Nightly version for torchtune |
| 59 | +TUNE_NIGHTLY_VERSION=dev20240910 |
| 60 | + |
51 | 61 |
|
52 | 62 | # Uninstall triton, as nightly will depend on pytorch-triton, which is one and the same |
53 | 63 | ( |
|
67 | 77 |
|
68 | 78 | # pip packages needed by exir. |
69 | 79 | REQUIREMENTS_TO_INSTALL=( |
70 | | - torch=="2.5.0.${NIGHTLY_VERSION}" |
| 80 | + torch=="2.5.0.${PYTORCH_NIGHTLY_VERSION}" |
| 81 | + torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}" |
| 82 | +) |
| 83 | + |
| 84 | +LINUX_REQUIREMENTS_TO_INSTALL=( |
| 85 | + torchao=="0.5.0.${AO_NIGHTLY_VERSION}" |
| 86 | + torchtune=="0.3.0.${TUNE_NIGHTLY_VERSION}" |
71 | 87 | ) |
72 | 88 |
|
73 | | -# Install the requirements. `--extra-index-url` tells pip to look for package |
| 89 | +# Install the requirements. --extra-index-url tells pip to look for package |
74 | 90 | # versions on the provided URL if they aren't available on the default URL. |
75 | 91 | ( |
76 | 92 | set -x |
77 | 93 | $PIP_EXECUTABLE install --extra-index-url "${TORCH_NIGHTLY_URL}" \ |
78 | 94 | "${REQUIREMENTS_TO_INSTALL[@]}" |
79 | 95 | ) |
80 | 96 |
|
81 | | -# For torchao need to install from github since nightly build doesn't have macos build. |
82 | | -# TODO: Remove this and install nightly build, once it supports macos |
83 | | -( |
84 | | - set -x |
85 | | - $PIP_EXECUTABLE install git+https://github.com/pytorch/ao.git@e11201a62669f582d81cdb33e031a07fb8dfc4f3 |
86 | | -) |
| 97 | +PLATFORM=$(uname -s) |
| 98 | + |
| 99 | +# Install torchtune and torchao requirements for Linux systems using nightly. |
| 100 | +# For non-Linux systems (e.g., macOS), install torchao from GitHub since nightly |
| 101 | +# build doesn't have macOS build. |
| 102 | +# TODO: Remove this and install nightly build, once it supports macOS |
| 103 | +if [ "$PLATFORM" == "Linux" ]; |
| 104 | +then |
| 105 | + ( |
| 106 | + set -x |
| 107 | + $PIP_EXECUTABLE install --pre --extra-index-url "${TORCH_NIGHTLY_URL}" --no-cache-dir \ |
| 108 | + "${LINUX_REQUIREMENTS_TO_INSTALL[@]}" |
| 109 | + ) |
| 110 | +else |
| 111 | + # For torchao need to install from github since nightly build doesn't have macos build. |
| 112 | + # TODO: Remove this and install nightly build, once it supports macos |
| 113 | + ( |
| 114 | + set -x |
| 115 | + $PIP_EXECUTABLE install git+https://github.com/pytorch/ao.git@e11201a62669f582d81cdb33e031a07fb8dfc4f3 |
| 116 | + ) |
| 117 | +fi |
| 118 | + |
87 | 119 | if [[ -x "$(command -v nvidia-smi)" ]]; then |
88 | 120 | ( |
89 | 121 | set -x |
|
0 commit comments