Manuscript Offprint

arXiv:2611.00408

TileWeave: Heterogeneous Tiling for Sparse Prefill on Mobile SoCs

Wentao Ni, Hong Cai, Mingu Lee, Chihao Yu, Zhongming Yu, Hejia Zhang, Kangqi Zhang, Fatih Porikli, Zhijian Liu, Jishen Zhao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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 NPU's 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, TileWeave 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.

1 INTRODUCTION

Large language models (LLMs) support applications ranging from document understanding and question answering to personal assistants. These applications increasingly rely on long contexts to incorporate documents, retrieved information, and extended interaction histories (Jiang et al., 2024; Bai et al., 2023). Demand for these capabilities extends to edge devices, especially smartphones, where local inference keeps personal data on the device and enables operation without a network connection (Xue et al., 2024). Compact models such as Qwen3-1.7B (Yang et al., 2025), Llama-3.2-1B/3B (Meta, 2024), and Phi-3-mini (Abdin et al., 2024) make local deployment feasible, but long contexts remain expensive even for small models. Processing a longer prompt increases the delay before generation begins, while its growing key/value (K/V) cache consumes more of the device's limited memory (Xu et al., 2024; Kwon et al., 2023). Dense attention compounds this pressure by computing interactions across the prompt, with quadratic work and substantial memory traffic. Block-sparse attention is therefore an important approach to efficient long-context inference: it selects informative groups of tokens and skips the remaining attention interactions, reducing computation and the associated data movement (Jiang et al., 2024; Xu et al., 2025; Lai et al., 2025). Enabling these savings on mobile hardware is essential for making long-context applications responsive within

constrained device resources.

Despite progress in sparse attention, efficient execution on mobile NPU's remains challenging. Existing sparse pre-fill methods primarily target GPUs, whereas mobile NPU systems emphasize efficient dense computation and heterogeneous placement of model components (Xu et al., 2025; 2024; Chen et al., 2025). An NPU obtains high throughput by processing large, regular tiles and reusing their inputs, whereas neighboring queries can select different, scattered key blocks. Executing each small selection separately repeats data staging and limits reuse; combining selections into a large tile improves hardware utilization but computes extra interactions. Discarding selections that do not fit the shared tile can also remove information needed for accurate outputs. Thus, fewer selected blocks do not automatically translate into lower latency: execution must preserve useful selections while exploiting the reuse that the hardware needs.

We introduce TileWeave, a system that addresses such a mismatch through heterogeneous sparse prefill (Figure 1). Our key idea is to assign work according to how widely selected key blocks are shared across queries. The NPU handles shared work in efficient coarse tiles, while the GPU handles query-specific work at fine granularity. Together with inexpensive selection and coordinated execution, this split reduces wasted computation while retaining useful query-specific contributions.

In particular, our contributions span the selection policy, work partition, and runtime needed to make this approach practical. First, we identify cross-query reuse as a criterion

¹University of California, San Diego ²Qualcomm AI Research ³Purdue University ⁴Inco AI. Correspondence to: Jishen Zhao jzhao@ucsd.edu.

Figure

Figure 1. Thin blue frames mark NPU query tiles: 64 queries in (1) and 256 in (2)–(4). Small tiles preserve selections but repeat K/V staging and coordination, limiting NPU efficiency. Coarse tiles improve reuse, but dropping exceptions risks accuracy (2), while coarse masked tiles compute unwanted interactions (3). TileWeave keeps shared keys on coarse NPU tiles and preserves exceptions through fine GPU execution (4).

for choosing execution granularity, supported by measurements of NPU efficiency and the accuracy contribution of query-specific selections. Second, we design an NPU-native selector using compact query and key summaries, coupled with a reuse-based partition that preserves every selected block while assigning it to coarse NPU or fine GPU execution. Third, we build a runtime that overlaps the two engines and combines their partial results with low coordination overhead. We implement TileWeave in llama.cpp (Gerganov & llama.cpp Contributors, 2023) and evaluate it with Qwen3-1.7B and Llama-3.2-3B-Instruct on RULER and LongBench, and on Snapdragon SM8750 and SM8850 phones. TileWeave matches XAttention's RULER accuracy with Qwen3 and slightly exceeds it with Llama; its LongBench means remain within 0.5 points of XAttention and 0.6 points of dense attention on both models. With Qwen3 over 1k–16k tokens, it achieves 1.35–3.23× faster full-model prefill than XAttention and up to 1.58× over dense attention; attention itself is up to 2.14× faster than dense attention, including selection and coordination.

References (44)