惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MyScale Blog
MyScale Blog
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
L
LINUX DO - 热门话题
Project Zero
Project Zero
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MongoDB | Blog
MongoDB | Blog
Spread Privacy
Spread Privacy
S
Schneier on Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
J
Java Code Geeks
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - Franky
T
Threat Research - Cisco Blogs
D
Docker
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
Google DeepMind News
Google DeepMind News
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
月光博客
月光博客
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
V
Visual Studio Blog
AWS News Blog
AWS News Blog
I
Intezer
T
The Blog of Author Tim Ferriss
P
Privacy International News Feed
T
Tor Project blog
F
Full Disclosure
P
Proofpoint News Feed
SecWiki News
SecWiki News
H
Heimdal Security Blog
Help Net Security
Help Net Security
The Hacker News
The Hacker News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Fused Kernels in LLMs: Reducing Memory Bandwidth Bottlenecks Through GPU Kernel Fusion
Shrijith Venkatramana · 2026-06-16 · via DEV Community

Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product.


Every few months, a new LLM appears claiming to be 2× faster, 3× cheaper, or capable of serving millions more tokens per second.

Many developers assume the gains come from better GPUs or smaller models.

Often, the real answer is far less glamorous:

Someone removed a few trips to memory.

One of the most important performance techniques in modern LLM inference is kernel fusion. It doesn't change the model architecture. It doesn't improve accuracy. It doesn't make the AI smarter.

It simply makes the hardware spend less time waiting and more time computing.

And in large-scale AI systems, that can mean the difference between serving thousands of users and serving millions.

Let's dig into how fused kernels work, starting from intuition and moving down to GPU-level details.

1. Why LLMs Are Often Memory-Bound

When developers first think about neural network performance, they usually focus on FLOPS.

Modern GPUs advertise enormous numbers:

  • Tens of TFLOPS
  • Hundreds of TFLOPS
  • Even PFLOPS for specialized workloads

Yet many LLM operations don't come close to using that compute capacity.

The reason is that a GPU spends a surprising amount of time moving data around.

Imagine a simple operation:

y = gelu(x + bias)

Conceptually this is tiny.

But naively, the GPU may:

  1. Load x
  2. Load bias
  3. Compute addition
  4. Write result to memory
  5. Read result back
  6. Compute GELU
  7. Write final output

The arithmetic is cheap.

The memory traffic is expensive.

As models grow into billions of parameters, memory movement becomes one of the dominant costs.

2. What Is a GPU Kernel?

Before understanding fusion, we need to understand kernels.

A GPU kernel is essentially a program launched on the GPU.

For example:

z = x + y

might launch one kernel.

Then:

output = relu(z)

might launch another.

Then:

output = output * scale

might launch a third.

Each kernel launch has overhead:

  • Scheduling work
  • Reading memory
  • Writing memory
  • Synchronization

The GPU repeatedly moves intermediate results between global memory and compute units.

Those extra movements add up quickly.

3. The Core Idea of Kernel Fusion

Kernel fusion combines multiple operations into a single GPU kernel.

Instead of:

z = x + bias
a = gelu(z)
output = a * scale

we create one fused operation:

output = scale * gelu(x + bias)

Now the GPU can:

  1. Load input once
  2. Perform all calculations
  3. Write output once

No intermediate tensors are stored in global memory.

Visually:

Without fusion

Memory → Add
          ↓
       Memory
          ↓
        GELU
          ↓
       Memory
          ↓
       Scale
          ↓
       Memory

With fusion

Memory → Add → GELU → Scale → Memory

The computation is identical.

The data movement is dramatically reduced.

4. Where Fusion Appears Inside LLMs

Modern transformers contain many opportunities for fusion.

A few common examples:

Bias + GELU Fusion

Instead of:

hidden = linear(x)
hidden += bias
hidden = gelu(hidden)

The bias addition and activation are fused.

This is common in transformer MLP blocks.

LayerNorm Fusion

Layer normalization requires:

  • Mean computation
  • Variance computation
  • Normalization
  • Scale
  • Shift

Naively these can involve multiple passes through memory.

Optimized kernels perform much of the work in one fused operation.

Softmax Fusion

Attention layers require softmax:

softmax(QK^T)

Implementations often fuse:

  • Scaling
  • Masking
  • Softmax

into a single kernel.

This reduces memory traffic significantly.

5. FlashAttention: The Famous Fusion Example

One of the best-known examples of fusion is Tri Dao's FlashAttention.

The traditional attention pipeline looks roughly like:

QK^T
 ↓
Store matrix
 ↓
Mask
 ↓
Store matrix
 ↓
Softmax
 ↓
Store matrix
 ↓
Multiply by V

The intermediate attention matrix can be enormous.

For long contexts it becomes a major bottleneck.

FlashAttention reorganizes the computation so that large intermediate matrices never need to be materialized in global memory.

Instead:

  • Data is processed in tiles
  • Shared memory is heavily used
  • Multiple attention steps are effectively fused together

The result is dramatically lower memory usage and substantially higher throughput.

This single optimization helped unlock much longer context windows for modern LLMs.

6. How Fusion Works at the GPU Level

Let's go one level deeper.

Modern GPUs have a hierarchy:

Global Memory (HBM)
        ↓
L2 Cache
        ↓
Shared Memory
        ↓
Registers

Global memory is large but relatively slow.

Registers are extremely fast but tiny.

Fusion attempts to keep intermediate values as close to registers as possible.

Instead of:

Compute
 ↓
Write to HBM
 ↓
Read from HBM
 ↓
Compute

we get:

Compute
 ↓
Register
 ↓
Compute
 ↓
Register
 ↓
Compute

This drastically increases arithmetic intensity:

Useful Computation
------------------
Bytes Moved

Higher arithmetic intensity generally means better GPU utilization.

This is why fusion often produces large speedups even when the number of mathematical operations stays exactly the same.

7. Why Fused Kernels Are Hard to Build

If fusion is so beneficial, why not fuse everything?

Because fusion introduces complexity.

Several challenges emerge:

Register Pressure

Every intermediate value consumes registers.

Too many registers reduce occupancy.

Compilation Complexity

A fused kernel may contain dozens of operations.

Generating optimal GPU code becomes difficult.

Hardware Differences

A kernel optimized for:

  • NVIDIA H100
  • NVIDIA A100
  • AMD MI300

may require different strategies.

Debugging

Instead of debugging:

Add
GELU
Multiply

you debug:

FusedAddGeluMultiplyLayerNormKernel_v7

which is considerably less pleasant.

This is one reason projects such as:

  • Triton
  • NVIDIA CUDA
  • TorchInductor

have become increasingly important.

They help automate kernel generation and fusion.

Conclusion

Fused kernels are one of those optimizations that seem almost boring at first glance.

No new model architecture.

No breakthrough algorithm.

No clever prompting technique.

Yet they are responsible for a significant portion of the performance gains that make modern LLM systems practical.

The key insight is simple:

In large-scale AI systems, moving data is often more expensive than computing on it.

Kernel fusion reduces unnecessary memory traffic, keeps data closer to the GPU's compute units, and allows the hardware to spend more time doing useful work.

The next time you hear that a new LLM stack is dramatically faster, don't just ask about quantization, caching, or model architecture.

Ask:

How much of that speedup came from fused kernels?

Question for readers: Have you ever profiled an ML workload and discovered that memory movement—not computation—was the real bottleneck?


*AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.

git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.*

Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.


GenAI today is a race car without brakes. It accelerates fast -- you describe something, and large blocks of code appear instantly. But AI agents silently break things: they remove logic, relax constraints, introduce expensive cloud calls, leak credentials, and change behavior -- without telling you. You often find out in production.

git-lrc is your braking system. It hooks into git commit and runs an AI review on every diff before it lands. 60-second setup. Completely free.

In short, git-lrc helps Prevent Outages, Breaches, and Technical Debt Before They Happen

At a glance: 10 risk categories · 100+ failure patterns tracked · every commit…