Skip to content

Commit 522efa8

Browse files
committed
rebase
1 parent f8c674d commit 522efa8

File tree

3 files changed

+15
-45
lines changed

3 files changed

+15
-45
lines changed

.ci/scripts/test_model.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ test_model_with_qnn() {
188188
EXPORT_SCRIPT=edsr
189189
# Additional deps for edsr
190190
pip install piq
191+
elif [[ "${MODEL_NAME}" == "deit" ]]; then
192+
EXPORT_SCRIPT=deit
193+
elif [[ "${MODEL_NAME}" == "pvt" ]]; then
194+
EXPORT_SCRIPT=pvt
195+
elif [[ "${MODEL_NAME}" == "swin" ]]; then
196+
EXPORT_SCRIPT=swin_transformer
191197
elif [[ "${MODEL_NAME}" == "albert" ]]; then
192198
EXPORT_SCRIPT=albert
193199
elif [[ "${MODEL_NAME}" == "bert" ]]; then
@@ -196,26 +202,13 @@ test_model_with_qnn() {
196202
EXPORT_SCRIPT=distilbert
197203
elif [[ "${MODEL_NAME}" == "eurobert" ]]; then
198204
EXPORT_SCRIPT=eurobert
205+
elif [[ "${MODEL_NAME}" == "roberta" ]]; then
206+
EXPORT_SCRIPT=roberta
199207
else
200208
echo "Unsupported model $MODEL_NAME"
201209
exit 1
202210
fi
203211

204-
SCRIPT_FOLDER=""
205-
case "${MODEL_NAME}" in
206-
"dl3"|"mv3"|"mv2"|"ic4"|"ic3"|"vit"|"mb"|"w2l")
207-
SCRIPT_FOLDER=scripts
208-
;;
209-
"deit"|"pvt"|"swin")
210-
SCRIPT_FOLDER=oss_scripts
211-
;;
212-
*)
213-
echo "Unsupported model $MODEL_NAME"
214-
exit 1
215-
;;
216-
esac
217-
218-
219212
# Use SM8450 for S22, SM8550 for S23, and SM8560 for S24
220213
# TODO(guangyang): Make QNN chipset matches the target device
221214
QNN_CHIPSET=SM8450
@@ -225,7 +218,10 @@ test_model_with_qnn() {
225218
"dl3"|"mv3"|"mv2"|"ic4"|"ic3"|"vit"|"mb"|"w2l")
226219
SCRIPT_FOLDER=scripts
227220
;;
228-
"albert"|"bert"|"distilbert")
221+
"deit"|"pvt"|"swin")
222+
SCRIPT_FOLDER=oss_scripts
223+
;;
224+
"albert"|"bert"|"distilbert"|"roberta")
229225
pip install evaluate
230226
SCRIPT_FOLDER=oss_scripts
231227
# Bert models running in 16bit will encounter op validation fail on some operations,

.github/workflows/trunk.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -479,32 +479,6 @@ jobs:
479479
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
480480
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
481481
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"
482-
483-
test-qnn-optimum-model:
484-
name: test-qnn-optimum-model
485-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
486-
permissions:
487-
id-token: write
488-
contents: read
489-
strategy:
490-
matrix:
491-
dtype: [fp32]
492-
model: [deit, pvt, swin]
493-
fail-fast: false
494-
with:
495-
runner: linux.2xlarge
496-
docker-image: executorch-ubuntu-22.04-qnn-sdk
497-
submodules: 'recursive'
498-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
499-
timeout: 900
500-
script: |
501-
# The generic Linux job chooses to use base env, not the one setup by the image
502-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
503-
conda activate "${CONDA_ENV}"
504-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
505-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
506-
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
507-
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"
508482
509483
test-qnn-optimum-model:
510484
name: test-qnn-optimum-model
@@ -515,7 +489,7 @@ jobs:
515489
strategy:
516490
matrix:
517491
dtype: [fp32]
518-
model: [albert, bert, distilbert] # eurobert requires transfomer >= 4.48.0, skip for now
492+
model: [deit, pvt, swin, albert, bert, distilbert, roberta] # eurobert requires transfomer >= 4.48.0, skip for now
519493
fail-fast: false
520494
with:
521495
runner: linux.2xlarge

examples/qualcomm/oss_scripts/roberta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def main(args):
4747

4848
# Get the Roberta model.
4949
model = get_instance(args)
50-
pte_filename = "roberta_qnn"
50+
pte_filename = "roberta_qnn_q16"
5151

5252
# lower to QNN
5353
passes_job = get_capture_program_passes()
@@ -137,7 +137,7 @@ def main(args):
137137
"-a",
138138
"--artifact",
139139
help="path for storing generated artifacts and output by this example. Default ./Roberta_qnn",
140-
default="./Roberta_qnn",
140+
default="./roberta",
141141
type=str,
142142
)
143143
parser.add_argument(

0 commit comments

Comments
 (0)