vLLM、長文コンテキスト処理向け効率的なデコード・コンテキスト並列化を公開
本文の状態
日本語全文を表示中
詳細モードで約16分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
vLLM Blog
vLLM は、長文コンテキスト処理における KV キャッシュの重複問題を解消する「Decode Context Parallelism」機能の重要性を強調し、その最新改善点と性能向上結果を発表した。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るAI深層分析を開く2026年8月8日 05:32
AI深層分析
キーポイント
KV キャッシュのボトルネック解消
従来のテンソル並列化では GQA や MLA モデルにおいて KV キャッシュが GPU 間で重複し、メモリ効率が悪化する問題を、コンテキストを分割して保存する DCP で解決する。
性能向上とスケーラビリティ
DCP を導入することで GPU メモリに余裕が生まれ、バッチサイズを拡大して同時処理可能なリクエスト数が増加し、トークンあたりのコスト削減につながる。
アジェント AI への対応
コードレポジトリや長いチャット履歴を推論対象とするアジェント AI の台頭により、64K から 1M トークン規模のコンテキスト処理が必須となり、DCP の重要性が高まっている。
DCPによるメモリ効率の向上
DCPはシーケンス次元でKVキャッシュをシャードするため、各GPUがリクエストごとのKVの1/Nのみを保持し、メモリ使用率を抑えながら高並行性を維持できる。
長文コンテキストでのスケーラビリティ
従来のTP方式は64の同時実行でメモリが限界に達するが、DCPは512の同時実行でも82%のKV使用率で動作し、GPUあたりのスループットを大幅に向上させる。
重要な引用
Under a baseline tensor-parallel (TP) setup, this KV cache is partitioned by attention head, which puts a hard floor on how much it can shrink.
Decode Context Parallelism addresses this by splitting KV cache across the GPUs so each GPU stores and reads only part of the KV cache.
This frees up GPU memory, allowing each GPU to take on more requests and thus run at a larger batch size.
The core value of DCP is that it sustains far higher concurrency, even on long-context runs, precisely the regime where replicated-KV TP runs out of memory first.
編集コメントを表示
編集コメント
vLLM は長年この機能をサポートしてきたが、アジェント AI の普及に伴いその価値が再評価されている。技術的な改善点の明確化は、大規模コンテキストを扱うシステムの構築において重要な指針となる。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
1. イントロダクション
エージェント型 AI において、長文コンテキストの推論はもはや必須となっています。アシスタントが膨大なコードリポジトリや長いチャット履歴を根拠に推論を行う必要があるためです。現在、エージェントのトレースベンチマークでは 64K トークンから 1M トークンまで処理され、それに伴い KV キャッシュ(Key-Value Cache)も巨大化しています。
従来のテンソル並列(TP: Tensor Parallelism)設定では、この KV キャッシュはアテンションヘッド単位で分割されます。しかし、これには物理的な下限があり、キャッシュをさらに小さくすることができません。
現代のモデルが採用する 2 つのアテンション方式はいずれも、この壁に直面しています。グループ化クエリアテンション(GQA: Grouped-Query Attention)モデルでは KV ヘッドの数が少ないため、TP で分割できるのは GPU あたり 1 ヘッドまでです。TP の規模が KV ヘッド数を超えると、キャッシュは GPU 間で重複し始めます。
マルチヘッドラテントアテンション(MLA: Multi-Head Latent Attention)モデルでは状況はさらに悪化します。MLA は Key/Value をすべてのクエリヘッドで共有される単一の低ランクの「ラテント」ベクトルに圧縮するため、実質的に KV ヘッドは 1 つしかありません。通常の TP では分割対象となるヘッドが存在しないため、ラテントな KV キャッシュは TP ランクごとに完全に複製されてしまいます。
どちらの場合も、重複した KV キャッシュが GPU メモリを圧迫し、追加のリクエストを受け付ける余地がほとんどなくなります。その結果、システムが同時に処理できるリクエスト数が制限され、スループットが低下、トークンあたりのコストが増大するという悪循環に陥ります。
デコード・コンテキスト並列化(Decode Context Parallelism)は、KV キャッシュを複数の GPU に分割して配置することで実現されます。これにより、各 GPU は KV キャッシュの一部のみを保存・参照すればよくなり、GPU メモリの圧迫が解消されます。その結果、1 台の GPU で処理できるリクエスト数を増やし、バッチサイズを拡大することが可能になります。特に GPU 間接続帯域幅が高いシステムでは、多数の長文コンテキストを持つエージェントを同時にサービスしながらも、対話的な応答性を維持できます。
vLLM は約 1 年前から DCP(Decode Context Parallelism)をサポートしていますが、本ブログ記事で改めてこの機能を紹介するのは、長文コンテキストを活用したエージェントユースケースの台頭により、その利点がこれまで以上に重要になっているからです。また、これまでに実施してきた改善点や技術的進展についても併せて解説します。
2. パフォーマンス結果
デコード・コンテキスト並列化の効果を定量的に評価するため、モデル・ハードウェア・ワークロードを同一に保ちつつ、デコード時の KV キャッシュの分割方法のみを変えて、テンソル並列化によるベースライン環境と DCP 環境を比較しました。


2.1 データセット
本データセットは、Mooncake 形式の公開エージェント用長文コンテキストトレースであり、こちらで公開されています。
データセットの詳細については、こちらをご覧ください。このデータセットは JSONL 形式で提供されており、各行が input_length、output_length、hash_ids の各フィールドを持つ単一のリクエストとして構成されています。そのため、Mooncake に互換性のあるハーン(例:)を用いてそのまま再生することが可能です。
aiperf --custom-dataset-type mooncake_trace を実行する。
hash_ids フィールドは共有プレフィックスブロックを符号化しており、KV キャッシュの再利用やプレフィックスキャッシングの動作をベンチマークする際に適しています。
これは、長い入力と短い生成を組み合わせたエージェント型マルチターンワークロードです。現実的な長期ホライズンのエージェント行動を反映させるために設計されました。入力の中央値は約 67k トークンで、出力は約 400 トークンの短めですが、入力分布は一様に巨大なわけではなく二峰性です。およそ半数の要求が 64k トークン以上(約 53%)に位置し、そのうち重いテール部分では約 1M トークンに達するものもあります。残りの半分は短めから中程度の長さで(約 47% が 64k 未満)、さらにそのうちの約 18% は 8k トークン未満です。全体の約 8% の要求が 128k を超え、約 3〜4% は 256k を超えています。
2.2 Decode Context Parallelism の利点
vLLM を用いて、Kimi K2.6 を NVFP4 で動作させる 8×B200 ノード単体で実験を行いました。リクエストの並行数を 16 から 512 まで変化させた結果(下表参照)、DCP ははるかに高い並行性を維持し、スループットと応答性のトレードオフ曲線全体において、GPU あたりのスループットを劇的に向上させました。

この差は KV キャッシュの配置場所の違いに起因します。ベースラインとなる TP(Tensor Parallelism)では、KV キャッシュがすべての GPU に複製されるため、メモリ使用量がすぐに上限に達してしまいます。並行数 64 でメモリ使用率が 100% に達し、それ以上リクエストを追加できなくなるため、スループットは約 1,863 tok/s/GPU で頭打ちになります。一方、DCP は KV キャッシュをシーケンス次元でシャード化するため、各 GPU はすべてのリクエストの KV のうち 1/N 分しか保持しません。これにより、GPU メモリの空き領域を活用して、より多くの新規リクエストを受け付けることが可能になります。その結果、TP が壁にぶつかるような高い並行数においても、DCP はスケーリングを継続できます。並行数 c512 の場合でも、DCP は 6,091 tok/s/GPU を達成しながら KV 使用率はわずか 82% に抑えられています。DCP の核心的な価値は、長文コンテキスト処理のようなリソース制約が厳しい領域において、複製された KV を持つ TP がまずメモリ不足に陥る状況でも、高い並行性を維持し続ける点にあります。
2.3 シーケンス長による比較

また、フルシーケンス長(入力+出力)に対する性能もプロットしました。この図は、リクエストを5 つの長さ帯域(<32k、32–64k、64–128k、128–200k、および 200k+)にグループ化して描画した、スループットと応答性のパレートフロンティアを示しています。これにより、コンテキスト長の変化に伴う性能の推移を把握できます。DCP は 200k+ の領域においても高い安定したフロンティアを維持しており、短帯域と長帯域の曲線はほぼ重なっています。スループットは並行処理量に応じて拡大しますが、ユーザーあたりの速度も、レプリケートされた KV ベースラインがメモリ不足でスケールできなくなるような長いコンテキスト長において十分に実用的です。
3. Long Context のサービングにおける課題
テンソル並列化では、KV キャッシュはアテンションヘッド単位で分割されます。各 KV ヘッドは独立した K と V テンサを保持しており、GPU に割り当てられる最小単位がヘッドとなります。標準的な TP には、単一のヘッドの KV キャッシュをさらに細かくスライスする仕組みがありません。つまり、K 個の KV ヘッドがある場合、各 GPU にそれらの異なるサブセットを割り当てることはできますが、すべての GPU が少なくとも 1 つのヘッドを持つまでしかできません。TP の規模が K を超えると、十分な数の独立したヘッドが残らないため、複数の GPU が同じヘッドの KV キャッシュのコピーを保持することになり、それぞれが固有のスライスを受け持つことができません。
4. DCP とは
純粋な TP(Tensor Parallelism)手法とは異なり、DCP(Decode Context Parallelism)は KV キャッシュをシーケンス(コンテキスト)次元に沿って複数の GPU に分割できます。各 GPU は、同じシーケンス内のトークン位置の断片に対する KV キャッシュを担当します。
例えば、200K トークンのリクエスト 1 つに対して、GPU 0 がトークン 0–50K のキャッシュを保持し、GPU 1 が 50K–100K、GPU 2 が 100K–150K、GPU 3 が 150K–200K を担当するとします。KV キャッシュをシャード化することで、GPU 数を増やすほど各 GPU の KV キャッシュ使用量は縮小し、メモリに余裕が生まれます。これによりバッチサイズを引き上げたり、より高い同時接続数に対応したりすることが可能になります。

4.1 Decode Context Parallelism Process
標準的な Decode Context Parallelism は、通信パターンをシンプルに保ちます。そのリズムは AllGather Q → Compute → AllGather + ReduceScatter です。
- AllGather Q: 各 GPU はクエリの一部しか計算していませんが、アテンションでは任意のキーに対してスコアリングするために完全なクエリベクトルが必要です。DCP グループ全体で AllGather を実行することで、すべての GPU にクエリの完全なコピーが集約されます。デコードフェーズではクエリが 1 トークンだけであるため、この処理は軽量です。
MLA(Multi-Head Latent Attention)向けのオプションとして、vLLM #45964 では、DCP グループ内でクエリ投影をロード時に複製する設定も用意されています。これによりデコード時にクエリの AllGather を完全にスキップできます(VLLM_DCP_Q_REPLICATE=1)。
- 計算リソース: 各 GPU は、集約されたクエリと、その GPU が保持する KV キャッシュのローカル断片との間でアテンション演算を実行します。vLLM では、MLA の場合は
k_up、GQA の場合はtensor_broadcastが該当します。
AllGather と ReduceScatter を組み合わせた手法(cp_lse_ag_out_rs)では、各 GPU が生成した部分的な結果を統合して最終的な出力を得ます。具体的には、AllGather によって全 GPU の部分出力と LSE(Log-Sum-Exp)値が共有され、LSE 値を用いて重み付けを行いながら部分結果を結合します。これはオンライン・ソフトマックスのトリックと呼ばれる手法です。その後、ReduceScatter が加算処理を行い、各 GPU に割り当てられたヘッドのスライスだけを返却します。
5. vLLM の使い方
DCP は、既存のテンソル並列設定に decode_context_parallel_size という追加引数を一つ加えるだけで有効化できます。
5.1 オフライン処理
from vllm import LLM, SamplingParams
prompts = [
"The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(
model="deepseek-ai/DeepSeek-V2-Lite",
tensor_parallel_size=2,
decode_context_parallel_size=2,
)
outputs = llm.generate(prompts, sampling_params)5.2 Online
vllm serve deepseek-ai/DeepSeek-V2-Lite \
--tensor-parallel-size 2 \
--decode-context-parallel-size 25.3 MLA Backend
対象モデル: Multi-head Latent Attention(MLA)を採用した DeepSeek-V2/V3/R1、Kimi K2.6 モデル。
なぜこれが異なるのか。
MLA では、すべてのクエリヘッドで共有される単一の低ランクの潜在ベクトルへ Key/Value を圧縮します。これは実質的に 1 つの KV「ヘッド」を意味します。純粋なテンソル並列化(TP)の下では、ヘッド単位で分割する余地がないため、この潜在的な KV キャッシュはすべての TP ランクに完全に複製されます。TP はキャッシュサイズを縮小しないため、MLA は DCP(Decode Context Parallelism)の理想的な候補となります。キャッシュ全体が冗長である以上、シーケンス単位で分割して処理できるからです。
仕組みの概要。 DCP は、潜在 KV キャッシュをシーケンス次元に沿って分割します。これにより、各ランクは潜在的なキャッシュの一部のみを保持し、アテンション実行時には各ランクが自身の潜在スライスをアップ投影(k_up ステップ)して必要な Keys/Values を再構築します。有効な KV ヘッド数が 1 つであるため、シーケンス分割は TP デグリー全体まで可能となります。この特性から、以下の制約条件が生じます。
tensor_parallel_size >= decode_context_parallel_size
tensor_parallel_size % decode_context_parallel_size == 0
vllm serve deepseek-ai/DeepSeek-R1 \
--tensor-parallel-size 8 \
--decode-context-parallel-size 85.4 GQA バックエンド
対象モデル例: Qwen3-235B およびその他のグループ化クエリアテンション(GQA)モデル(Llama ファミリなど)。
なぜ異なるのか。 GQA は num_key_value_heads 個の KV ヘッドを保存し、TP(テンソル並列化)はまずこれらのヘッド単位で KV キャッシュを分割します。これは num_key_value_heads までであればきれいに機能しますが、tensor_parallel_size が
これを上回ると、KV キャッシュの複製が始まり、ランク間で tp // num_key_value_heads 個の同一コピーが生成されます。
彼らが何をしているか。 DCP は、重複するコピーとなるはずの部分を、異なるシーケンスチャンクで埋め替えます。その際、共有された KV ヘッドはクエリヘッド全体にブロードキャストされます(「GQA 向けのテンソルブロードキャスト」ステップ)。これにより、シーケンス分割の度合いは重複係数 tp // num_key_value_heads によって制限されます:
(tensor_parallel_size // num_key_value_heads) >= decode_context_parallel_size
・(tensor_parallel_size // num_key_value_heads) % decode_context_parallel_size == 0
# Qwen3-235B has num_key_value_heads = 4; tp=8 gives 8//4 = 2 redundant copies,
# so dcp can be up to 2.
vllm serve Qwen/Qwen3-235B-A22B \
--tensor-parallel-size 8 \
--decode-context-parallel-size 26. 今後の課題
今後、DCP は複数の方向へ拡張していく予定です。TP と DCP の両方において、より細粒度な並列化サイズに対応することで、ユーザーが並列化構成をより精密に制御できるようになり、過剰なシャード割り当てによって失われた効率性を回復できます。
また、コンテキスト長やデバイス数が増大する環境でも、マルチノードおよびシングルノード設定向けの DCP 用 A2A(All-to-All)通信カーネルを開発中であり、露出される通信量を削減し、計算処理とのオーバーラップを改善します。
さらに、DCP が推測的デコーディングのレイテンシメリットを損なうことなく効率性を発揮できるよう、MTP や推測的デコーディングへの対応強化を進めています。また、プリフィル/デコード(P/D)ディスアグリゲーションサポートの堅牢化も進め、分散型サービス環境でも DCP が安定して動作できるようにします。
最後に、より多様なバックエンドへの対応拡大や、ハイブリッドモデルおよび Dynamic Chunked Pipeline Parallelism との統合を通じて、DCP の適用範囲を広げます。これにより、幅広いワークロードがコンテキスト並列化による効率向上の恩恵を受けられるようになります。
コミュニティでは、DCP を GLM-5.2 や Kimi K3 といった他のモデルにも拡張する取り組みが進んでいます。また、Prefill Context Parallelism(PCP)に向けたより長期的なロードマップも用意されています。現在、Kimi K3 モデルにおける DCP のパフォーマンスベンチマークを実施中で、研究がまとまり次第、その結果を共有する予定です。
DCP に関するデプロイガイドや歴史的な背景については、vLLM Decode Context Parallel ドキュメント をご覧ください。
7. 結論
Decode Context Parallelism(DCP)は、長文コンテキスト推論における GPU の構成方法を根本から再考した技術です。GPU に KV キャッシュの複製を強要したり、稼働率の低い状態に放置させたりするのではなく、DCP はすべての GPU を有効活用します。アテンション処理時にシーケンスを分割(シャード)し、その直後に同じ GPU 群を再構成して、FFN の重み読み込みをフルプール全体で分散・効率化します。
これにより、コンテキスト長が伸びても性能が劣化するのではなく、滑らかにスケールするシステムを実現しています。
vLLM にはネイティブサポートが実装されており、ドキュメント推論からマルチセッション型エージェントパイプラインに至るまで、次世代の長文コンテキスト対応エージェントアプリケーションを、プロダクションレベルのスループットとレイテンシで支える Decode Context Parallelism が利用可能です。これは、TensorRT-LLM において NVIDIA も Helix Parallelism という形で取り組んでいる方向性を含む、業界全体の Decode Context Parallelism への動きの一環です。
また、Kimi K3 モデルにおける DCP のパフォーマンスベンチマークも実施中で、研究がまとまり次第、その結果を共有する予定です。
本稿の作成にあたり、NVIDIA チームの Anahita Bhiwandiwalla 氏、Xin Li 氏、Pavani Majety 氏、Nidhi Bhatia 氏、Roman Ageev 氏、Pen Chung Li 氏、Chris Hoge 氏には、調査を通じてレビューやベンチマーク支援、エンジニアリング面での貴重なご協力をいただきました。また、Moonshot AI 社には、vLLM #23734 で初期の Decode Context Parallel(DCP)機能が統合されたことへの感謝を申し上げます。さらに、Lucas Wilkinson 氏には、DCP の堅牢化と機能拡張に大きく貢献いただいたことに謝意を表します。オープンソースエンジンとしての vLLM と継続的な協力体制が今回のベンチマークを可能にしたため、広範な vLLM コミュニティにも感謝いたします。
DCP のデプロイや関連する経緯については、vLLM Decode Context Parallel ドキュメントをご覧ください。
本記事で報告している DCP の結果は、NVIDIA B200 GPU 上で Kimi K2.6(NVFP4)を用いて測定したものです。--decode-context-parallel-size パラメータに対応する最新の vLLM リリースを使用すれば、これらの実験を再現可能です。
現在、Kimi K3 モデルにおける DCP の性能ベンチマークも進行中であり、調査がまとまり次第、その結果を発表する予定です。
原文を表示
1. Introduction
Long-context inference is becoming essential for agentic AI, where assistants may need to reason over large code repositories and long chat histories. Agent-trace benchmarks now run from 64K all the way to 1M tokens and their KV caches are correspondingly large. Under a baseline tensor-parallel (TP) setup, this KV cache is partitioned by attention head, which puts a hard floor on how much it can shrink.
Modern models use one of two attention schemes, and both hit this floor. Grouped-query attention (GQA) models store a small number of KV heads, and TP can only split the KV cache down to one head per GPU; once TP exceeds the number of KV heads, the cache starts duplicating across GPUs. Multi-head latent attention (MLA) models make this even worse: MLA compresses the Key/Value into a single low-rank *latent* vector shared across all query heads, so it effectively has only one KV head. Under normal TP there is nothing to split by head, meaning the latent KV cache is replicated in full across *every* TP rank. In both cases the duplicated KV cache eats into GPU memory, leaving very little room to serve additional requests. This caps the number of concurrent requests the system can handle, driving down throughput and pushing up cost per token.
Decode Context Parallelism addresses this by splitting KV cache across the GPUs so each GPU stores and reads only part of the KV cache. This frees up GPU memory, allowing each GPU to take on more requests and thus run at a larger batch size. On systems with high-bandwidth GPU-to-GPU interconnects, this helps preserve interactive responsiveness while serving many long-context agents at once.
vLLM has supported DCP for almost a year, but we are writing this blog now to highlight the feature, along with the recent improvements and advancements we have made to it, because the rise of long-context agentic use cases has made its benefits more relevant than ever.
2. Performance Results
To quantify the benefit of Decode Context Parallelism, we compared a baseline tensor-parallel deployment against DCP on an identical set of GPUs, holding the model, hardware, and workload fixed and varying only how the KV cache is sharded during decode.


2.1 Dataset
The dataset is a publicly available agentic long-context trace in Mooncake trace format, published here. See this section for more details on the dataset. It ships as JSONL where each line is a single request with input_length, output_length, and hash_ids fields, so it can be replayed directly with any Mooncake-compatible harness (e.g. aiperf --custom-dataset-type mooncake_trace). The hash_ids field encodes shared prefix blocks, making it well-suited for benchmarking KV-cache reuse and prefix-caching behavior.
It's an agentic multi-turn workload of long inputs paired with short generations, chosen to reflect realistic long-horizon agent behavior. Inputs are centered around a median of ~67k tokens and paired with short ~400-token outputs, but the input distribution is bimodal rather than uniformly huge: roughly half the requests sit at 64k+ (≈53%, with a heavy tail reaching ~1M tokens) and half are short-to-mid (≈47% under 64k, ~18% under 8k). About 8% of requests exceed 128k and ~3–4% exceed 256k.
2.2 Benefits of Decode Context Parallelism
We ran an experiment on a single 8×B200 node serving Kimi K2.6 in NVFP4 with vLLM, sweeping request concurrency from 16 to 512 (see table below). DCP sustains far higher concurrency and delivers markedly higher throughput per GPU across the entire throughput–interactivity Pareto frontier.

The difference comes down to where the KV cache lives. Baseline TP replicates the KV cache on every GPU, so peak memory fills quickly. It reaches 100% at a concurrency of 64 and hits a wall, and throughput plateaus near 1,863 tok/s/GPU because no additional requests can fit. On the other hand, DCP shards the KV cache along the sequence dimension, so each GPU stores only 1/N of every request's KV. This allows space on the GPU to support more incoming requests. As a result, even at high concurrencies DCP keeps scaling where TP hits a wall. DCP reaches 6,091 tok/s/GPU at c512 while still sitting at just 82% KV usage. The core value of DCP is that it sustains far higher concurrency, even on long-context runs, precisely the regime where replicated-KV TP runs out of memory first.
2.3 Comparison by Sequence Length

We also plotted performance against full sequence length (input + output). The figure shows a single throughput–interactivity Pareto frontier with requests grouped into five length bands (<32k, 32–64k, 64–128k, 128–200k, and 200k+) so we can see how performance shifts with context length. DCP keeps a high, stable frontier even in the 200k+ range, with the curves for short and long buckets nearly overlapping: throughput scales with concurrency while per-user speed stays usable at the long context lengths where the replicated-KV baseline runs out of memory and cannot scale.
3. Challenges of Serving Long Contexts
Under tensor parallelism, the KV cache is partitioned by the attention head. Each KV head owns its own separate K and V tensors, and the head is the smallest unit you can hand to a GPU. A standard TP has no mechanism to slice a single head's KV cache. So if you have K KV heads, you can give each GPU a distinct subset of those heads, but only down to the point where every GPU holds one head. Once TP goes beyond K, there aren't enough distinct heads to go around, so two or more GPUs end up holding a copy of the same head's KV cache instead of a unique slice.
4. What is DCP?
Unlike pure TP methods, DCP is able to split KV cache across GPUs by sequence (context) dimension. Each GPU is made responsible for the KV cache of a chunk of *token positions* from the same sequence. For a single 200K-token request, GPU 0 might hold the cache for tokens 0–50K, GPU 1 for tokens 50K–100K, GPU 2 for 100K–150K, and GPU 3 for 150K–200K. By sharding KV cache, the KV cache footprint per GPU keeps shrinking as you add GPUs, freeing the memory that lets you raise the batch size and serve higher concurrencies.

4.1 Decode Context Parallelism Process
Standard Decode Context Parallelism keeps the communication pattern simple, following the rhythm AllGather Q → Compute → AllGather + ReduceScatter.
- AllGather Q: Each GPU has computed only a fragment of the query, but attention requires the full query vector to score against any key. An all-gather across the DCP group assembles a complete copy of the query on every GPU. This is cheap during decode because the query is a single token. As an opt-in alternative for MLA, vLLM #45964 can replicate the (small) query projection within each DCP group at load time so decode skips this query all-gather entirely (VLLM_DCP_Q_REPLICATE=1).
- Compute: Each GPU runs attention between the gathered query and its local slice of the KV cache. In vLLM this is k_up for MLA or tensor_broadcast for GQA.
- AllGather + ReduceScatter (cp_lse_ag_out_rs): The partial results are combined into the true output. AllGather shares each GPU's partial output and LSE; the LSE values reweight and merge the partials (the online-softmax trick), and ReduceScatter sums them while handing each GPU back only its own head-slice.
5. vLLM Usage
DCP is enabled with a single extra argument, decode_context_parallel_size, alongside your existing tensor-parallel setting.
5.1 Offline
from vllm import LLM, SamplingParams
prompts = [
"The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(
model="deepseek-ai/DeepSeek-V2-Lite",
tensor_parallel_size=2,
decode_context_parallel_size=2,
)
outputs = llm.generate(prompts, sampling_params)5.2 Online
vllm serve deepseek-ai/DeepSeek-V2-Lite \
--tensor-parallel-size 2 \
--decode-context-parallel-size 25.3 MLA Backend
Models: DeepSeek-V2 / V3 / R1, Kimi K2.6 models using Multi-head Latent Attention.
Why it's different. MLA compresses the Key/Value into a single low-rank *latent* vector that is shared across all query heads — effectively one KV "head." Under pure tensor parallelism there's nothing to split by head, so that latent KV cache is replicated in full on *every* TP rank. TP does nothing to shrink it, which makes MLA the ideal candidate for DCP: the whole cache is redundant, so the whole cache can be sequence-split.
What they do. DCP splits the latent KV cache along the sequence dimension, so each rank stores only its chunk of the latent; at attention time each rank up-projects its latent slice (the k_up step) to reconstruct the Keys/Values it needs. Because the effective KV-head count is 1, the sequence can be split up to the full TP degree — hence the constraints:
- tensor_parallel_size >= decode_context_parallel_size
- tensor_parallel_size % decode_context_parallel_size == 0
vllm serve deepseek-ai/DeepSeek-R1 \
--tensor-parallel-size 8 \
--decode-context-parallel-size 85.4 GQA Backend
Example models: Qwen3-235B, and other Grouped-Query-Attention models (Llama-family, etc.).
Why it's different. GQA stores num_key_value_heads KV heads, and TP splits the KV cache by those heads first. That works cleanly only up to num_key_value_heads; once tensor_parallel_size exceeds it, the KV cache begins duplicating, with tp // num_key_value_heads identical copies across ranks.
What they do. DCP takes those would-be-duplicate copies and fills them with *different* sequence chunks instead, while the shared KV heads are broadcast across their query heads (the "tensor broadcast for GQA" step). So the sequence-split degree is capped by the duplication factor tp // num_key_value_heads:
- (tensor_parallel_size // num_key_value_heads) >= decode_context_parallel_size
- (tensor_parallel_size // num_key_value_heads) % decode_context_parallel_size == 0
# Qwen3-235B has num_key_value_heads = 4; tp=8 gives 8//4 = 2 redundant copies,
# so dcp can be up to 2.
vllm serve Qwen/Qwen3-235B-A22B \
--tensor-parallel-size 8 \
--decode-context-parallel-size 26. Future Work
Looking ahead, we plan to extend DCP along several main directions. We will add support for finer-grained parallelism sizes for both TP and DCP, giving users more precise control over their parallelism layout and reclaiming efficiency lost to over-provisioned sharding. We are also developing better DCP all-to-all (A2A) communication kernels for both multinode and single-node settings, reducing exposed communication and improving overlap with compute as context length and device count grow. We are working on better support for MTP and speculative decoding, so that DCP can deliver its efficiency gains without sacrificing the latency benefits of speculative methods, as well as hardening prefill/decode (P/D) disaggregation support to make DCP robust in disaggregated serving deployments. Finally, we aim to broaden DCP's reach by extending support to a wider variety of backends and integrating it with hybrid models and Dynamic Chunked Pipeline Parallelism, so a much wider range of workloads can benefit from context-parallel efficiency gains.
The community is also expanding DCP to additional models such as GLM-5.2 and Kimi K3, and there is a longer roadmap for Prefill Context Parallelism (PCP). We are working on DCP performance benchmarking for the Kimi K3 model and plan to share those results as that work matures. For deployment guidance and historical notes on DCP, see the vLLM Decode Context Parallel docs.
7. Conclusion
Decode Context Parallelism represents a fundamental rethinking of how GPUs are organized for long-context inference. Rather than forcing GPUs to duplicate KV cache or sit underutilized, DCP puts every GPU to work: sharding the sequence during attention, then immediately reconfiguring those same GPUs to amortize FFN weight loading across the full pool. The result is a system that scales gracefully with context length rather than degrading under it.
With native support in vLLM, Decode Context Parallelism is ready to power the next generation of long-context agentic applications, from document reasoning to multi-session agentic pipelines, at the throughput and latency that production demands. It joins a broader industry move toward Decode Context Parallelism, a direction NVIDIA has also pursued with Helix Parallelism in TensorRT-LLM. We are also working on DCP performance benchmarking for the Kimi K3 model and plan to share those results as that work matures.
About Us
Special thanks to the NVIDIA team Anahita Bhiwandiwalla, Xin Li, Pavani Majety, Nidhi Bhatia, Roman Ageev, Pen Chung Li, and Chris Hoge for their reviews, benchmarking support, and engineering input throughout this study. We also thank Moonshot AI for the initial Decode Context Parallel work upstreamed in vLLM #23734, and Lucas Wilkinson for substantial follow-up contributions that helped harden and extend DCP. We also thank the broader vLLM community, whose open-source engine and continued collaboration made this benchmarking effort possible. For more on DCP deployment and related history, see the vLLM Decode Context Parallel docs.
The DCP results in this post were measured on NVIDIA B200 GPUs with Kimi K2.6 in NVFP4, and the recipes can be reproduced with current vLLM releases that support --decode-context-parallel-size. We are also working on DCP performance benchmarking for the Kimi K3 model and plan to share those results as that work matures.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み