arXiv:2610.17321cs.DCOct 2026

Manuscript Offprint

arXiv:2610.17321

GPU Goldmines: Tunable WebGPU Kernels for Edge LLM Inference

Rithik Sharma, Reese Levine, Zheyuan Chen, Ananthajit Srikanth, Yanwen Xu, Tyler Sorensen

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

Abstract

As demand for LLM inference grows and consumer GPUs grow more capable, edge deployment is becoming increasingly attractive. WebGPU is compelling in this setting because it offers cross-platform portability and browser accessibility. However, these same strengths also make high performance difficult to achieve, as an implementation that performs well in one context may not perform well in another.

To address this, we present GPU Goldmines, a framework for specifying, executing, and tuning WebGPU kernels. We instantiate GPU Goldmines with kernels for key LLM building blocks: matrix multiplication, matrix-vector multiplication, and flash attention. We characterize performance across diverse devices, shapes, and browsers, and use the resulting database to accelerate subsequent autotuning and configuration selection. On shapes drawn from Llama and Qwen models, our matrix multiplication kernels outperform ONNX Runtime and llama.cpp WebGPU kernels by 7.0× and 1.41× geometric mean, respectively, and deliver end-to-end improvements of 1.48× in the prefill stage of llama.cpp for chat workloads.

1 Introduction

Large language model inference on consumer devices presents an exciting and practical new deployment opportunity [18]. Running models locally reduces latency and removes dependencies on datacenters [14, 21, 53]. WebGPU is poised to be a key enabler of this by exposing GPU acceleration inside the browser without requiring extra installations or platform-specific software stacks [44]. Systems such as WebLLM [38], ONNX Runtime Web [32], and llama.cpp's WebGPU backend [10, 19] already provide initial (and relatively performant) LLM implementations for WebGPU.

That portability, however, requires spanning a remarkably diverse target space. WebGPU kernels may execute on integrated, mobile, and discrete GPUs from different vendors, each with architectural characteristics that impact performance, such as subgroup (warp) size, the bandwidth and latency of the memory hierarchy, and arithmetic throughput [5]. The software stack is similarly diverse; depending on the platform and browser, WebGPU kernels are compiled and run using different implementations and backend APIs, e.g., DirectX, Vulkan, and Metal [4, 12, 25]. As a result, a kernel implementation that performs well in one context may perform poorly in another. In short, while WebGPU provides functional portability, performance portability remains a difficult problem, as previous research has shown [36, 41, 52].

One way to address performance portability is to make kernels tunable. Rather than fixing a single kernel implementation, a tunable kernel exposes a semantics-preserving family of implementations parameterized by performance-relevant choices. Many choices are explicit scalar parameters, such as workgroup size and tile dimensions. Autotuning frameworks can then search this space empirically to identify high-performing instantiations for a target platform. Systems such as OpenTuner [3], CLTune [28], and KernelTuner [42] follow this model, using advanced heuristics to search these spaces efficiently. Tuning is also not limited to assigning values to a fixed set of parameters. In schedule-based systems such as Halide [37] and TVM [6], the search space consists of program transformations, such as tiling, fusion, and reordering. This raises the level of abstraction and expresses richer optimization spaces. Moving even higher up the abstraction hierarchy, AI kernel optimization has shown promise as an even more advanced form of tuning [20, 34, 48].

However, these tuning approaches suffer from two problems: (1) they rely on immediate empirical feedback from the device being tuned on, with little-to-no ability to translate performance from one device to another, and (2) they lack centralized stores of tuning data that can be utilized to provide optimal parameters when running on known devices or reduce the tuning time needed on previously unseen devices. This mismatch is critical for LLM inference, where execution is concentrated in a small number of performance-critical kernels. Because these kernels are invoked repeatedly, tuning them for one device or browser stack and running them in another can directly degrade important application performance, including time-to-first-token and tokens-per-second. Manual inspection of existing WebGPU LLM frameworks suggests that this is currently the case, as existing systems provide limited specialization across devices and browsers (Sec. 8).

References (25)