Skip to content

Commit c7ffe93

Browse files
committed
Test google/gemma-2b on pixel 8
1 parent e00e2e5 commit c7ffe93

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/android-perf.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
declare -A DEVICE_POOL_ARNS
9999
DEVICE_POOL_ARNS[samsung_galaxy_s22]="arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa"
100100
DEVICE_POOL_ARNS[samsung_galaxy_s24]="arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db"
101+
DEVICE_POOL_ARNS[google_pixel_8_pro]="arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a"
101102
102103
# Resolve device names with their corresponding ARNs
103104
if [[ ! $(echo "$DEVICES" | jq empty 2>/dev/null) ]]; then
@@ -163,13 +164,15 @@ jobs:
163164
model: ${{ fromJson(needs.set-parameters.outputs.models) }}
164165
delegate: ${{ fromJson(needs.set-parameters.outputs.delegates) }}
165166
fail-fast: false
167+
secrets: inherit
166168
with:
167-
runner: linux.4xlarge
169+
runner: linux.4xlarge.memory
168170
docker-image: executorch-ubuntu-22.04-qnn-sdk
169171
submodules: 'true'
170172
timeout: 60
171173
upload-artifact: android-models
172174
upload-artifact-to-s3: true
175+
secrets-env: EXECUTORCH_HF_TOKEN
173176
script: |
174177
# The generic Linux job chooses to use base env, not the one setup by the image
175178
echo "::group::Setting up dev environment"
@@ -187,7 +190,37 @@ jobs:
187190
BUILD_MODE="cmake"
188191
DTYPE="fp32"
189192
190-
if [[ ${{ matrix.model }} =~ ^stories* ]]; then
193+
if [[ ${{ matrix.model }} =~ ^[^/]+/[^/]+$ ]] && [[ ${{ matrix.delegate }} == "xnnpack" ]]; then
194+
pip install -U "huggingface_hub[cli]"
195+
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
196+
pip install accelerate sentencepiece
197+
pip list
198+
199+
TOKENIZER_FILE=tokenizer.model
200+
TOKENIZER_BIN_FILE=tokenizer.bin
201+
# Fetch the file using a Python one-liner
202+
DOWNLOADED_TOKENIZER_FILE_PATH=$(python -c "
203+
from huggingface_hub import hf_hub_download
204+
# Download the file from the Hugging Face Hub
205+
downloaded_path = hf_hub_download(
206+
repo_id='${{ matrix.model }}',
207+
filename='${TOKENIZER_FILE}'
208+
)
209+
print(downloaded_path)
210+
")
211+
if [ -f "$DOWNLOADED_TOKENIZER_FILE_PATH" ]; then
212+
echo "${TOKENIZER_FILE} downloaded successfully at: $DOWNLOADED_TOKENIZER_FILE_PATH"
213+
python -m extension.llm.tokenizer.tokenizer -t $DOWNLOADED_TOKENIZER_FILE_PATH -o ./${TOKENIZER_BIN_FILE}
214+
ls ./tokenizer.bin
215+
else
216+
echo "Failed to download ${TOKENIZER_FILE} from ${{ matrix.model }}."
217+
exit 1
218+
fi
219+
220+
MODEL_NAME=$(echo "${{ matrix.model }}" | sed 's,/,-,g')
221+
python -m extension.export_util.export_hf_model -hfm=${{ matrix.model }} -o "${MODEL_NAME}_xnnpack_fp32"
222+
223+
elif [[ ${{ matrix.model }} =~ ^stories* ]]; then
191224
# Install requirements for export_llama
192225
PYTHON_EXECUTABLE=python bash examples/models/llama/install_requirements.sh
193226
# Test llama2
@@ -205,6 +238,7 @@ jobs:
205238
-dtype "${DTYPE}" \
206239
-mode "${DELEGATE_CONFIG}" \
207240
-upload "${ARTIFACTS_DIR_NAME}"
241+
208242
else
209243
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh \
210244
"${{ matrix.model }}" \

0 commit comments

Comments
 (0)