TileWeave: Heterogeneous Tiling for Sparse Prefill on Mobile SoCs
Organizations: University of California, San Diego · Qualcomm AI Research · Purdue University · Inco AI
Abstract
Smartphone applications increasingly require large language models to process long contexts, whereas high prefill latency and memory demands constrain local inference. Block-sparse attention reduces computation and memory traffic, but its irregular selections conflict with mobile NPUs' preference for large, regular tiles. Efficient execution must exploit cross-query reuse while avoiding redundant computation and preserving selections needed for accuracy. In this paper, we present TileWeave, which partitions sparse attention by this cross-query reuse: highly shared key blocks run in coarse NPU tiles, while low-reuse blocks run on the GPU only for the query blocks that selected them. In addition, we design an NPU-native pooled-key selector that keeps selection inexpensive, and a runtime that publishes GPU partials in the order the NPU consumes them and merges them in its existing output store. On RULER, HeteroSparse matches XAttention's accuracy with Qwen3-1.7B and improves it with Llama-3.2-3B-Instruct; its mean LongBench scores match XAttention as well. On Snapdragon SM8750 and SM8850 phones, it achieves 1.35--3.23 faster full-model prefill than XAttention over 1k--16k tokens and up to 1.58 faster than dense attention.
Figures & tables
| Query tile | |||
|---|---|---|---|
| 64 | 2.62 ( ) | 3.18 ( ) | 4.12 ( ) |
| 128 | 2.15 ( ) | 2.53 ( ) | 3.28 ( ) |
| 256 | 1.51 ( ) | 1.82 ( ) | 2.34 ( ) |
| Attention policy | Score | Density (%) |
|---|---|---|
| Pool + diagonal | 85.57 | 55.42 |
| Pool + exceptions (ours) | 86.32 | 62.19 |
| Union | 86.29 | 73.13 |
| Ideal speedup | ||
|---|---|---|
| Selection count offloaded | 4k | 8k |
| None (baseline) | ||
| 1 of 4 | ||
| At most 2 of 4 | ||
| At most 3 of 4 | ||
| Qwen3-1.7B | Llama-3.2-3B-Instruct | |||||
|---|---|---|---|---|---|---|
| Method | 4k | 8k | 16k | 4k | 8k | 16k |
| Dense | 87.12 | 79.48 | 70.86 | 86.77 | 83.39 | 80.61 |
| XAttention | 86.31 | 77.16 | 70.08 | 86.00 | 82.64 | 80.13 |
| ShadowAttn | 86.95 | 78.51 | 69.54 | 86.72 | 83.49 | 80.71 |
| TileWeave | 86.37 | 77.19 | 69.99 | 86.32 | 82.98 | 80.19 |
| Qwen3-1.7B | Llama-3.2-3B-Instruct | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Qasper | MFQA | HQA | 2WQA | MSQ | QMSum | Avg. | Qasper | MFQA | HQA | 2WQA | MSQ | QMSum | Avg. |
| Dense | 16.98 | 42.23 | 35.57 | 29.38 | 13.75 | 22.82 | 26.79 | 37.71 | 50.25 | 50.09 | 38.20 | 22.19 | 24.13 | 37.10 |
| XAttention | 18.13 | 42.35 | 36.15 | 28.33 | 14.73 | 22.63 | 27.06 | 37.32 | 50.24 | 48.15 | 36.19 | 22.86 | 23.47 | 36.37 |
| ShadowAttn | 18.86 | 42.36 | 35.38 | 28.53 | 14.43 | 22.73 | 27.05 | 39.39 | 51.04 | 50.20 | 38.75 | 21.89 | 24.10 | 37.56 |
| TileWeave | 17.46 | 43.36 | 35.24 | 28.27 | 13.03 | 22.18 | 26.59 | 38.36 | 48.81 | 50.41 | 37.20 | 21.03 | 23.41 | 36.54 |
| Selector | Score | Density (%) |
|---|---|---|
| TileWeave | 86.37 | 57.30 |
| Keys sampled, not pooled | 85.81 | 57.31 |
| Queries pooled as well | 86.80 | 57.21 |
| XAttention’s antidiagonal scores | 86.67 | 57.26 |
| Dense attention | 87.12 | 100.00 |
| 8k prompts | 16k prompts | ||||
| Scorer | Execution | Time | Gain | Time | Gain |
| Attention (ms) | |||||
| XAttention | naive, per K/V head | 3,762 | 2.24 | 12,978 | 2.37 |
| XAttention | naive, per head | 7,263 | 4.33 | 25,207 | 4.61 |
| Pooled keys | naive | 2,552 | 1.52 | 8,892 | 1.63 |
| Pooled keys | split, | 1,826 | 1.09 | 6,007 | 1.10 |
| RULER 8k | Attention (ms) | Prefill (s) | ||||
| Execution | Score | Dens. | 8k | 16k | 8k | 16k |
| TileWeave | 82.98 | 58.0 | 2,375 | 7,864 | 6.77 | 16.60 |
| Masked tile | 82.64 | 51.1 | 3,066 | 10,537 | 7.63 | 19.63 |
| Union | 83.16 | 70.1 | 2,949 | 10,092 | 7.52 | 19.18 |
| Speedup over the masked tile | 1.29 | 1.34 | 1.13 | 1.18 | ||
| Speedup over the union | 1.24 | 1.28 | 1.11 | 1.16 | ||
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Dense | XAttention | TileWeave | Group mean | |||||
|---|---|---|---|---|---|---|---|---|
| Task | Score | Density | Score | Density | Score | Density | Score | Density |
| cwe | 1.66 | 100.0 | 2.10 | 39.2 | 2.44 | 48.5 | 2.80 | 40.6 |
| fwe | 91.67 | 100.0 | 93.53 | 44.7 | 93.07 | 54.2 | 93.40 | 45.9 |
| niah_multikey_1 | 96.80 | 100.0 | 93.40 | 32.9 | 94.40 | 40.1 | 92.60 | 33.9 |
| niah_multikey_2 | 50.40 | 100.0 | 51.80 | 45.7 | 49.20 | 53.6 | 43.00 | 46.0 |
| niah_multikey_3 | 37.20 | 100.0 | 32.20 | 42.3 | 34.00 | 50.9 | 30.80 | 43.3 |
| 1k | 2k | |||
| Method | Score | Dens. | Score | Dens. |
| Dense | 97.30 | 100 | 91.13 | 100 |
| XAttention | 96.88 | 86.3 | 90.73 | 68.9 |
| TileWeave | 97.00 | 82.1 | 90.69 | 69.2 |
| Dense | XAttention | ShadowAttn | TileWeave | |||||
|---|---|---|---|---|---|---|---|---|
| Task | Score | Density | Score | Density | Score | Density | Score | Density |
| cwe | 95.78 | 100.0 | 93.22 | 51.2 | 95.08 | 51.9 | 94.48 | 57.4 |
| fwe | 64.13 | 100.0 | 64.73 | 58.9 | 64.67 | 52.1 | 64.20 | 66.1 |
| niah_multikey_1 | 99.80 | 100.0 | 99.80 | 54.6 | 99.20 | 55.8 | 99.80 | 57.1 |
| niah_multikey_2 | 85.00 | 100.0 | 83.60 | 62.0 | 84.60 | 52.3 | 84.20 | 67.4 |
| niah_multikey_3 | 92.20 | 100.0 | 88.60 | 55.3 | 91.00 | 50.9 | 89.00 | 60.7 |
| Dense | XAttention | ShadowAttn | TileWeave | |||||
|---|---|---|---|---|---|---|---|---|
| Task | Score | Density | Score | Density | Score | Density | Score | Density |
| cwe | 33.10 | 100.0 | 30.76 | 52.1 | 28.90 | 51.5 | 27.84 | 63.0 |
| fwe | 82.40 | 100.0 | 86.40 | 55.5 | 82.33 | 52.3 | 84.80 | 66.4 |
| niah_multikey_1 | 99.20 | 100.0 | 99.40 | 51.0 | 99.40 | 52.8 | 99.60 | 60.4 |
| niah_multikey_2 | 99.80 | 100.0 | 99.60 | 59.5 | 99.80 | 51.6 | 99.80 | 71.1 |
| niah_multikey_3 | 99.20 | 100.0 | 95.80 | 55.0 | 99.00 | 50.3 | 99.00 | 65.1 |
| Method | 1k | 2k | 4k | 8k | 16k | LB | |
|---|---|---|---|---|---|---|---|
| RULER | TileWeave | 82.1 | 69.2 | 57.3 | 49.6 | 43.8 | 41.4 |
| 84.7 | 72.5 | 60.4 | 52.7 | 46.9 | 44.8 | ||
| group mean | 80.9 | 66.1 | 53.2 | 45.2 | 39.6 | 38.2 | |
| XAttention | 86.3 | 68.9 | 53.4 | 43.6 | 36.2 | 34.4 | |
| ShadowAttn | – | – | 53.4 | 51.2 | 49.8 | 50.1 | |
| Phone | TileWeave | 76.8 | 67.7 | 56.8 | 48.5 | 43.7 | – |
| RULER 4k | Attention (ms) | |||
| Execution | Score | Dens. | 4k | 8k |
| TileWeave, | 86.10 | 53.1 | 374 | 1277 |
| Masked tile | 86.15 | 53.1 | 542 (1.45) | 1973 (1.54) |
| Union | 85.12 | 53.2 | 426 (1.14) | 1426 (1.12) |
LLM Inference Acceleration
LLM inference acceleration develops algorithms and systems that reduce language-model latency, memory use, and serving cost while preserving output quality.
See all 1,147 papers