Single-Kernel Fusion for Sequential Fitness Evaluation via WebGPU Compute Shaders

Fusing sequential fitness evaluations into single GPU compute shader dispatches eliminates the per-step kernel launch overhead that dominates framework-based GPU computation. On a 1,500-timestep financial simulation, a WebGPU compute shader achieves 46.2 gen/s — 7.2× over JAX GPU with lax.scan+vmap (6.43 gen/s on Tesla T4) and 94× over PyTorch CUDA. On Acrobot-v1 (500 timesteps, explicit Euler), the gap narrows to 1.29× over JAX GPU, revealing that the fusion advantage scales with episode length L. JAX GPU dominates on embarrassingly parallel Rastrigin (1,164 vs 170 gen/s), confirming the advantage is specific to sequential workloads. A native Metal baseline via wgpu quantifies Chrome's browser overhead at 1.92×. We show torch.compile fails at L≥1,000 and that WebGPU dominates CMA-ES across all tested dimensionality regimes. The insight — hand-fused compute shaders outperform even XLA-compiled loop fusion on long sequential fitness functions — applies beyond WebGPU, and WebGPU makes such fusion accessible with zero installation. vnext changes: v6: cite Maczan (arXiv:2604.02344); add §4.13 cross-vendor crowdsourced validation across 7 GPU vendors / 92 unique devices; replace Limitations 'Tesla T4 only' with multi-architecture distribution (Pascal/Turing/Ampere/Lovelace/Blackwell); arithmetic suite extended to 84 checks. v7: erratum + artifact release — the cross-API Acrobot code (per-step PyTorch, hand-fused CUDA, JAX lax.scan, Triton + Colab notebook) is now published in the repository with a CI-gated cross-implementation equivalence check (NumPy/PyTorch/JAX identical in f64); integrator label corrected (explicit Euler dt=0.05 across all implementations, not RK4); §4.13 crowdsourced snapshot recovered into the repo (680 runs, exact match); re-measured on Colab T4 with verified-equivalent kernels (torch 2.11.0: fused CUDA 176x, JAX 33.5x over per-step PyTorch, which improved ~3x since the original measurement — ratios compress as frameworks improve, qualitative result unchanged).

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-07-28
DOI
https://doi.org/10.5281/zenodo.19331833
Primary Topic
Parallel Computing and Optimization Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Single-Kernel Fusion for Sequential Fitness Evaluation via WebGPU Compute Shaders

Ahmet Baris Gunaydin
Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
preprint

Single-Kernel Fusion for Sequential Fitness Evaluation via WebGPU Compute Shaders

Ahmet Baris Gunaydin
preprint en

Abstract

Fusing sequential fitness evaluations into single GPU compute shader dispatches eliminates the per-step kernel launch overhead that dominates framework-based GPU computation. On a 1,500-timestep financial simulation, a WebGPU compute shader achieves 46.2 gen/s — 7.2× over JAX GPU with lax.scan+vmap (6.43 gen/s on Tesla T4) and 94× over PyTorch CUDA. On Acrobot-v1 (500 timesteps, explicit Euler), the gap narrows to 1.29× over JAX GPU, revealing that the fusion advantage scales with episode length L. JAX GPU dominates on embarrassingly parallel Rastrigin (1,164 vs 170 gen/s), confirming the advantage is specific to sequential workloads. A native Metal baseline via wgpu quantifies Chrome's browser overhead at 1.92×. We show torch.compile fails at L≥1,000 and that WebGPU dominates CMA-ES across all tested dimensionality regimes. The insight — hand-fused compute shaders outperform even XLA-compiled loop fusion on long sequential fitness functions — applies beyond WebGPU, and WebGPU makes such fusion accessible with zero installation. vnext changes: v6: cite Maczan (arXiv:2604.02344); add §4.13 cross-vendor crowdsourced validation across 7 GPU vendors / 92 unique devices; replace Limitations 'Tesla T4 only' with multi-architecture distribution (Pascal/Turing/Ampere/Lovelace/Blackwell); arithmetic suite extended to 84 checks. v7: erratum + artifact release — the cross-API Acrobot code (per-step PyTorch, hand-fused CUDA, JAX lax.scan, Triton + Colab notebook) is now published in the repository with a CI-gated cross-implementation equivalence check (NumPy/PyTorch/JAX identical in f64); integrator label corrected (explicit Euler dt=0.05 across all implementations, not RK4); §4.13 crowdsourced snapshot recovered into the repo (680 runs, exact match); re-measured on Colab T4 with verified-equivalent kernels (torch 2.11.0: fused CUDA 176x, JAX 33.5x over per-step PyTorch, which improved ~3x since the original measurement — ratios compress as frameworks improve, qualitative result unchanged).

Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.