Appendices

Basic Concepts

Table 1 Basic Concepts

ConceptMeaning
Prefill PhaseAlso called the Prompt or full-inference phase. Performs the first inference on the user's input, using the complete input sequence.
Decode PhaseAlso called incremental inference. Iteratively infers from the Prefill output. Each iteration takes the previous inference output as input, hence incremental inference.
PD DisaggregationExecuting the Prefill and Decode phases separately.
KV CacheKV Cache caches previously computed Key and Value tensors in large language models, avoiding recomputation of the entire context at each generation step. Here, it refers to the computed Key and Value cache.
PagedAttentionAbbreviated PA. Manages request KV Cache using discrete blocks, reducing KV Cache memory usage compared with frameworks without this feature.
block_tableIn PA scenarios, the set of block indices occupied by a request's KV Cache.
RequestA user question processed through Prefill and Decode to produce an answer. This complete process is a request.
roleLLM-DataDist application role: Prefill or Decoder.
cluster_idCluster identifier of LLM-DataDist. Decode primarily uses cluster_id to locate the connection and the corresponding request's KV Cache on Prefill. When model partitions are deployed on different Devices, supported symmetric PD partitioning uses the same cluster_id across model partitions.
Dynamic Cluster ScalingDynamically adjusts cluster count and the PD cluster ratio based on workload, saving resources at low load and increasing throughput at high load.
D2D TransferTransfers data from Device to Device.
D2H TransferTransfers data from Device to Host.
H2D TransferTransfers data from Host to Device.
D2RHTransfers data from Device to remote Host.
RH2DTransfers data from remote Host to Device.
TTFTTime To First Token, an LLM inference metric measuring latency from input to the first output token. For a batch of users entering the system, it is the time to complete Prefill and produce the first character.
TBTTime Between Tokens, the duration of each decoding step. Measures the interval between generated characters during online processing, reflecting generation smoothness.
Continuous BatchingContinuous batching improves large-model inference efficiency by grouping multiple requests into a batch, increasing inference speed and throughput. It minimizes idle time to maximize computing resource utilization.
One-Sided Connection EstablishmentThe Client initiates a connection to the Server.
Two-Sided Connection EstablishmentAll LLM-DataDist instances may initiate connections simultaneously.

Overview of Large-Model Inference

ChatGPT marked the maturation of interactive AI into commercial products and further advanced research on large language models (LLMs). Common LLMs include GPT, LLAMA, and GLM families, whose underlying architectures all use Transformer, primarily in decoder-only form. During inference, these models use autoregressive generation (AR): each token requires an LLM forward pass with N Transformer Layer computations. Generating a sequence of M tokens therefore requires M complete LLM forward passes.

KV Cache reduces Decode computation during Transformer inference and has become essential to LLM inference systems. KV Cache-based inference typically comprises Prefill and Decode phases.

  • Prefill: Feeds the user's Prompt into the large model for computation, writes intermediate results to KV Cache, and generates the 1st token. As the Prompt Sequence Length grows linearly, applications with time to first token (TTFT) requirements typically use a single batch for LLM inference. This phase is compute-intensive.
  • Decode: Feeds the previous token into the model and reads the previously generated KV Cache from device memory. With KV Cache, per-token computation is low and parameter transfer is the main bottleneck, so multiple batches typically improve utilization. This phase is memory-intensive.

Why Use PD Disaggregation?

From an implementation perspective, LLM inference consists of Prefill and repeated Decode iterations. Continuous batching in Decode requires spare compute to complete Prefill for each scheduled request. With colocated Prefill and Decode, new Prefill requests receive priority, making Decode time between tokens (TBT) difficult to guarantee. For example, in the following figure, when request5 or request6 arrives, the system may prioritize that request's Prefill, affecting request2/3/4 response latency and destabilizing TBT.

In actual deep learning model deployment, PD disaggregation deploys Prefill and Decode on clusters with different specifications and architectures because of their different computation and communication characteristics, improving performance and resource utilization. Together with service-level task scheduling, continuous batching maximizes Decode batch concurrency and compute utilization while meeting TTFT and TBT requirements.

As shown below, Prefill and Decode execute independently, allowing the system to provide stable TBT.