From a51d5a39c1d629b82a757fae64d9d3393ad8451b Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Mon, 27 Oct 2025 14:19:40 -0600 Subject: [PATCH 1/3] 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 5582e931bbadd3a54e8003ec0ad5a1b66fbef2f3 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Mon, 27 Oct 2025 16:43:23 -0600 Subject: [PATCH 2/3] 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 0d6ebe27d41a6b5ffa8d1bb7ae7249d5bb4c3286 Mon Sep 17 00:00:00 2001 From: Gregory James Comer Date: Thu, 6 Nov 2025 16:51:40 -0800 Subject: [PATCH 3/3] Manual fixup --- .github/workflows/pull.yml | 11 +++-------- examples/models/llama/install_requirements.sh | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) 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..0a69561279a 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