Skip to content

Commit f983d15

Browse files
pytorchbotcccclai
andauthored
fix test-huggingface-transformers-* tests (#14812)
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 Co-authored-by: cccclai <[email protected]>
1 parent 4adf78a commit f983d15

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
@@ -800,11 +800,26 @@ jobs:
800800
echo "Recipe: $RECIPE"
801801
echo "Quantize: $QUANTIZE"
802802
803-
echo "::group::Set up ExecuTorch"
804803
# The generic Linux job chooses to use base env, not the one setup by the image
805804
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
806805
conda activate "${CONDA_ENV}"
807-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
806+
807+
echo "::group::Setup ExecuTorch"
808+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake"
809+
echo "::endgroup::"
810+
811+
echo "::group::Setup Huggingface"
812+
pip install -U "huggingface_hub[cli]" accelerate
813+
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
814+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
815+
pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
816+
echo "::endgroup::"
817+
818+
echo "::group::Test MODEL: $MODEL RECIPE: $RECIPE QUANTIZE: $QUANTIZE"
819+
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
820+
python .ci/scripts/test_huggingface_optimum_model.py --model "$MODEL" --recipe "$RECIPE" $QUANTIZE --model_dir "$OUTPUT_DIR"
821+
echo "::endgroup::"
822+
808823
# Build executor_runner with ETdump enabled
809824
PYTHON_EXECUTABLE=python cmake -DPYTHON_EXECUTABLE=python \
810825
-DCMAKE_INSTALL_PREFIX=cmake-out \
@@ -822,25 +837,6 @@ jobs:
822837
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
823838
-Bcmake-out .
824839
cmake --build cmake-out -j16 --target install --config Release
825-
echo "::endgroup::"
826-
827-
echo "::group::Set up Hugging Face"
828-
pip install -U "huggingface_hub[cli]"
829-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
830-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
831-
git clone https://github.com/huggingface/optimum-executorch
832-
pushd optimum-executorch
833-
# There is no release yet, for CI stability, always test from the same commit on main
834-
git checkout $OPTIMUM_ET_COMMIT
835-
python install_dev.py --skip_override_torch
836-
popd
837-
pip list
838-
echo "::endgroup::"
839-
840-
echo "::group::Run tests"
841-
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
842-
python .ci/scripts/test_huggingface_optimum_model.py --model ${MODEL} --recipe ${RECIPE} ${QUANTIZE} --model_dir ${OUTPUT_DIR}
843-
echo "::endgroup::"
844840
845841
echo "::group::Generate artifacts for performance profiling"
846842
./cmake-out/executor_runner \
@@ -907,16 +903,11 @@ jobs:
907903
${CONDA_RUN} python install_executorch.py
908904
echo "::endgroup::"
909905
910-
echo "::group::Set up Hugging Face"
911-
pip install -U "huggingface_hub[cli]"
912-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
913-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
914-
git clone https://github.com/huggingface/optimum-executorch
915-
pushd optimum-executorch
916-
# There is no release yet, for CI stability, always test from the same commit on main
917-
git checkout $OPTIMUM_ET_COMMIT
918-
${CONDA_RUN} python install_dev.py --skip_override_torch
919-
popd
906+
echo "::group::Set up Huggingface"
907+
${CONDA_RUN} pip install -U "huggingface_hub[cli]" accelerate
908+
${CONDA_RUN} huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
909+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
910+
${CONDA_RUN} pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
920911
${CONDA_RUN} pip list
921912
echo "::endgroup::"
922913

0 commit comments

Comments
 (0)