THE BIG PICTURE

Put each mechanism in context.

Understand DeepInfer through four layers of responsibilities and state.

01

Inference core

Connect request entry, sampling, and state updates through the framework.

02

State & memory

Understand cache ownership, block mappings, and prefix reuse.

03

Batching & scheduling

Plan each round under request, token-budget, and execution dependencies.

04

Distribution & experts

Trace expert routes, physical replicas, and distributed coordination.

FOLLOW THE SOURCE

Follow a request through DeepInfer.

01LLM.generate
02LLMEngine.step
03Scheduler
04Worker
05ModelRunner
06Sampling
07State updates

Follow entry, scheduling, execution, sampling, and state updates. One step may involve several requests and tokens; ZOS can defer post-processing to the next round. Source links use a pinned revision.

OFFICIAL DESIGN / FIVE QUESTIONS

Read the design. Understand the tradeoffs.

DeepSeek’s official article “DeepSeek V4.1 Flash Large-Scale Inference Deployment” explains the system design behind DeepInfer. Connect that design to the course through five questions.

Read the official article
THE QUESTION

Why separate prefill and decode?

Prefill processes the input context; decode generates subsequent tokens. PD disaggregation gives the stages separate resources and scheduling boundaries, connected by a state handoff. In the source, identify a request’s current stage and the state required to enter the next one.

Stages can be scheduled independently; the state handoff remains a dependency.

ONE REQUEST, DISTINCT STAGESConceptual flow
01EntryAccept a request
02PrefillProcess input context
03State handoffPrepare decode state
04DecodeGenerate subsequent tokens
05OutputCollect ready results
Separate resource and scheduling boundaries, connected by state handoff.
CONCEPTUAL RELATION
request → prefill → state_handoff → decode → output

READING SCOPEProduction design; cache services and load-balancing infrastructure are not fully open-sourced. Source entry points follow the course’s pinned revision.8b16149