Commit 17e1487
authored
Qualcomm AI Engine Direct - Enable more HF LLM Model (#20587)
### Summary
Enable more hf llm models that is also tested on Optimum-ExecuTorch.
Specs used: SM8750, QNN2.37, 16a8w, context_len=128
| Model (`--decoder_model`) | Token/Sec | Use `--enable_spinquant_r3`? |
Sample Prompt |
|---|:---:|---|---|
| `llama3_2-1b` | 29 | ✅ **Yes** | "Simply put, the theory of relativity
states that" |
| `qwen2_5-0_5b` | 130 | ✅ **Yes** | "My favourite condiment is " |
| `qwen3-0_6b` | 70 | ✅ **Yes** | "Give me a short introduction to large
language model." |
| `smollm2_135m` | 254 | ❌ **No** | "My favourite condiment is " |
| `granite-3_3-2b` | 17 | ❌ **No** | "Take a current environmental issue
and work backward to devise an innovative prevention strategy" |
Sample Script
`python examples/qualcomm/oss_scripts/hf_causal_lm.py --ptq 16a8w
--prompt "My favourite condiment is " --soc_model SM8750 --device
$DEVICE_ID --build_folder build-android/ --decoder_model qwen2_5-0_5b
--enable_spinquant_r3`
### Test plan
`python backends/qualcomm/tests/test_qnn_delegate.py
TestExampleLLMScript.test_hf_causal_lm --device $DEVICE_ID --soc_model
SM8750 --build_folder build-android --executorch_root . --artifact_dir
./hf_qwen`1 parent fa49f8f commit 17e1487
4 files changed
Lines changed: 17 additions & 12 deletions
File tree
- backends/qualcomm/tests
- examples/qualcomm/oss_scripts
- llm_utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8723 | 8723 | | |
8724 | 8724 | | |
8725 | 8725 | | |
8726 | | - | |
8727 | | - | |
| 8726 | + | |
| 8727 | + | |
8728 | 8728 | | |
8729 | 8729 | | |
8730 | 8730 | | |
8731 | 8731 | | |
8732 | 8732 | | |
8733 | | - | |
| 8733 | + | |
8734 | 8734 | | |
8735 | 8735 | | |
8736 | 8736 | | |
8737 | | - | |
| 8737 | + | |
8738 | 8738 | | |
8739 | 8739 | | |
8740 | 8740 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
| 219 | + | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
0 commit comments