Skip to content

Commit 2b23762

Browse files
guangy10Github Executorch
authored andcommitted
Fix broken QNN models on benchmarks (#7630)
Co-authored-by: Github Executorch <[email protected]>
1 parent 51534e1 commit 2b23762

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.ci/scripts/test_model.sh

+7
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ test_model_with_qnn() {
169169
EXPORT_SCRIPT=inception_v3
170170
elif [[ "${MODEL_NAME}" == "vit" ]]; then
171171
EXPORT_SCRIPT=torchvision_vit
172+
elif [[ "${MODEL_NAME}" == "edsr" ]]; then
173+
EXPORT_SCRIPT=edsr
174+
# Additional deps for edsr
175+
pip install piq
176+
else
177+
echo "Unsupported model $MODEL_NAME"
178+
exit 1
172179
fi
173180

174181
# Use SM8450 for S22, SM8550 for S23, and SM8560 for S24

examples/qualcomm/scripts/edsr.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ def main(args):
102102
"Please specify a device serial by -s/--device argument."
103103
)
104104

105-
dataset = get_dataset(
106-
args.hr_ref_dir, args.lr_dir, args.default_dataset, args.artifact
107-
)
108-
109-
inputs, targets, input_list = dataset.lr, dataset.hr, dataset.get_input_list()
110-
pte_filename = "edsr_qnn_q8"
111105
instance = EdsrModel()
106+
if args.compile_only:
107+
inputs = instance.get_example_inputs()
108+
else:
109+
dataset = get_dataset(
110+
args.hr_ref_dir, args.lr_dir, args.default_dataset, args.artifact
111+
)
112112

113+
inputs, targets, input_list = dataset.lr, dataset.hr, dataset.get_input_list()
114+
115+
pte_filename = "edsr_qnn_q8"
113116
build_executorch_binary(
114117
instance.get_eager_model().eval(),
115118
(inputs[0],),

0 commit comments

Comments
 (0)