Skip to content

Commit 5dc76fe

Browse files
committed
Test 2
1 parent b9308bb commit 5dc76fe

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

.ci/docker/requirements-ci.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ torchsr==1.0.4
99
transformers==4.47.1
1010
zstd==1.5.5.1
1111
pandas>=2.2.2; python_version >= '3.10'
12+
prettytable>=3.14.0
1213
pytest==7.2.0
1314
pytest-cov==4.1.0
1415
expecttest==0.1.6

.github/workflows/android-perf.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ jobs:
120120
# so let's just sed it
121121
sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' android-llm-device-farm-test-spec.yml.j2
122122
123+
124+
BINARY_PATH="https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/xnn_executor_runner
125+
sed -i -e 's,{{ binary_path }},'"${BINARY_PATH}"',g' android-llm-device-farm-test-spec.yml.j2
126+
123127
BENCHMARK_CONFIG_ID=$(echo "${{ matrix.model }}_${{ matrix.config }}" | sed -e 's/[^A-Za-z0-9._-]/_/g')
124128
# The config for this benchmark runs, we save it in the test spec so that it can be fetched
125129
# later by the upload script
@@ -364,6 +368,7 @@ jobs:
364368
365369
export ANDROID_ABIS="arm64-v8a"
366370
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_QNN=ON QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029 bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
371+
cp cmake-out-android-arm64-v8a/backends/xnnpack/xnn_executor_runner ${ARTIFACTS_DIR_NAME}
367372
368373
# Let's see how expensive this job is, we might want to tone it down by running it periodically
369374
benchmark-on-device:

extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ phases:
1313

1414
# Download the model from S3
1515
- curl -s --fail '{{ model_path }}' -o model.zip
16+
- curl -s --fail '{{ binary_path }}' -o xnn_executor_runner
17+
18+
1619
- unzip model.zip && ls -la
1720

1821
# Copy the model to sdcard. This prints too much progress info when the files
@@ -21,9 +24,12 @@ phases:
2124
- adb -s $DEVICEFARM_DEVICE_UDID push *.model /sdcard > /dev/null && echo OK
2225
- adb -s $DEVICEFARM_DEVICE_UDID push *.pte /sdcard > /dev/null && echo OK
2326

27+
- adb -s $DEVICEFARM_DEVICE_UDID push xnn_executor_runner /sdcard > /dev/null && echo OK
28+
2429
# Prepare the model and the tokenizer
2530
- adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /sdcard/"
2631
- adb -s $DEVICEFARM_DEVICE_UDID shell "mkdir -p /data/local/tmp/minibench/"
32+
- adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/xnn_executor_runner /data/local/tmp/minibench/"
2733
- adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.bin /data/local/tmp/minibench/"
2834
- adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.model /data/local/tmp/minibench/"
2935
- adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.pte /data/local/tmp/minibench/"
@@ -33,6 +39,8 @@ phases:
3339
- adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /data/local/tmp/minibench/"
3440
- adb -s $DEVICEFARM_DEVICE_UDID shell "run-as org.pytorch.minibench rm -rf files"
3541

42+
- adb -s $DEVICEFARM_DEVICE_UDID shell chmod +x /data/local/tmp/minibench/xnn_executor_runner
43+
3644
test:
3745
commands:
3846
# By default, the following ADB command is used by Device Farm to run your Instrumentation test.
@@ -117,6 +125,9 @@ phases:
117125
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.BenchmarkActivity \
118126
--es "model_dir" "/data/local/tmp/minibench"
119127
fi
128+
adb -s $DEVICEFARM_DEVICE_UDID shell /data/local/tmp/minibench/xnn_executor_runner --model_path /data/local/tmp/minibench/*.pte --prof_result_path /data/local/tmp/prof_result.bin
129+
adb -s $DEVICEFARM_DEVICE_UDID pull /data/local/tmp/prof_result.bin
130+
python -m profiler.profiler_results_cli --prof_results_bin prof_result.bin
120131

121132

122133
post_test:

profiler/profiler_results_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import argparse
88
import sys
99

10-
from executorch.profiler.parse_profiler_results import ( # type: ignore[import-not-found]
10+
from .parse_profiler_results import ( # type: ignore[import-not-found]
1111
deserialize_profile_results,
1212
mem_profile_table,
1313
profile_aggregate_framework_tax,

0 commit comments

Comments
 (0)