From f4876fb21c84dbd8463a085a9d6a5ab9e9326e64 Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Mon, 16 Dec 2024 18:06:39 +0100 Subject: [PATCH] Explicitly install nightlies (#699) As `iree-turbine` is specified in `sharktank/requirements.txt`, the dependency is already fulfilled and nightlies don't get installed. One option would be to enforce to `--upgrade` but instead the packages get not installed before stable releases get pulled in via sharktank's requirements file. For workflow running on non-GH hosted runners, `--upgrade` is passed additionaly to avoid using an eventually cached version on the self-hosted runners. --- .github/workflows/ci-llama-large-tests.yaml | 4 +++- .github/workflows/ci-llama-quick-tests.yaml | 3 ++- .github/workflows/ci-sglang-integration-tests.yml | 4 +++- .github/workflows/ci-shark-ai.yml | 4 +++- .github/workflows/ci-sharktank.yml | 14 ++++++++++---- .github/workflows/ci_eval.yaml | 9 ++++++--- .github/workflows/ci_eval_short.yaml | 3 ++- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-llama-large-tests.yaml b/.github/workflows/ci-llama-large-tests.yaml index 379a5bac3..2eb8e6496 100644 --- a/.github/workflows/ci-llama-large-tests.yaml +++ b/.github/workflows/ci-llama-large-tests.yaml @@ -53,11 +53,11 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -66,6 +66,8 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ + pip freeze - name: Run llama tests diff --git a/.github/workflows/ci-llama-quick-tests.yaml b/.github/workflows/ci-llama-quick-tests.yaml index 418dbea2e..7ad153924 100644 --- a/.github/workflows/ci-llama-quick-tests.yaml +++ b/.github/workflows/ci-llama-quick-tests.yaml @@ -53,11 +53,11 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -66,6 +66,7 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ pip freeze - name: Run llama 8b f16 decomposed test diff --git a/.github/workflows/ci-sglang-integration-tests.yml b/.github/workflows/ci-sglang-integration-tests.yml index c3627226e..4eaae8dc4 100644 --- a/.github/workflows/ci-sglang-integration-tests.yml +++ b/.github/workflows/ci-sglang-integration-tests.yml @@ -50,11 +50,11 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -e sharktank/ shortfin/ # Use newest possible releases to be able to track commits that may # cause errors. @@ -64,6 +64,8 @@ jobs: iree-turbine \ "numpy<2.0" + pip install --no-compile -r requirements.txt -e sharktank/ shortfin/ + # Install SGLang and sentence_transformers pip install "git+https://github.com/nod-ai/sglang.git#subdirectory=python" pip install sentence_transformers diff --git a/.github/workflows/ci-shark-ai.yml b/.github/workflows/ci-shark-ai.yml index 0e8ae0c87..67d52e5a6 100644 --- a/.github/workflows/ci-shark-ai.yml +++ b/.github/workflows/ci-shark-ai.yml @@ -49,11 +49,11 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -e sharktank/ shortfin/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -62,6 +62,8 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -e sharktank/ shortfin/ + pip freeze - name: Run LLM Integration Tests diff --git a/.github/workflows/ci-sharktank.yml b/.github/workflows/ci-sharktank.yml index 5ee2fbcae..c08f2f412 100644 --- a/.github/workflows/ci-sharktank.yml +++ b/.github/workflows/ci-sharktank.yml @@ -63,11 +63,11 @@ jobs: - name: Install pip deps run: | python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile --pre --index-url https://download.pytorch.org/whl/test/cpu torch==${{matrix.torch-version}}+cpu - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -76,6 +76,8 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ + - name: Run sharktank tests if: ${{ !cancelled() }} run: | @@ -116,7 +118,6 @@ jobs: # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -125,6 +126,8 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ + - name: Run tests # TODO: unify with-t5-data and with-clip-data flags into a single flag # and make it possible to run only tests that require data. @@ -162,18 +165,21 @@ jobs: - name: Install pip deps run: | python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. - pip install -f https://iree.dev/pip-release-links.html --pre --upgrade \ + pip install -f https://iree.dev/pip-release-links.html --pre \ iree-base-compiler \ iree-base-runtime \ iree-turbine + + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ + - name: Run punet tests run: | pytest -v sharktank/ -m punet_quick \ diff --git a/.github/workflows/ci_eval.yaml b/.github/workflows/ci_eval.yaml index c41709f38..3b85cb652 100644 --- a/.github/workflows/ci_eval.yaml +++ b/.github/workflows/ci_eval.yaml @@ -51,19 +51,20 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. - pip install -f https://iree.dev/pip-release-links.html --pre \ + pip install -f https://iree.dev/pip-release-links.html --pre --upgrade \ iree-base-compiler \ iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ pip freeze - name: Run perplexity test with IREE @@ -109,17 +110,19 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly iree-turbine. # We could also pin to a known working or stable version. pip install -f https://iree.dev/pip-release-links.html --pre --upgrade \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ + - name: Run perplexity test with Torch run: | source ${VENV_DIR}/bin/activate diff --git a/.github/workflows/ci_eval_short.yaml b/.github/workflows/ci_eval_short.yaml index fd3b5e5d7..edaaee966 100644 --- a/.github/workflows/ci_eval_short.yaml +++ b/.github/workflows/ci_eval_short.yaml @@ -50,11 +50,11 @@ jobs: run: | source ${VENV_DIR}/bin/activate python -m pip install --no-compile --upgrade pip + # Note: We install in three steps in order to satisfy requirements # from non default locations first. Installing the PyTorch CPU # wheels saves multiple minutes and a lot of bandwidth on runner setup. pip install --no-compile -r pytorch-cpu-requirements.txt - pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ # Install nightly IREE packages. # We could also pin to a known working or stable version. @@ -63,6 +63,7 @@ jobs: iree-base-runtime \ iree-turbine + pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/ pip freeze - name: Run perplexity test with vmfb