Skip to content
Athrael.net logoAthrael.net

Introduction to GPU Inference

Chapter 1, Lesson 1 · From prompt to replyChapter 1, Lesson 1 · What is inference?Chapter 1, Lesson 1 · TokenizationChapter 1, Lesson 1 · Generating a replyChapter 1, Lesson 1 · GPU vs CPUChapter 1, Lesson 1 · Memory constraintsChapter 1, Lesson 2 · BatchingChapter 1, Lesson 2 · Adding more requestsChapter 1, Lesson 2 · Continuous batchingChapter 1, Lesson 3 · Time to first tokenChapter 1, Lesson 3 · Time per output tokenChapter 1, Lesson 3 · End-to-end latencyChapter 1, Lesson 3 · Throughput and goodputChapter 1, Lesson 3 · PercentilesChapter 1, Lesson 4 · Consumer and data center GPUsChapter 1, Lesson 4 · Data centersChapter 1, Lesson 4 · Load balancingChapter 1, Lesson 4 · Peak demandChapter 1, Lesson 4 · CostsChapter 2, Lesson 1 · Prefill and decodeChapter 2, Lesson 1 · Aggregated servingChapter 2, Lesson 1 · Disaggregated servingChapter 2, Lesson 1 · Static allocationChapter 2, Lesson 1 · Adaptive allocationChapter 2, Lesson 1 · Adaptive allocationChapter 2, Lesson 2 · What is an inference engine?Chapter 2, Lesson 2 · Engine configurationChapter 2, Lesson 2 · Engine configurationChapter 2, Lesson 2 · Widely used enginesChapter 2, Lesson 3 · What is a serving framework?Chapter 2, Lesson 3 · What is a serving framework?Chapter 2, Lesson 3 · What is a serving framework?Chapter 2, Lesson 3 · What is Narwhal?Chapter 2, Lesson 3 · How Narwhal worksChapter 2, Lesson 4 · The Narwhal CLIChapter 2, Lesson 4 · The Narwhal CLIChapter 2, Lesson 4 · Your own fleetChapter 2, Lesson 4 · Your own fleetChapter 2, Lesson 4 · Your own fleet

Welcome

Hello, Athos here. Welcome to my course, Introduction to GPU Inference. I put this course together to share what I know about inference, and I added a few extras to make the experience more interactive.

The lessons are short, and each one has diagrams you can run yourself. If you’d rather listen, the lessons can be read aloud. I’m adding lessons as I write them, so there’s more on the way. When you’re ready, start with Chapter 1: Foundations.

I hope you enjoy the course, and have a wonderful day!

Chapter 1: Foundations4 lessons complete

Chapter overviewWhat the course covers, why I made it, and the four lessons of Chapter 1.
  1. What happens between sending a prompt and reading the reply.

    StartContinueTake it againListen
  2. How one GPU serves several requests together, and how that affects the speed of each.

    StartContinueTake it againListen
  3. What time to first token, time per output token, throughput and percentiles measure, and how they relate to each other.

    StartContinueTake it againListen
  4. The hardware behind a service with millions of users, how requests are distributed across it, how demand varies through the day and what it costs.

    StartContinueTake it againListen

Chapter 2: Serving inference4 lessons complete

Chapter overviewA review of Chapter 1, and the four lessons of Chapter 2.
  1. Prefill and decode, aggregated and disaggregated serving, and static and adaptive allocation by cold or hot swap.

    StartContinueTake it againListen
  2. What an inference engine does, how its configuration divides a GPU's memory into slots, and a few widely used engines.

    StartContinueTake it againListen
  3. What a serving framework does, and how Narwhal switches engines between prefill and decode without reloading the model.

    StartContinueTake it againListen
  4. Install Narwhal, run four llama.cpp engines and a router on your own computer with narwhal dev, send them prompts and watch an engine switch roles.

    StartContinueTake it againListen

Chapter 3: Inference Deep DiveComing soon

  1. Capacity and saturation

Attributions: Fish Audio Drama 3 for the narration.