DeepSeek-V4.1-Flash の H20-3e 上における PD 分離サービス最適化

DeepSeek-V4.1-Flash の H20-3e 上における PD 分離サービス最適化

概要

Ant International AI Infra チームは H20-3e 上で DeepSeek-V4.1-Flash の分離式サービスを最適化した。prefill と decode の並列度の調整、BCG と prefill CP および有界 SWA リプレイのサポート、Indexer カーネルの高速化を通じて、最終的な構成は TP4 比で平均エンドツーエンドレイテンシを 65.5% 削減し、出力スループットを 2.91 倍に向上させた。

ノード内 PD デプロイでは、prefill と decode がそれぞれ 4 枚の GPU を使用し、NVLink を介して KV キャッシュを転送する。平均エンドツーエンドレイテンシは 13.63 秒から 4.70 秒へ、出力スループットは 847 tokens/s から 2,465 tokens/s へと向上した。

Compared with TP4, the final PD configuration has 0.34× mean end-to-end latency, 0.16× mean time to first token, and 2.91× output throughput.

測定設定

ルーターはリクエストをそれぞれ prefill フェーズと decode フェーズに振り分け、ワーカーは Mooncake NVLink を通じて KV 状態を直接転送する。ベースラインは両ワーカーで TP4 アテンションと EP4 MoE を実行し、prefill スコアリングには eager BF16 Torch を使用する。

1. Prefill CP と Decode DP

Prefill にはインターリーブドコンテキスト並列(Interleaved CP4)を、decode にはデータ並列(DP4)アテンションおよび LM ヘッドを採用する。このステップにより、平均 TTFT は 12.04 秒から 5.16 秒に短縮された。

2. Prefill Indexer への FP8 DeepGEMM 適用

Indexer はプリフィルフェーズにおいて DeepGEMM の fp8_mqa_logits を使用してスコアリングを行い、キーと値は FP4 スケーリングおよびクランピングを経て E4M3 に変換される。

Torch scores in BF16; DeepGEMM scores in E4M3 after scaling and clamping the FP4 keys

3. Prefill への Breakable CUDA Graphs 適用

Breakable CUDA Graphs によってグラフの安全なセグメントをキャプチャしてリプレイし、有界 SWA リプレイと組み合わせることで、小カーネル起動のオーバーヘッドを削減する。

Triton reduces the work for candidate publishing and fuses KV-slot writeback into one launch

4. Tensor-Parallel MoE

TP MoE を採用してエキスパートを全ランクにシャーディングし、EP 下でのエキスパート負荷不均衡を回避する。

Verify queries switch from one load and dequantization each to one shared BF16 key tile

Prefill タイムラインの比較では TP モードがより高速であることが示された。

Both colocated configurations split prefill tokens; decode switches from splitting heads to splitting query rowsExpert-parallel prefill timeline showing 770.7 ms for five requests and 16,119 tokens.Tensor-parallel prefill timeline showing 656.5 ms for five requests and 16,104 tokens.

5〜7. その他の最適化

Indexer スコアタイルの拡大、prefill セレクションとライトバックの融合、ページ化 K タイルの再利用を含むさらなる微調整により、性能を追加改善した。