Commit c1dba0f
authored
Qualcomm AI Engine Direct - Support simple_eval in calibration, perpl… (#12958)
### Summary
- Enable Perplexity Evaluation on device with `llama.py`
- Evaluate perplexity after qdq cpu
- Enable quantization to use simple_eval as calibration dataset.
- Enable UT to check perplexity for QWEN, which should be more reliable
than checking the string output.
Will have a follow up PR to address:
- External CI enablement for qwen on x86 (If it does not take too long).
- Hide Logits scale/offset to metadata in model
#### Script
`python examples/qualcomm/oss_scripts/llama/llama.py -b build-android -s
$DEVICE -m SM8750 --prompt "What is 1+1?" --temperature 0 --model_mode
kv --max_seq_len 1024 --ptq 16a8w --decoder_model qwen2_5
--eval_perplexity --tasks wikitext`
### Test plan
`python backends/qualcomm/tests/test_qnn_delegate.py -k
TestExampleLLMScript.test_static_qwen2_5 --model SM8650 --build_folder
build-android/ --executorch_root . -s $DEVICE`
Author: @shewu-quic, @winskuo-quic1 parent 6485e4f commit c1dba0f
File tree
17 files changed
+900
-295
lines changed- backends/qualcomm/tests
- examples/qualcomm
- oss_scripts/llama
- model
- runner
17 files changed
+900
-295
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4313 | 4313 | | |
4314 | 4314 | | |
4315 | 4315 | | |
4316 | | - | |
| 4316 | + | |
4317 | 4317 | | |
4318 | 4318 | | |
4319 | 4319 | | |
| |||
4338 | 4338 | | |
4339 | 4339 | | |
4340 | 4340 | | |
4341 | | - | |
4342 | | - | |
4343 | | - | |
| 4341 | + | |
4344 | 4342 | | |
4345 | | - | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
4346 | 4349 | | |
4347 | 4350 | | |
4348 | 4351 | | |
| |||
4355 | 4358 | | |
4356 | 4359 | | |
4357 | 4360 | | |
4358 | | - | |
4359 | | - | |
4360 | 4361 | | |
4361 | 4362 | | |
4362 | 4363 | | |
| |||
4365 | 4366 | | |
4366 | 4367 | | |
4367 | 4368 | | |
4368 | | - | |
4369 | | - | |
4370 | | - | |
4371 | | - | |
4372 | | - | |
4373 | | - | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
4374 | 4376 | | |
4375 | 4377 | | |
4376 | 4378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments