A new study has quantified, for the first time at scale, how much WebGPU's security architecture slows down AI inference in browsers — finding that the overhead from managing individual GPU operations, not the GPU's raw power, is the primary constraint on browser-based large language model performance.
WebGPU is the modern web standard that gives browsers direct, controlled access to a device's GPU. Because it runs inside a browser sandbox, it performs validation checks on every GPU operation — a deliberate security trade-off. For gaming or graphics, this is manageable. For neural network inference, which chains together hundreds or thousands of small GPU operations, those checks compound rapidly. Until now, the true cost of this compounding effect had not been rigorously measured.
The 20× Measurement Error That Was Hiding in Plain Sight
The researchers' first major contribution is methodological. Previous attempts to measure WebGPU dispatch overhead used single-operation benchmarks — timing one GPU call in isolation. The new paper argues this approach is fundamentally misleading, because the GPU and CPU can overlap work when operations are isolated, masking the real sequential cost.
By introducing a sequential-dispatch methodology — forcing operations to run one after another, as they do in actual inference — the team found that single-operation benchmarks overestimate the true per-dispatch cost by approximately 20 times.
Naive single-operation benchmarks overestimate dispatch cost by ~20×, a distinction the researchers call critical for optimization.
Once corrected, the true cost of the WebGPU API overhead alone is 24–36 microseconds per operation on Vulkan (the graphics layer used on Windows and Linux) and 32–71 microseconds on Metal (Apple's graphics API on macOS and iOS). When Python interpreter costs are included — relevant because the team built their system on top of PyTorch — the total per-operation overhead rises to approximately 95 microseconds.
Four Vendors, Three Browsers, Two Models
The study is notable for its breadth. The researchers tested across four GPU vendors (NVIDIA, AMD, Apple, Intel), three browsers (Chrome, Safari, Firefox), two native WebGPU implementations (Dawn, used by Chrome, and wgpu-native, used by Firefox), and two sizes of the Qwen2.5 language model (0.5 billion and 1.5 billion parameters) at batch size 1 — meaning one user query at a time, the most common real-world deployment scenario for on-device AI.
To make inference testing possible, the team built torch-webgpu, a custom PyTorch backend that compiles model operations into WebGPU calls. According to the paper, on their reference platform the system achieves 11–12% of CUDA performance at equivalent tasks — a significant gap, though one the researchers attribute largely to dispatch overhead rather than the underlying GPU hardware being incapable.
Kernel Fusion: The Fix That Works on WebGPU But Not CUDA
One of the study's most practically significant findings concerns kernel fusion — a technique where multiple small GPU operations are merged into a single larger one, reducing the number of dispatch calls. On Vulkan, kernel fusion improved throughput by 53%. On CUDA (NVIDIA's native GPU computing platform), the same fusion provided no measurable benefit.
This asymmetry confirms the paper's central thesis: on CUDA, per-operation overhead is already so low that the bottleneck lies elsewhere. On WebGPU over Vulkan, the overhead is high enough that reducing dispatch count produces large gains. The implication for developers is direct — optimization strategies for native AI inference do not automatically transfer to browser-based inference.
The researchers also found that backend choice is the dominant factor in dispatch overhead, but that implementation choice within a backend also matters substantially — by up to 2.2 times on Metal, depending on which WebGPU implementation is used.
An Unexpected Hardware Finding
A striking data point in the paper involves a hardware comparison. An RTX PRO 2000, a mid-range NVIDIA workstation GPU, achieved 1.4 times the WebGPU throughput of an RTX 5090 — NVIDIA's current flagship consumer GPU, which has roughly 6 times more raw compute capacity.
The explanation the paper offers is consistent with its broader argument: when per-operation overhead dominates, raw compute power becomes largely irrelevant. The RTX PRO 2000 is not faster at computation — it is faster at this specific workload because dispatch overhead, not floating-point throughput, is the binding constraint. This finding underscores that benchmarking AI inference on WebGPU using FLOPS or traditional GPU performance metrics produces misleading conclusions.
What Comes Next for Browser AI
The researchers note that the current pipeline is "dispatch-heavy" — a design inherited from how neural networks were originally built for server-side GPU clusters, where dispatch overhead is negligible. Browser-based inference may require fundamentally different model architectures or compilation strategies to become competitive.
All code, benchmarks, and raw data from the study are published as open source, according to the paper, giving developers and framework authors direct access to the measurement tools and results.
What This Means
For anyone building or evaluating AI applications that run directly in a browser, this research establishes that dispatch overhead — not GPU hardware — is the primary performance ceiling, and that standard CUDA-era optimization techniques may not apply without significant reworking for the WebGPU environment.