In this series / On this page· 15 of 18
Serving in Production
  1. 1. Disaggregated Serving: Dynamo, llm-d, and When Splitting Prefill from Decode Pays
  2. 2. TTFT, ITL, Goodput: Measuring What Users Feel
  3. 3. Benchmark an Inference Server Without Lying to Yourself
  4. 4. Expert Parallelism, and What DeepEP Does for It
  5. 5. Serving Kimi K3.1 Pro: The State per Request, the Indexer's Cost, and Where 1M Tokens Fit
  6. 6. Other Users' Data in the KV Cache: What Cloudflare's GLM-5.3 Incident Teaches Operators
  7. 7. Flow Control in the Serving Stack: What llm-d, Dynamo and AIBrix Do When the Fleet Is Full
  8. 8. Context Parallelism for Long-Context Serving: PCP and DCP in vLLM and SGLang
  9. 9. Several Models, One GPU: Time-Slicing, MPS, MIG, and What CUDA 13.4's Memory Caps Change
  10. 10. Serving Mistral Large 4: What Its Cache Costs and Where It Fits
  11. 11. Prefix-Aware Routing Across Replicas: Kubernetes Service, Dynamo's KV Router, the llm-d EPP and Kinference
  12. 12. Serving Ripple-65B: What a Dense Model with 1M Context Costs, and When It Beats an MoE
  13. 13. Cost per Million Tokens, Computed: GPU-Hours, Utilization, and the Cache
  14. 14. Kinference at alpha.7: What Buoyant's Inference Control Plane Does, and What It Reuses
  15. 15. Splitting Off the Vision Encoder: When Encoder Disaggregation Pays in vLLM
  16. 16. The Cache Hit That Changed the Answer
  17. 17. Prefix Caches That Collapse Under Bursts, and the Session Cap That Prevents It
  18. 18. MLPerf Endpoints v1.0: How to Read an Agentic Inference Benchmark
15 of 18

Splitting Off the Vision Encoder: When Encoder Disaggregation Pays in vLLM

How much of a multimodal request the vision encoder really costs, what vLLM's encoder disaggregation moves and measures, and when a separate encoder tier pays for its GPUs.

11 min readUpdated
Blueprint drawing of a vision encoder lifted out of a serving machine onto its own plate, leaving an empty socket on the machine's deck, with embedding tiles crossing back to it.
The vision encoder moved off the prefill-decode machine onto its own tier, sending only embeddings back.

vLLM's team added four encoder GPUs to an eight-GPU DeepSeek V4.1 Flash deployment serving document questions, and got 6.6 to 9.5% more throughput per GPU at 64 to 128 concurrent requests, with a P90 time to first token 44 to 47% lower. At 16 concurrent requests the split lost on throughput per GPU; at 32 it broke even. Whether a separate encoder tier pays for its GPUs depends on how much of your requests' compute the encoder is, and that you can compute before you buy anything.

Where a multimodal request's compute goes

A request with an image goes through four stages: preprocessing on the CPU (fetch, decode, resize, cut into patches), the vision encoder (a ViT that turns patches into embeddings), the language model's prefill over the text and the image's tokens, and decode. Take Qwen3-VL-8B: the encoder is a 27-layer ViT that cuts the image into 16 x 16-pixel patches, attends over all of an image's patches at once, and merges every 2 x 2 patches into one token for the language model. A 1024 x 1024 photo is 4,096 patches and 1,024 language tokens.

Counting FLOPs from the model's config (encoder_share.py), the encoder costs a fraction of the prefill over the tokens it produces, and that fraction grows with resolution, because the encoder's attention is quadratic in patches:

One image Encoder (TFLOP) Language tokens Prefill of those tokens (TFLOP) Encoder / prefill Encoder share
512 x 512 1.1 256 3.6 0.30 23%
1024 x 1024 5.8 1,024 14.5 0.40 29%
1536 x 1536 18.9 2,304 33.6 0.56 36%
2048 x 2048 48.2 4,096 61.8 0.78 44%

Whole requests dilute it with text, unless the text is cached. A chat turn with one 1-megapixel photo is 23% encoder; five document pages at 1536 x 1536 with a short question are 32%. A screen-reading agent with one 2048 x 1152 screenshot and 6,000 tokens of history is 12% when the history is recomputed, and 30% once the history is in the prefix cache: the cached text costs nothing, but the new screenshot still has to be encoded (screenshots already in the cached history are not encoded again). Encoder and prefill are both compute-bound, so on the same GPU these FLOP shares are a first estimate of time shares, and probably an underestimate: the ViT's 1,152-wide matrix multiplications use the GPU less efficiently than the language model's 4,096-wide ones, and CPU preprocessing is not counted. Decode is not counted here: it is bound by memory bandwidth, and it is the stage that suffers when the encoder shares its GPU.

Two panels: on the left, encoder vs prefill FLOPs for one image at four resolutions, the encoder rising from 0.30 to 0.78 of the prefill; on the right, three whole requests with the history recomputed, the encoder taking 23% of a chat turn, 32% of a five-page document question and 12% of a screenshot agent turnTwo panels: on the left, encoder vs prefill FLOPs for one image at four resolutions, the encoder rising from 0.30 to 0.78 of the prefill; on the right, three whole requests with the history recomputed, the encoder taking 23% of a chat turn, 32% of a five-page document question and 12% of a screenshot agent turn

Why a colocated encoder hurts

In one vLLM instance, the encoder runs inside the scheduler's step, next to prefill chunks and decode tokens. Each step has an encoder budget, by default equal to the step's token budget (max_num_batched_tokens, scheduler.py), and an image is encoded whole in the step whose prefill first reaches its tokens. A step that encodes three 1536 x 1536 pages (6,912 of the OpenAI server's default 8,192-token budget) takes longer for everyone in it, including the requests that are only decoding: that is the mechanism by which their time per output token jumps when images arrive. The other cost is in capacity planning. Encoder demand follows the number and size of images, decode demand follows the length of answers, and in one instance they scale together whether your traffic does or not.

Disaggregation fixes both: encoding moves to its own instances, which you size by images, and the language-model GPUs never stall on a ViT.

What vLLM's EPD moves

E+PD: the router sends the media to an encoder instance, which returns layout metadata; the router forwards the request with that metadata to the prefill-decode instance; the embeddings travel separately through an EC connector (shared storage, Mooncake or NIXL); E/P/D adds a KV transfer between prefill and decodeE+PD: the router sends the media to an encoder instance, which returns layout metadata; the router forwards the request with that metadata to the prefill-decode instance; the embeddings travel separately through an EC connector (shared storage, Mooncake or NIXL); E/P/D adds a KV transfer between prefill and decode

vLLM supports two layouts: E+PD (encoder instances in front of instances that do prefill and decode) and E/P/D (all three separate, with a KV transfer between prefill and decode as in Disaggregated Serving). The encoder's output travels through an EC connector, the encoder-side counterpart of the KV connectors: a shared filesystem for testing (ECExampleConnector), Mooncake's transfer engine over TCP or RDMA, or NIXL between CPU-offloaded buffers. Three of the changes in the 11 November post, mostly in v0.32.0, change what the split costs:

  • Metadata-only requests. The prefill instance needs the image's layout (for Qwen-family models, the patch grid image_grid_thw) to place the image tokens in the prompt. Forwarding the original image made it fetch and preprocess the image again just to get that layout. The encoder now publishes the layout, and the router forwards it instead of the image. On audio (Qwen3-Omni-30B-A3B), throughput went from 62.21 to 73.13 requests per second.
  • An encoder-only runner that skips sampling and loads only the vision weights: on a pruned Kimi-K3 checkpoint, the encoder read 2 of 96 shards and loaded in 0.31 s instead of 683 s.
  • A shared encoder cache in Mooncake Store, so an image already encoded by one encoder instance is not encoded again by another.

The rest is plumbing: transfer buffers sized per modality, a failed transfer that fails its request instead of the engine, and routing in vLLM Router, SMG and llm-d that can spread one request's images over several encoders.

Reading the results

The vLLM team's DeepSeek V4.1 Flash test is the one end-to-end comparison: 512 MP-DocVQA questions, four to six document pages each (4,905 input tokens on average, 5.2 output tokens), on GB200. The baseline used four GPUs for prefill and four for decode; EPD added four single-GPU encoders. The result is reported per GPU, counting all 12 GPUs against 8, so the total is easy to recover: 1.066 to 1.095 times the per-GPU throughput on 1.5 times the GPUs is 1.60 to 1.64 times the baseline's total throughput. Four more GPUs bought about 60% more work, a little more than their 50% share, and a P90 time to first token cut nearly in half. The test ran on vLLM's main branch (5314c58281 plus the DeepSeek metadata-only change, PR #62802), not on a release.

That workload is the encoder's best case: image-heavy prompts and five tokens out. The nearest case in our table is the document question (a quarter to a third of the prompt's compute for Qwen3-VL-8B at that page count); DeepSeek V4.1 Flash's own split will differ. At 16 concurrent requests per-GPU throughput fell below the baseline, probably because the encoders sat partly idle; at 32 it broke even. The other results in the post are component tests. GPU preprocessing and hardware video decoding on the encoder roughly doubled end-to-end throughput on 30-frame videos (until the language-model tier became the bottleneck), a comparison of two media paths inside EPD rather than EPD against colocated serving. The shared encoder cache, in a run where every image was deliberately sent to a different encoder, cut median time to first token from 1.209 to 0.819 s: a best case by construction, as the post says.

Launching E+PD

Two instances of the same model, one producing encoder outputs and one consuming them, plus a proxy that sends each request to both. From vLLM v0.33.0's 1E+1PD example (disagg_1e1pd_example.sh), trimmed, with the example's Qwen2.5-VL-3B swapped for Qwen3-VL-8B:

$ vllm serve Qwen/Qwen3-VL-8B-Instruct --port 19534 \
    --disable-prefix-caching \
    --max-num-batched-tokens 114688 \
    --ec-transfer-config '{"ec_connector": "ECExampleConnector", "ec_role": "ec_producer",
                           "ec_connector_extra_config": {"shared_storage_path": "/mnt/ec"}}'
$ vllm serve Qwen/Qwen3-VL-8B-Instruct --port 19535 \
    --ec-transfer-config '{"ec_connector": "ECExampleConnector", "ec_role": "ec_consumer",
                           "ec_connector_extra_config": {"shared_storage_path": "/mnt/ec"}}'
$ python disagg_epd_proxy.py --port 10001 \
    --encode-servers-urls http://localhost:19534 \
    --decode-servers-urls http://localhost:19535

The encoder gets a 114,688-token step budget so that it can encode many images per step: on an instance that runs nothing else, the budget only limits the ViT.

The shared-storage connector is for validating the handoff on one machine; across nodes, use the Mooncake or NIXL connector and a router that knows both tiers (vLLM Router, SMG, or llm-d's multimodal guide on Kubernetes).

Verdict

Split the encoder off when three things hold together: your requests are image-heavy relative to what they generate (documents, OCR, many or large images, short answers), so the encoder is a quarter or more of the prompt's compute; image load moves independently of text load, so one ratio of GPUs fits neither; and the fleet runs at high concurrency, where the encoder tier stays busy. That is the vLLM team's test case, and it paid about 60% more throughput for 50% more GPUs, plus a halved tail time to first token.

Keep the encoder colocated for chat-style traffic with one modest image and long answers, where the encoder is a quarter of the prompt or less and decode dominates the GPU time, and at low or uneven load, where a separate tier mostly adds a network hop and GPUs that wait. Screen-reading agents are a closer call: with their history cached, the new screenshot is a third of each turn's compute, but one image per turn rarely keeps an encoder tier busy; size it from your turn rate before you split.

What would change the call: higher-resolution inputs (the encoder reaches 0.78 of the prefill at 2048 x 2048), video (frames multiply encoder work and the GPU decoder helps only on the encoder side), or real reuse of the same images across requests, which the shared encoder cache turns into skipped work.

  • Running a document or OCR service at scale: test E+PD with your own page mix; it is the case the design was built for.
  • Running a chat product with images: stay colocated, and cap image resolution before you think about a new tier.
  • Building on llm-d: the tiers are there already (its multimodal serving guide); size the encoder tier from the encoder share above, not by copying a P:D ratio.

Gotchas

Upgrade producers and consumers together. The NIXL EC protocol version changed with the measured output widths, and the vLLM post says producers and consumers must be upgraded together.

Metadata-only requests have no fallback. A consumer that received only the layout cannot encode the image itself, so a lost transfer fails the request. With the original media forwarded, a consumer may be able to encode locally.

Watch accuracy, not only speed. In the audio test, accuracy moved from 75.90% to 75.65% with metadata-only forwarding, and the vLLM team says the difference is still to be investigated. Run your evaluation on both paths before switching.

The shared encoder cache is young. Initial support covers images only, Model Runner V2, encoder TP=1 and no dynamic LoRA, and two cold requests for the same image at the same moment are still both encoded.

--trust-request-mm-kwargs is for trusted clients only. It re-enables per-request mm_processor_kwargs and media_io_kwargs, which change how much preprocessing a request costs. EPD needs it only for Omni videos with an audio track (use_audio_in_video), on both instances; on a public endpoint, keep it off.

For the KV side of the same split, and when separating prefill from decode pays, see Disaggregated Serving; for what a separate tier does to your cost per token, Cost per Million Tokens.

Sources

  1. How an LLM Request Becomes TokensPrefill vs. Decode: Why the Second Token Is a Different Workload
  2. How an LLM Request Becomes TokensFrom Prompt to Token: The Life of an LLM Request
  3. Model LibraryLongCat-2.5 Architecture

Inference Notes

Once a week: what changed in serving AI models, and what it means if you build, run or pay for them, in about five minutes.

Read past issues