What separates the phases
In the prefill phase, the calculations for all input tokens can be executed in parallel, while in the decode phase, no parallelization is possible on the level of individual requests. [1]
Which metrics reflect it
The difference between the prefill and decode phases is also reflected in two key metrics for text generation: Time to first token and time per output token. [2]
The time to first token is given by the latency of the prefill phase, while the time per output token is the latency of a single decode step. [3]
Sources
- The Hugging Face source says: In the prefill phase, the calculations for all input tokens can be executed in parallel, while in the decode phase, no parallelization is possible on the level of individual requests. Prefill and Decode for Concurrent Requests
- The Hugging Face source says: The difference between the prefill and decode phases is also reflected in two key metrics for text generation: Time to first token and time per output token. Prefill and Decode for Concurrent Requests
- The Hugging Face source says: The time to first token is given by the latency of the prefill phase, while the time per output token is the latency of a single decode step. Prefill and Decode for Concurrent Requests