Learn AI Math

Kernel

What is Kernel?

In one sentence: In AI computing, a kernel is a small, highly optimized program that runs one operation on a GPU or other accelerator.

Model operations like matrix multiplication or attention are each done by kernels. Faster kernels make the whole model faster. Note: this is different from an operating system kernel.

What does Kernel look like?

FlashAttention is a famous fast kernel for computing attention.

Why does Kernel matter?

Much AI speed improvement comes from writing better kernels.

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.