Retire the Abstractions · Hazy Research
Last year, we set out to write megakernels. But implementing megakernels can be quite miserable. It requires complex data structures, extensive inter-thread/SM/GPU synchronization, deeply nested control flow, etc. We couldn't hold it in our heads, so we did what computer science has done for 70 years: we built a layer of abstraction. Even with it, we had to fight through race conditions and deadlocks for a couple months before the Llamas ran blazingly fast. This year, we built an MoE megakernel, but we deleted the abstraction. With agents, we could work through the complexity directly and build target-optimized code from scratch. No intermediate layers of C++ abstraction were needed. So what could this mean? We've noticed an interesting pattern over the past quarter. The tasks we could already do without abstractions (e.g., writing an optimized GEMM kernel) are now nearly automated given the right prompt. For now, we still have to tell the agent which PTX instructions to use, the warp-
TL;DR: We think CUDA DSLs are heading toward retirement Last year, we set out to write megakernels. But implementing megakernels can be quite miserable. It requires complex data structures, extensive inter-thread/SM/GPU synchronization, deeply nested control flow, etc. We couldn't hold it in our heads, so we did what computer science has done for 70 years: we built a layer of abstraction. Even with it, we had to fight through race conditions and deadlocks for a couple months before the Llamas ran blazingly fast. This year, we built an MoE megakernel, but we deleted the abstraction. With…
saved by
related reading
- Towards self-driving codebases · Cursorcursor.com
- KernelBench: Can LLMs Write GPU Kernels?scalingintelligence.stanford.edu
- Notes on the Software Factorybenedict.dev
- Composer2.pdfcursor.com
- Scaling Managed Agents: Decoupling the brain from the hands \ Anthropicanthropic.com
- How to Land a Frontier Lab Jobvladfeinberg.com
- Shipping at Inference-Speed | Peter Steinbergersteipete.me
- Essays on programming I think about a lot | benkuhn.netbenkuhn.net
- Don’t Outsource Your Thinkingteltam.github.io
- Kevin-32B: Multi-Turn RL for Writing CUDA Kernels | Cognitioncognition.ai
- Thoughts on slowing the fuck downmariozechner.at
- Look Ma, No Bubbles! Designing a Low-Latency Megakernel for Llama-1B · Hazy Researchhazyresearch.stanford.edu