Skip to content

Commit 399138e

Browse files
authored
[pyproject.toml] Add a dependency on torch==2.3 (#3277)
* Fix lint Remove `requires-python = ">=3.10"`. This caused the linter to use a new `with` syntax that was added in python 3.10, but we want to eventualy supoort older versions of python. * [ci] Look on pytorch servers when installing pip deps When installing the executorch pip package for CI jobs, look on the pytorch servers when resolving dependencies. This lets the executorch package depend on pytorch pre-release and nightly versions. Also run the llava setup with `-x` to make it easier to debug failures. * [pyproject.toml] Add a dependency on `torch==2.3` This is the version that the release/0.2 version of executorch depends on. We should not pick this back into main.
1 parent 861abb1 commit 399138e

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.ci/scripts/utils.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ retry () {
1818
install_executorch() {
1919
which pip
2020
# Install executorch, this assumes that Executorch is checked out in the
21-
# current directory
22-
pip install . --no-build-isolation -v
21+
# current directory. The --extra-index-url options tell pip to look on the
22+
# pytorch servers for nightly and pre-release versions of torch packages.
23+
pip install . --no-build-isolation -v \
24+
--extra-index-url https://download.pytorch.org/whl/test/cpu \
25+
--extra-index-url https://download.pytorch.org/whl/nightly/cpu
2326
# Just print out the list of packages for debugging
2427
pip list
2528
}

examples/models/llava_encoder/install_requirements.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
77

8+
set -x
9+
810
# install llava from the submodule
911
pip install --force-reinstall -e examples/third-party/LLaVA
1012

@@ -19,4 +21,4 @@ pip install bitsandbytes -I
1921
# For example, torch version required from llava is older than ExecuTorch.
2022
# To make both work, recover ExecuTorch's original dependencies by rerunning
2123
# the install_requirements.sh.
22-
./install_requirements.sh
24+
bash -x ./install_requirements.sh

install_requirements.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ $PIP_EXECUTABLE install --extra-index-url "${TORCH_URL}" \
101101

102102
#
103103
# Install executorch pip package. This also makes `flatc` available on the path.
104+
# The --extra-index-url may be necessary if pyproject.toml has a dependency on a
105+
# pre-release or nightly version of a torch package.
104106
#
105107

106108
EXECUTORCH_BUILD_PYBIND="${EXECUTORCH_BUILD_PYBIND}" \
107109
CMAKE_ARGS="${CMAKE_ARGS}" \
108-
$PIP_EXECUTABLE install . --no-build-isolation -v
110+
$PIP_EXECUTABLE install . --no-build-isolation -v \
111+
--extra-index-url "${TORCH_URL}"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ classifiers = [
4646
]
4747

4848
# Python dependencies required for use.
49-
requires-python = ">=3.10"
5049
dependencies=[
5150
"expecttest",
5251
"flatbuffers",
@@ -61,6 +60,7 @@ dependencies=[
6160
"ruamel.yaml",
6261
"sympy",
6362
"tabulate",
63+
"torch==2.3",
6464
]
6565

6666
[project.urls]

0 commit comments

Comments
 (0)