Commit c77bcfe
authored
Add LlamaDemo Android instrumentation test workflow with model presets (#149)
## Summary
- Add GitHub Actions workflow for running LlamaDemo Android instrumentation tests on Ubuntu runners
- Support multiple model presets (stories, llama, qwen3, custom) selectable via workflow dispatch
- Configure emulator with 16GB RAM to support larger models
- Capture and upload logcat as artifact for debugging test failures
## Changes
### Workflow (`.github/workflows/llm-android.yml`)
- Runs on `8-core-ubuntu` with KVM acceleration for emulator
- Caches AVD snapshots for faster subsequent runs
- Model presets selectable via `workflow_dispatch`:
- `stories` (default): Small 110M stories model from S3
- `llama`: Llama-3.2-1B from HuggingFace
- `qwen3`: Qwen3-4B-INT8-INT4 from HuggingFace
- `custom`: User-provided model and tokenizer URLs
- Configures emulator with 16GB RAM via AVD config.ini modification
- Uploads logcat artifact on both success and failure
### Gradle (`llm/android/LlamaDemo/app/build.gradle.kts`)
- Add model preset system with `-PmodelPreset` property
- Support custom URLs via `-PcustomPteUrl` and `-PcustomTokenizerUrl`
- Gradle automatically downloads and pushes model files to emulator
## Test plan
- [x] Run workflow with `stories` preset - verify tests pass
- [x] Verify logcat artifact is uploaded
- [x] Test with `llama` preset (requires sufficient emulator RAM)
- [x] Test with `qwen3` preset1 parent bdab5b6 commit c77bcfe
3 files changed
Lines changed: 152 additions & 68 deletions
File tree
- .github/workflows
- llm/android/LlamaDemo/app
- src/main/java/com/example/executorchllamademo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 31 | + | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | | - | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| |||
61 | 76 | | |
62 | 77 | | |
63 | 78 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
93 | | - | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
99 | 111 | | |
100 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
105 | | - | |
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
20 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
21 | 45 | | |
22 | 46 | | |
23 | 47 | | |
| |||
39 | 63 | | |
40 | 64 | | |
41 | 65 | | |
42 | | - | |
| 66 | + | |
43 | 67 | | |
44 | 68 | | |
45 | 69 | | |
| |||
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
51 | 100 | | |
52 | 101 | | |
53 | 102 | | |
| |||
56 | 105 | | |
57 | 106 | | |
58 | 107 | | |
59 | | - | |
| 108 | + | |
60 | 109 | | |
61 | 110 | | |
62 | 111 | | |
| |||
77 | 126 | | |
78 | 127 | | |
79 | 128 | | |
80 | | - | |
| 129 | + | |
81 | 130 | | |
82 | | - | |
83 | 131 | | |
84 | 132 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 133 | + | |
| 134 | + | |
88 | 135 | | |
89 | | - | |
| 136 | + | |
90 | 137 | | |
91 | 138 | | |
92 | | - | |
| 139 | + | |
93 | 140 | | |
94 | 141 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
103 | 147 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
112 | 159 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
117 | 174 | | |
118 | 175 | | |
119 | 176 | | |
| |||
llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/DemoSharedPreferences.java
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
0 commit comments