Commit fe61104
ggml-opencl: port FA barrier fix to f16/f32_f16 siblings + guard upscale zero dims
PR-review follow-ups:
- Port the flash-attn tile-loop barrier/divergence fix (previously only in
flash_attn_f32.cl) to the f16 and f32_f16 sibling kernels: guard the score
loop with `if (my_query_row < n_q)` instead of an early `continue`, and add a
trailing barrier at the end of the K/V tile loop so out-of-range lanes cannot
race ahead into the next tile's load while active lanes still read l_k/l_v.
flash_attn_f32_f16 is the kernel the Qwen3-VL vision tower actually dispatches
(K/V cast to F16), so the fix was missing from the validated workload.
Score-loop bodies are unchanged.
- Guard zero source dimensions in ggml_cl_upscale: the sf* scale factors divide
by the source dims, so a zero source dim yields +inf; the existing early-exit
only covered zero destination dims.
Validated on-device (S25 Ultra / Adreno 830 OpenCL, QVAC-21297): the GPU vision
projector matches CPU exactly (Delta 0.0 pp, task-for-task) and is ~26% faster
than the shipping CPU projector on encode; 0 device-loss.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8b02fa4 commit fe61104
3 files changed
Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9573 | 9573 | | |
9574 | 9574 | | |
9575 | 9575 | | |
| 9576 | + | |
| 9577 | + | |
| 9578 | + | |
| 9579 | + | |
| 9580 | + | |
| 9581 | + | |
9576 | 9582 | | |
9577 | 9583 | | |
9578 | 9584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 | | |
204 | 209 | | |
205 | 210 | | |
| |||
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
| |||
0 commit comments