Encode-Prefill-Decode (EPD) Flow with NIXL
For high-performance multimodal inference with large embeddings, Dynamo supports a specialized Encode-Prefill-Decode (EPD) flow using NIXL (RDMA) for zero-copy tensor transfer.
Use the Latest Release
We recommend using the latest stable release of dynamo to avoid breaking changes:
You can find the latest release here and check out the corresponding branch with:
Multimodal Aggregated Serving
Components
- workers: For aggregated serving, we have two workers, MultimodalEncodeWorkerHandler for encoding and MultimodalWorkerHandler for prefilling and decoding.
- processor: Tokenizes the prompt and passes it to the MultimodalEncodeWorker.
Workflow
The MultimodalEncodeWorker is responsible for encoding the image and passing the embeddings to the MultimodalWorker via a combination of NATS and RDMA. The work complete event is sent via NATS, while the embeddings tensor is transferred via RDMA through the NIXL interface. Its MultimodalWorker then prefills and decodes the prompt, just like the LLM aggregated serving example. By separating the encode from the prefill and decode stages, we can have a more flexible deployment and scale the MultimodalEncodeWorker independently from the prefill and decode workers if needed.
This figure illustrates the workflow:
Client
In another terminal:
You should see a response similar to this:
Multimodal Disaggregated Serving
Components
- workers: For disaggregated serving, we have three workers, MultimodalEncodeWorkerHandler for encoding, MultimodalWorkerHandler for decoding, and MultimodalPrefillWorkerHandler for prefilling.
- processor: Tokenizes the prompt and passes it to the MultimodalEncodeWorker.
Workflow
For the Qwen2.5-VL model, embeddings are only required during the prefill stage. As such, the image embeddings are transferred using a NIXL descriptor from the encode worker to the worker and then passed to the prefill worker for processing. The prefill worker performs the prefilling step and forwards the KV cache to the worker for decoding. For more details on the roles of the prefill and decode workers, refer to the LLM disaggregated serving example.
This figure illustrates the workflow:
Client
In another terminal:
You should see a response similar to this: