From cf3c24290ac87539e5f75ae44653f0121e278575 Mon Sep 17 00:00:00 2001 From: Dave Bort Date: Wed, 24 Apr 2024 10:07:57 -0700 Subject: [PATCH 1/3] 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. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dc45239d32e..2e1efab945e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,6 @@ classifiers = [ ] # Python dependencies required for use. -requires-python = ">=3.10" dependencies=[ "expecttest", "flatbuffers", From 37183b2ec90a488237ecba747da4a035f3ff14ad Mon Sep 17 00:00:00 2001 From: Dave Bort Date: Tue, 23 Apr 2024 21:25:50 -0700 Subject: [PATCH 2/3] [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. --- .ci/scripts/utils.sh | 7 +++++-- examples/models/llava_encoder/install_requirements.sh | 4 +++- install_requirements.sh | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index c7c00be2574..6b543c15267 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -18,8 +18,11 @@ retry () { install_executorch() { which pip # Install executorch, this assumes that Executorch is checked out in the - # current directory - pip install . --no-build-isolation -v + # current directory. The --extra-index-url options tell pip to look on the + # pytorch servers for nightly and pre-release versions of torch packages. + pip install . --no-build-isolation -v \ + --extra-index-url https://download.pytorch.org/whl/test/cpu \ + --extra-index-url https://download.pytorch.org/whl/nightly/cpu # Just print out the list of packages for debugging pip list } diff --git a/examples/models/llava_encoder/install_requirements.sh b/examples/models/llava_encoder/install_requirements.sh index 5a4ff71285b..b8357e61e54 100644 --- a/examples/models/llava_encoder/install_requirements.sh +++ b/examples/models/llava_encoder/install_requirements.sh @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +set -x + # install llava from the submodule pip install --force-reinstall -e examples/third-party/LLaVA @@ -19,4 +21,4 @@ pip install bitsandbytes -I # For example, torch version required from llava is older than ExecuTorch. # To make both work, recover ExecuTorch's original dependencies by rerunning # the install_requirements.sh. -./install_requirements.sh +bash -x ./install_requirements.sh diff --git a/install_requirements.sh b/install_requirements.sh index 8432e2184a9..7918ea7e1b8 100755 --- a/install_requirements.sh +++ b/install_requirements.sh @@ -101,8 +101,11 @@ $PIP_EXECUTABLE install --extra-index-url "${TORCH_URL}" \ # # Install executorch pip package. This also makes `flatc` available on the path. +# The --extra-index-url may be necessary if pyproject.toml has a dependency on a +# pre-release or nightly version of a torch package. # EXECUTORCH_BUILD_PYBIND="${EXECUTORCH_BUILD_PYBIND}" \ CMAKE_ARGS="${CMAKE_ARGS}" \ - $PIP_EXECUTABLE install . --no-build-isolation -v + $PIP_EXECUTABLE install . --no-build-isolation -v \ + --extra-index-url "${TORCH_URL}" From 57743df9536de512324b33cc30371e9f2fc9b6ba Mon Sep 17 00:00:00 2001 From: Dave Bort Date: Tue, 23 Apr 2024 17:40:36 -0700 Subject: [PATCH 3/3] [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. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 2e1efab945e..10b65275165 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ dependencies=[ "ruamel.yaml", "sympy", "tabulate", + "torch==2.3", ] [project.urls]