From 5b1a418aa920d5b00b5e926425401e0742765a91 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Mon, 27 Oct 2025 14:19:40 -0600 Subject: [PATCH 1/4] Pin huggingface_hub<1.0 (#15399) Trying to fix failing HF CI jobs. Looks like our transformers version requires huggingface_hub<1.0, but we're installing the latest 1.0 version which just released today. Until we bump transformers, I'll just pin our install of huggingface_hub to below 1.0. Note that we don't pin the transformers version the same way for pip install, so this should be a ci only issue (and hence ci only fix). Here's an example job failure: ``` transformers 4.56.1 requires huggingface-hub<1.0,>=0.34.0, but you have huggingface-hub 1.0.0 which is incompatible. ... /exec: line 13: huggingface-cli: command not found ``` (from https://github.com/pytorch/executorch/actions/runs/18851188516/job/53787937311) (cherry picked from commit 57f0dfd9046351ad56c4caf5d1f1b42af6ee2573) --- .github/workflows/pull.yml | 11 ++++++++--- .github/workflows/trunk.yml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 391e21197ed..77da69c9fa4 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -307,9 +307,12 @@ jobs: PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake" - # install Llava requirements - bash examples/models/llama/install_requirements.sh - bash examples/models/llava/install_requirements.sh + echo "::group::Setup Huggingface" + pip install -U "huggingface_hub[cli]<1.0" accelerate + huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN + OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) + pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} + echo "::endgroup::" # run python unittest python -m unittest examples.models.llava.test.test_llava @@ -625,7 +628,9 @@ jobs: conda activate "${CONDA_ENV}" PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake" + echo "::endgroup::" + echo "::group::Setup requirements" # install phi-3-mini requirements bash examples/models/phi-3-mini/install_requirements.sh diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 72a32f38076..32dfb843f69 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -809,7 +809,7 @@ jobs: echo "::endgroup::" echo "::group::Setup Huggingface" - pip install -U "huggingface_hub[cli]" accelerate + pip install -U "huggingface_hub[cli]<1.0" accelerate huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} From 1293f9de87ea8fa8d6faccc618eb5460cb058f22 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Mon, 27 Oct 2025 16:43:23 -0600 Subject: [PATCH 2/4] Pin huggingface_hub in more places (#15403) We need to pin huggingface_hub in CI to avoid an incompatibility with our pinned version of transformers. See https://github.com/pytorch/executorch/pull/15399 for more context - I missed a few places on trunk jobs. Cleaning these up here. Running with ciflow/trunk. I verified that the test-huggingface-transformers-macos / * and gemma3-4b macos jobs pass on this PR. They are failing on trunk (see https://hud.pytorch.org/pytorch/executorch/commit/4c30da308ee811bdfa44fd4bea3bc439bfd303d4 for an example). --- .github/workflows/trunk.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 32dfb843f69..8051a4d6773 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -612,7 +612,7 @@ jobs: conda activate "${CONDA_ENV}" PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake - pip install -U "huggingface_hub[cli]" + pip install -U "huggingface_hub[cli]<1.0" bash .ci/scripts/test_torchao_huggingface_checkpoints.sh ${{ matrix.model }} ${{ matrix.test_with_runner && '--test_with_runner' || '' }} @@ -905,7 +905,7 @@ jobs: echo "::endgroup::" echo "::group::Set up Huggingface" - ${CONDA_RUN} pip install -U "huggingface_hub[cli]" accelerate + ${CONDA_RUN} pip install -U "huggingface_hub[cli]<1.0" accelerate ${CONDA_RUN} huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) ${CONDA_RUN} pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} From a7f9ac334533ee830678f2cb83edbca6f80d977d Mon Sep 17 00:00:00 2001 From: Gregory James Comer Date: Thu, 6 Nov 2025 16:51:40 -0800 Subject: [PATCH 3/4] Manual fixup --- .ci/scripts/test_wheel_package_qnn.sh | 4 ++-- .github/workflows/pull.yml | 11 +++-------- examples/models/llama/install_requirements.sh | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.ci/scripts/test_wheel_package_qnn.sh b/.ci/scripts/test_wheel_package_qnn.sh index b4f789d1b90..ca7b135339b 100644 --- a/.ci/scripts/test_wheel_package_qnn.sh +++ b/.ci/scripts/test_wheel_package_qnn.sh @@ -136,10 +136,10 @@ run_core_tests () { local PIPBIN="$2" # path to pip local LABEL="$3" # label to print (conda/venv) - echo "=== [$LABEL] Installing wheel & deps ===" + "$PIPBIN" install --upgrade pip "$PIPBIN" install "$WHEEL_FILE" - "$PIPBIN" install torch=="2.9.0" + "$PIPBIN" install torch=="2.9.1" "$PIPBIN" install --pre torchao --index-url "https://download.pytorch.org/whl/nightly/cpu" echo "=== [$LABEL] Import smoke tests ===" diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 77da69c9fa4..391e21197ed 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -307,12 +307,9 @@ jobs: PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake" - echo "::group::Setup Huggingface" - pip install -U "huggingface_hub[cli]<1.0" accelerate - huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN - OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) - pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} - echo "::endgroup::" + # install Llava requirements + bash examples/models/llama/install_requirements.sh + bash examples/models/llava/install_requirements.sh # run python unittest python -m unittest examples.models.llava.test.test_llava @@ -628,9 +625,7 @@ jobs: conda activate "${CONDA_ENV}" PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake" - echo "::endgroup::" - echo "::group::Setup requirements" # install phi-3-mini requirements bash examples/models/phi-3-mini/install_requirements.sh diff --git a/examples/models/llama/install_requirements.sh b/examples/models/llama/install_requirements.sh index 580a152a322..0c6b68785c0 100755 --- a/examples/models/llama/install_requirements.sh +++ b/examples/models/llama/install_requirements.sh @@ -10,7 +10,7 @@ # Install tokenizers for hf .json tokenizer. # Install snakeviz for cProfile flamegraph # Install lm-eval for Model Evaluation with lm-evalution-harness. -pip install hydra-core huggingface_hub tiktoken torchtune sentencepiece tokenizers snakeviz lm_eval==0.4.5 blobfile +pip install hydra-core "huggingface_hub<1.0" tiktoken torchtune sentencepiece tokenizers snakeviz lm_eval==0.4.5 blobfile # Call the install helper for further setup python examples/models/llama/install_requirement_helper.py From 9afbe277b414eb1b63a8d7bc62cb30ff414ad000 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Tue, 18 Nov 2025 15:30:41 -0800 Subject: [PATCH 4/4] Update test_wheel_package_qnn.sh --- .ci/scripts/test_wheel_package_qnn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_wheel_package_qnn.sh b/.ci/scripts/test_wheel_package_qnn.sh index ca7b135339b..7d431542378 100644 --- a/.ci/scripts/test_wheel_package_qnn.sh +++ b/.ci/scripts/test_wheel_package_qnn.sh @@ -136,7 +136,7 @@ run_core_tests () { local PIPBIN="$2" # path to pip local LABEL="$3" # label to print (conda/venv) - + echo "=== [$LABEL] Installing wheel & deps ===" "$PIPBIN" install --upgrade pip "$PIPBIN" install "$WHEEL_FILE" "$PIPBIN" install torch=="2.9.1"