Skip to content

Commit 8e1c364

Browse files
committed
Update
[ghstack-poisoned]
2 parents b96e6d1 + 9f034c5 commit 8e1c364

File tree

12 files changed

+366
-48
lines changed

12 files changed

+366
-48
lines changed

.ci/scripts/test_model.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ test_model_with_qnn() {
188188
EXPORT_SCRIPT=edsr
189189
# Additional deps for edsr
190190
pip install piq
191+
elif [[ "${MODEL_NAME}" == "cvt" ]]; then
192+
EXPORT_SCRIPT=cvt
193+
elif [[ "${MODEL_NAME}" == "dit" ]]; then
194+
EXPORT_SCRIPT=dit
195+
elif [[ "${MODEL_NAME}" == "efficientnet" ]]; then
196+
EXPORT_SCRIPT=efficientnet
197+
elif [[ "${MODEL_NAME}" == "focalnet" ]]; then
198+
EXPORT_SCRIPT=focalnet
199+
elif [[ "${MODEL_NAME}" == "mobilevit_v1" ]]; then
200+
EXPORT_SCRIPT=mobilevit_v1
201+
elif [[ "${MODEL_NAME}" == "mobilevit_v2" ]]; then
202+
EXPORT_SCRIPT=mobilevit_v2
203+
elif [[ "${MODEL_NAME}" == "pvt" ]]; then
204+
EXPORT_SCRIPT=pvt
205+
elif [[ "${MODEL_NAME}" == "swin" ]]; then
206+
EXPORT_SCRIPT=swin_transformer
191207
elif [[ "${MODEL_NAME}" == "albert" ]]; then
192208
EXPORT_SCRIPT=albert
193209
elif [[ "${MODEL_NAME}" == "bert" ]]; then
@@ -196,6 +212,8 @@ test_model_with_qnn() {
196212
EXPORT_SCRIPT=distilbert
197213
elif [[ "${MODEL_NAME}" == "eurobert" ]]; then
198214
EXPORT_SCRIPT=eurobert
215+
elif [[ "${MODEL_NAME}" == "roberta" ]]; then
216+
EXPORT_SCRIPT=roberta
199217
else
200218
echo "Unsupported model $MODEL_NAME"
201219
exit 1
@@ -210,10 +228,13 @@ test_model_with_qnn() {
210228
"dl3"|"mv3"|"mv2"|"ic4"|"ic3"|"vit"|"mb"|"w2l")
211229
SCRIPT_FOLDER=scripts
212230
;;
213-
"albert"|"bert"|"distilbert")
231+
"cvt"|"dit"|"focalnet"|"mobilevit_v2"|"pvt"|"swin")
232+
SCRIPT_FOLDER=oss_scripts
233+
;;
234+
"albert"|"bert"|"distilbert"|"roberta"|"efficientnet"|"mobilevit_v1")
214235
pip install evaluate
215236
SCRIPT_FOLDER=oss_scripts
216-
# Bert models running in 16bit will encounter op validation fail on some operations,
237+
# 16bit models will encounter op validation fail on some operations,
217238
# which requires CHIPSET >= SM8550.
218239
QNN_CHIPSET=SM8550
219240
;;

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ jobs:
594594
strategy:
595595
matrix:
596596
dtype: [fp32]
597-
model: [albert, bert, distilbert] # eurobert requires transfomer >= 4.48.0, skip for now
597+
model: [cvt, dit, efficientnet, focalnet, mobilevit_v1, mobilevit_v2, pvt, swin, albert, bert, distilbert, roberta] # eurobert requires transfomer >= 4.48.0, skip for now
598598
fail-fast: false
599599
with:
600600
runner: linux.2xlarge

backends/qualcomm/builders/op_slice_copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def define_node(
5656
if start < 0:
5757
start = start % input_tensor.shape[dim]
5858

59-
if len(node.args) > 3:
59+
if len(node.args) > 3 and node.args[3] is not None:
6060
end = min(cast(int, node.args[3]), input_tensor.shape[dim])
6161
if end < 0:
6262
end = end % input_tensor.shape[dim]

backends/qualcomm/tests/test_qnn_delegate.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4885,14 +4885,13 @@ def test_gMLP(self):
48854885
self.assertGreaterEqual(msg["top_1"], 60)
48864886
self.assertGreaterEqual(msg["top_5"], 85)
48874887

4888-
@unittest.skip("Only outputs good accuracy in QNN 2.29")
4889-
def test_mobilevit_v2(self):
4888+
def test_mobilevit_v1(self):
48904889
if not self.required_envs([self.image_dataset]):
48914890
self.skipTest("missing required envs")
48924891

48934892
cmds = [
48944893
"python",
4895-
f"{self.executorch_root}/examples/qualcomm/oss_scripts/mobilevit_v2.py",
4894+
f"{self.executorch_root}/examples/qualcomm/oss_scripts/mobilevit_v1.py"
48964895
"--dataset",
48974896
self.image_dataset,
48984897
"--artifact",
@@ -4910,8 +4909,6 @@ def test_mobilevit_v2(self):
49104909
]
49114910
if self.host:
49124911
cmds.extend(["--host", self.host])
4913-
if self.shared_buffer:
4914-
cmds.extend(["--shared_buffer"])
49154912

49164913
p = subprocess.Popen(cmds, stdout=subprocess.DEVNULL)
49174914
with Listener((self.ip, self.port)) as listener:
@@ -4921,17 +4918,22 @@ def test_mobilevit_v2(self):
49214918
if "Error" in msg:
49224919
self.fail(msg["Error"])
49234920
else:
4924-
self.assertGreaterEqual(msg["top_1"], 50)
4921+
self.assertGreaterEqual(msg["top_1"], 70)
49254922
self.assertGreaterEqual(msg["top_5"], 85)
49264923

4927-
def test_pvt(self):
4924+
@unittest.skip("Only outputs good accuracy in QNN 2.29")
4925+
def test_mobilevit_v2(self):
49284926
if not self.required_envs([self.image_dataset]):
49294927
self.skipTest("missing required envs")
49304928

49314929
cmds = [
49324930
"python",
4933-
f"{self.executorch_root}/examples/qualcomm/oss_scripts/pvt.py",
4931+
f"{self.executorch_root}/examples/qualcomm/oss_scripts/mobilevit_v2.py",
4932+
"--dataset",
49344933
self.image_dataset,
4934+
"--artifact",
4935+
self.artifact_dir,
4936+
"--build_folder",
49354937
self.build_folder,
49364938
"--device",
49374939
self.device,
@@ -4944,6 +4946,8 @@ def test_pvt(self):
49444946
]
49454947
if self.host:
49464948
cmds.extend(["--host", self.host])
4949+
if self.shared_buffer:
4950+
cmds.extend(["--shared_buffer"])
49474951

49484952
p = subprocess.Popen(cmds, stdout=subprocess.DEVNULL)
49494953
with Listener((self.ip, self.port)) as listener:
@@ -4953,21 +4957,17 @@ def test_pvt(self):
49534957
if "Error" in msg:
49544958
self.fail(msg["Error"])
49554959
else:
4956-
self.assertGreaterEqual(msg["top_1"], 65)
4960+
self.assertGreaterEqual(msg["top_1"], 50)
49574961
self.assertGreaterEqual(msg["top_5"], 85)
49584962

4959-
def test_mobilevit1(self):
4963+
def test_pvt(self):
49604964
if not self.required_envs([self.image_dataset]):
49614965
self.skipTest("missing required envs")
49624966

49634967
cmds = [
49644968
"python",
4965-
f"{self.executorch_root}/examples/qualcomm/oss_scripts/mobilevit1.py"
4966-
"--dataset",
4969+
f"{self.executorch_root}/examples/qualcomm/oss_scripts/pvt.py",
49674970
self.image_dataset,
4968-
"--artifact",
4969-
self.artifact_dir,
4970-
"--build_folder",
49714971
self.build_folder,
49724972
"--device",
49734973
self.device,
@@ -4989,7 +4989,7 @@ def test_mobilevit1(self):
49894989
if "Error" in msg:
49904990
self.fail(msg["Error"])
49914991
else:
4992-
self.assertGreaterEqual(msg["top_1"], 70)
4992+
self.assertGreaterEqual(msg["top_1"], 65)
49934993
self.assertGreaterEqual(msg["top_5"], 85)
49944994

49954995
def test_regnet(self):

0 commit comments

Comments
 (0)