@vikhyatk: Got sick of hand-tuning GPU kernels, so we built a compiler. Photon 2.0 compiles Moondream, Qwen 3.5, and Gemma 4 into …
Summary
Photon 2.0 is a new inference engine and compiler that compiles models like Moondream, Qwen 3.5, and Gemma 4 into megakernels, claiming up to 2.3x throughput over vLLM and SGLang for physical AI workloads.
View Cached Full Text
Cached at: 08/04/26, 04:01 AM
Got sick of hand-tuning GPU kernels, so we built a compiler.
Photon 2.0 compiles Moondream, Qwen 3.5, and Gemma 4 into megakernels: the entire forward pass in one GPU program.
For each model we define the forward pass using a tracer DSL, that maps out data flows and dependencies for the compiler. Here’s a simplified example showing what it looks like for a dense Moondream layer.
The compiler then explores various ways to schedule the work on the GPU SMs. Actually compiling the megakernel is slow, so we built a CPU-only cost model that tries to simulate execution time for a given schedule. The top candidates then get compiled to find the best one.
Here’s an illustration of the schedule it generates for the dense Moondream layer.
It starts the MLP’s FC2 projection while attention is still scanning the KV cache. By the time attention finishes, most of the MLP work is already done, so the final output projection can join both results immediately.
lol ok i’ll get it out next week
at least this way you know the post wasn’t AI slop lol
i regret missing out on mcnuggets. could’ve punted launch by a day…
sanity? lost that a long time ago lol
There’s less headroom at batch size 1 / single GPU as the model gets bigger, since synchronization cost gets amortized by large matmuls. But in multi-GPU inference (i.e., even bigger models) and higher concurrency there’s still a fair amount of room.
ty, will do!
soon! added to the model backlog
still in the arena lol
which GPU?
Similar Articles
Popping the GPU Bubble
Moondream's Photon inference engine eliminates GPU bubbles through pipelined decoding, achieving near-realtime VLM inference with up to 35% higher decode throughput.
@googlegemma: “Agentic kernel optimization is the future of on-device inference” @xenovacom used Fable 5 to write kernels that pushed…
Xenova used Fable 5 to write optimized kernels achieving 255 tokens per second for Gemma 4 on WebGPU with M4, demonstrating agentic kernel optimization for on-device inference.
@hank_aibtc: Amazing! Running Gemma 4 in the browser, on par with ChatGPT?! Completely zero server, zero data upload, offline, pure WebGPU local inference! Xenova has open-sourced all 27 custom WebGPU kernels written by Fable 5: - Gemma 4 E2B (2.3B parameters...)
The article introduces Xenova's open-sourcing of 27 custom WebGPU kernels, enabling Gemma 4 to run fully offline and locally in the browser at 255 tok/s, and discusses advantages like privacy and offline use. It also mentions FLUX.2's 3D generation capability.
Where we are. In a year, everything has changed. Kimi - Minimax - Qwen - Gemma - GLM
The author highlights how rapidly local AI capabilities have improved, enabling tasks once exclusive to top-tier cloud models to run on affordable hardware using models like Qwen 27b and Minimax 2.7.
@Tono_Ken3: I noticed that there might be another person who realized that gemma-4-12b could rival qwen3.6-35b in practical work Ye…
A tweet highlights that the abliterated, NVFP4 quantized Gemma-4-12B model (7.7 GB) can rival Qwen 3.6-35B in practical tasks while running fast on Blackwell GPUs, demonstrating significant efficiency gains.