Skip to content

Commit 3d8b8d1

Browse files
authored
fix test-huggingface-transformers-* tests (#14752)
Fix these tests https://hud.pytorch.org/hud/pytorch/executorch/main/1?per_page=50&name_filter=huggingface-transformer The optimum is installed in a bit weird way, inside executorch folder, it clone optimum inside executorch, and try to install executorch in the nested optimum folder. Install optimum via pip instead in the same commit. The behavior should be the same, tests still run as expected
1 parent 881915d commit 3d8b8d1

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

.github/workflows/trunk.yml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,26 @@ jobs:
823823
echo "Recipe: $RECIPE"
824824
echo "Quantize: $QUANTIZE"
825825
826-
echo "::group::Set up ExecuTorch"
827826
# The generic Linux job chooses to use base env, not the one setup by the image
828827
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
829828
conda activate "${CONDA_ENV}"
830-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
829+
830+
echo "::group::Setup ExecuTorch"
831+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake"
832+
echo "::endgroup::"
833+
834+
echo "::group::Setup Huggingface"
835+
pip install -U "huggingface_hub[cli]" accelerate
836+
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
837+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
838+
pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
839+
echo "::endgroup::"
840+
841+
echo "::group::Test MODEL: $MODEL RECIPE: $RECIPE QUANTIZE: $QUANTIZE"
842+
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
843+
python .ci/scripts/test_huggingface_optimum_model.py --model "$MODEL" --recipe "$RECIPE" $QUANTIZE --model_dir "$OUTPUT_DIR"
844+
echo "::endgroup::"
845+
831846
# Build executor_runner with ETdump enabled
832847
PYTHON_EXECUTABLE=python cmake -DPYTHON_EXECUTABLE=python \
833848
-DCMAKE_INSTALL_PREFIX=cmake-out \
@@ -845,25 +860,6 @@ jobs:
845860
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
846861
-Bcmake-out .
847862
cmake --build cmake-out -j16 --target install --config Release
848-
echo "::endgroup::"
849-
850-
echo "::group::Set up Hugging Face"
851-
pip install -U "huggingface_hub[cli]"
852-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
853-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
854-
git clone https://github.com/huggingface/optimum-executorch
855-
pushd optimum-executorch
856-
# There is no release yet, for CI stability, always test from the same commit on main
857-
git checkout $OPTIMUM_ET_COMMIT
858-
python install_dev.py --skip_override_torch
859-
popd
860-
pip list
861-
echo "::endgroup::"
862-
863-
echo "::group::Run tests"
864-
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
865-
python .ci/scripts/test_huggingface_optimum_model.py --model ${MODEL} --recipe ${RECIPE} ${QUANTIZE} --model_dir ${OUTPUT_DIR}
866-
echo "::endgroup::"
867863
868864
echo "::group::Generate artifacts for performance profiling"
869865
./cmake-out/executor_runner \
@@ -930,16 +926,11 @@ jobs:
930926
${CONDA_RUN} python install_executorch.py
931927
echo "::endgroup::"
932928
933-
echo "::group::Set up Hugging Face"
934-
pip install -U "huggingface_hub[cli]"
935-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
936-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
937-
git clone https://github.com/huggingface/optimum-executorch
938-
pushd optimum-executorch
939-
# There is no release yet, for CI stability, always test from the same commit on main
940-
git checkout $OPTIMUM_ET_COMMIT
941-
${CONDA_RUN} python install_dev.py --skip_override_torch
942-
popd
929+
echo "::group::Set up Huggingface"
930+
${CONDA_RUN} pip install -U "huggingface_hub[cli]" accelerate
931+
${CONDA_RUN} huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
932+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
933+
${CONDA_RUN} pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
943934
${CONDA_RUN} pip list
944935
echo "::endgroup::"
945936

0 commit comments

Comments
 (0)