From 596f7a7a53eff29a2c1cf6b8f76c8a42dc4e154a Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Thu, 26 Jun 2025 14:00:08 -0700 Subject: [PATCH 1/2] Pin bump for optimum-executorch --- .github/workflows/android-perf.yml | 14 +++----------- .github/workflows/apple-perf.yml | 14 +++----------- .github/workflows/trunk.yml | 22 +++++++--------------- 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.github/workflows/android-perf.yml b/.github/workflows/android-perf.yml index 2eab69eb88b..35a9edc9b0b 100644 --- a/.github/workflows/android-perf.yml +++ b/.github/workflows/android-perf.yml @@ -341,10 +341,11 @@ jobs: echo "tokenizer.json is downloaded to $DOWNLOADED_PATH" # Install optimum-executorch + OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) git clone https://github.com/huggingface/optimum-executorch pushd optimum-executorch # There is no release yet, for CI stability, always test from the same commit on main - git checkout 4c3b18f6cca68c5ccff809131d570062723d7188 + git checkout $OPTIMUM_ET_COMMIT python install_dev.py --skip_override_torch pip list @@ -353,21 +354,12 @@ jobs: "--task" "text-generation" "--recipe" "xnnpack" "--use_custom_sdpa" + "--use_custom_kv_cache" "--qlinear" "--qembedding" "--output_dir" ".." ) - # Add conditional arguments based on model - case "${HF_MODEL_REPO}" in - *"google/gemma-3-1b-it"*) - echo "--use_custom_kv_cache can not be used for HybridCache" - ;; - *) - ARGS+=("--use_custom_kv_cache") - ;; - esac - optimum-cli export executorch "${ARGS[@]}" popd diff --git a/.github/workflows/apple-perf.yml b/.github/workflows/apple-perf.yml index 3db5abbefbd..53cd54a8349 100644 --- a/.github/workflows/apple-perf.yml +++ b/.github/workflows/apple-perf.yml @@ -346,10 +346,11 @@ jobs: echo "tokenizer.json is downloaded to $DOWNLOADED_PATH" # Install optimum-executorch + OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) git clone https://github.com/huggingface/optimum-executorch pushd optimum-executorch # There is no release yet, for CI stability, always test from the same commit on main - git checkout 4c3b18f6cca68c5ccff809131d570062723d7188 + git checkout $OPTIMUM_ET_COMMIT ${CONDA_RUN} python install_dev.py --skip_override_torch pip list @@ -358,21 +359,12 @@ jobs: "--task" "text-generation" "--recipe" "xnnpack" "--use_custom_sdpa" + "--use_custom_kv_cache" "--qlinear" "--qembedding" "--output_dir" ".." ) - # Add conditional arguments based on model - case "${HF_MODEL_REPO}" in - *"google/gemma-3-1b-it"*) - echo "--use_custom_kv_cache can not be used for HybridCache" - ;; - *) - ARGS+=("--use_custom_kv_cache") - ;; - esac - ${CONDA_RUN} optimum-cli export executorch "${ARGS[@]}" popd diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 4fe5ec979a3..0eceddca36f 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -594,10 +594,11 @@ jobs: echo "::group::Set up Hugging Face" pip install -U "huggingface_hub[cli]" huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN + OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) git clone https://github.com/huggingface/optimum-executorch pushd optimum-executorch # There is no release yet, for CI stability, always test from the same commit on main - git checkout 4c3b18f6cca68c5ccff809131d570062723d7188 + git checkout $OPTIMUM_ET_COMMIT python install_dev.py --skip_override_torch popd pip list @@ -614,21 +615,12 @@ jobs: "--task" "text-generation" "--recipe" "xnnpack" "--use_custom_sdpa" + "--use_custom_kv_cache" "--qlinear" "--qembedding" "--output_dir" "${OUTPUT_DIR}" ) - # Add conditional arguments based on model - case "${MODEL_ID}" in - *"google/gemma-3-1b-it"*) - echo "--use_custom_kv_cache can not be used for HybridCache" - ;; - *) - ARGS+=("--use_custom_kv_cache") - ;; - esac - optimum-cli export executorch "${ARGS[@]}" ls -FlAGhp ${OUTPUT_DIR} @@ -732,18 +724,18 @@ jobs: timeout: 90 script: | set -eux - + # The generic Linux job chooses to use base env, not the one setup by the image CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]") conda activate "${CONDA_ENV}" - + # Build and install Executorch PYTHON_EXECUTABLE=python \ CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \ .ci/scripts/setup-linux.sh --build-tool "cmake" - + # Install test requirements pip install -r backends/nxp/requirements-tests.txt - + # Run pytest PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh From 73157e9f92eed60192cd5978e66b790748c9336f Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Thu, 26 Jun 2025 15:30:50 -0700 Subject: [PATCH 2/2] move pinned commit to a txt file --- .ci/docker/ci_commit_pins/optimum-executorch.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ci/docker/ci_commit_pins/optimum-executorch.txt diff --git a/.ci/docker/ci_commit_pins/optimum-executorch.txt b/.ci/docker/ci_commit_pins/optimum-executorch.txt new file mode 100644 index 00000000000..e8c8a386a81 --- /dev/null +++ b/.ci/docker/ci_commit_pins/optimum-executorch.txt @@ -0,0 +1 @@ +a3942627f5ac048e06b4b1d703b0a6a53bf6da5b