WebGPUでGPT-2をフルスクラッチ実装してブラウザで動かしてみた
Zenn / 3/31/2026
💬 OpinionDeveloper Stack & InfrastructureTools & Practical UsageModels & Research
Key Points
- WebGPUを使ってGPT-2を“フルスクラッチ”で実装し、ブラウザ上で推論(動作)させるまでを試した内容が中心です。
はじめに
WebGPU Compute Shaderを使って、GPT-2の推論パイプラインをブラウザ上でフルスクラッチ実装した。ONNX Runtime WebやTransformers.jsといった既存ライブラリには一切頼らず、行列積(GEMM)からAttention、LayerNorm、Softmaxまで、全てのGPUカーネルをWGSLで手書きしている。
結論から言うと、ブラウザ上でLLMを実用的に動かすのは現時点ではかなり厳しいと感じた。この記事ではプロジェクトの全体像を紹介した上で、WebGPUでの構築とブラウザ上での動作それぞれの制約について述べる。
WebGPUとは
...
Continue reading this article on the original site.
Read original →Related Articles

Black Hat Asia
AI Business
[D] How does distributed proof of work computing handle the coordination needs of neural network training?
Reddit r/MachineLearning

Claude Code's Entire Source Code Was Just Leaked via npm Source Maps — Here's What's Inside
Dev.to

BYOK is not just a pricing model: why it changes AI product trust
Dev.to

Building Real-Time AI Voice Agents with Google Gemini 3.1 Flash Live and VideoSDK
Dev.to