Ant International Cuts DeepSeek-V4.1-Flash Latency 65.5% on H20-3e
Summary:Ant International's AI Infra team reports a major serving optimization for DeepSeek-V4.1-Flash on eight NVIDIA H20-3e GPUs, split between four prefill and four decode workers with KV-state transfers over intra-node Mooncake NVLink. Against a TP4 baseline, mean end-to-end latency fell from 13.63 seconds to 4.70 seconds, a 65.5% reduction, while output throughput rose from 847 to 2,465 tokens per second, or 2.91 times. Most of the gain comes from reducing time to first token rather than improving
Final results on eight H20-3e GPUs
Ant International's AI Infra team deployed DeepSeek-V4.1-Flash with disaggregated prefill and decode across eight NVIDIA H20-3e GPUs: four for prefill and four for decode, with KV state transferred directly over intra-node Mooncake NVLink. Compared with the TP4 baseline, the final configuration reduced mean end-to-end latency from 13,633.80 ms to 4,698.65 ms, a 65.5% improvement, while increasing output throughput from 846.76 to 2,464.90 tokens per second, or 2.91 times.
| Metric | TP4 baseline | Final configuration | Change | |---|---:|---:|---:| | Mean end-to-end latency | 13,633.80 ms | 4,698.65 ms | -65.5% | | Output throughput | 846.76 token/s | 2,464.90 token/s | 2.91× | | Mean TTFT | 12,037.73 ms | 1,894.54 ms | about -84.3% | | Mean TPOT | 3.20 ms | 5.62 ms | about +75.6% | | P99 end-to-end latency | 21,306.70 ms | 10,073.00 ms | about -52.7% |
This is not a uniform decoding speedup. With 500 output tokens per request, TTFT dominates the baseline end-to-end time. The final stack removes roughly 10.14 seconds of first-token waiting but adds 2.42 milliseconds to every output token. Long prompts and latency-sensitive first-token use cases therefore benefit strongly, while continuous streaming or short-response workloads may see a less favorable trade-off.
The first major change: different parallelism for prefill and decode
The baseline used TP4 attention and EP4 MoE on both workers, with eager BF16 Torch scoring in the prefill Indexer. The first optimization changed the topology:
- Prefill used interleaved CP4 to distribute token rows from one long request across four GPUs.
- Decode used DP4 attention and a data-parallel LM head to place independent requests on different ranks.
- MoE initially remained on EP4.
Long prefill has many token rows within a single request, whereas decode has many active requests with only a few query rows each. CP splits the former problem, while DP avoids fragmenting the latter. This step alone reduced mean end-to-end latency from 13,633.80 ms to 7,547.46 ms, a 44.64% gain, and increased throughput by 81.62%. It was the largest single contribution.
The change also redistributed queueing pressure. Median prefill queue depth fell from 15 requests at baseline to 9 after CP and DP, then to 4 after DeepGEMM and 3 after breakable graphs, reaching zero with TP MoE. Median decode queue depth remained zero. At fixed concurrency, faster prefill keeps decode busier, while faster decode releases client slots for new prompts. The higher final TPOT is therefore partly a scheduling and queue-placement effect, not evidence that every kernel became slower.
Replacing the FP8 DeepGEMM Indexer scoring path
DeepSeek's Indexer scores visible keys before selecting a small candidate set for attention. On Hopper, the implementation gathers each request's packed FP4 keys once, converts queries and keys to FP8 E4M3, and invokes DeepGEMM's fp8_mqa_logits for multi-query attention scoring in each prefill Indexer layer.
Two numerical details are critical:
- Queries have already been fake-quantized to FP4, so they are cast to E4M3 without applying another scale.
- Keys are multiplied by their FP4 block's power-of-two scale in FP32, clamped to
[-448, 448], and then cast to E4M3. DeepGEMM can consequently use unit key scales.
Power-of-two scaling remains exactly representable, and saturation prevents non-finite values. Nevertheless, FP8 rounding, underflow and saturation can alter the ordering of close keys. A separate probe sampled 64 query rows across eight Indexer layers. None of the 16,774,528 sampled key values required clamping, and the BF16 and DeepGEMM scorers shared 99.08% of the selected top-k entries. That is strong evidence of overall agreement, but the remaining ranking differences still require task-level validation.
In the serving stack, this step reduced mean end-to-end latency from 7,547.46 ms to 5,294.89 ms, a 29.85% improvement, and increased throughput by another 43.11%. Top-k agreement is not a substitute for end-task quality tests, especially for long-context retrieval, precise citation and code-analysis workloads.
Breakable CUDA Graphs for long prefill
Long prefills launch many small kernels, making launch and scheduling overhead more visible. Breakable CUDA Graphs captures graph-safe stretches and replays them together while operations requiring live metadata remain eager. Bounded sliding-window-attention replay runs late layers on the shorter decoder tail and captures the tail in separate graph buckets.
This reduced end-to-end latency to 5,100.87 ms, a further 3.66% gain, while raising throughput by 4.05%. The cost is material: with an 8,192-token capture size and a 262,144-token graph context cap, startup logs reported 14.53—14.59 GB of capture memory per prefill rank and approximately 388 seconds of capture time. The combination also requires an experimental branch.
The original post lists SGLang PR #49066, #40333, #43089 and #36534 as implementation references, but this does not establish that every combination is available in a stable release. Production users should pin a known commit and validate compatibility rather than assuming immediate availability.
TP MoE trades communication for better expert balance
EP4 assigns different experts to different ranks. When routing favors a few experts, their GPUs perform extra work while the others wait at a collective. TP MoE shards each expert across all four ranks, distributing approximately equal expert work across the GPUs.
In a separate decode profile, an early EP rank waited about 100 microseconds for a late rank at an all-reduce. TP made expert GEMMs slightly slower in that profile but left total verification time roughly unchanged. In two prefill traces containing five requests and about 16K tokens, EP took 771 ms versus 657 ms for TP, despite the slower expert GEMMs. The serving configuration subsequently reduced end-to-end latency from 5,100.87 ms to 4,811.81 ms and increased throughput by 5.93%.
The conclusion has limits. The experiment did not enable DeepEP or MegaMoE all-to-all and did not combine the results with expert-parallel load balancing. Whether TP remains preferable to dynamically balanced EP must be tested on the target topology and traffic mix.
The last three optimizations show diminishing returns
The final three changes remained useful but had much smaller end-to-end effects:
- Larger Indexer score tiles: With 16K compressed keys, the 64 MiB score-matrix budget fits about 1,000 query rows. Larger tiles reduced matrix fragmentation and scheduling overhead, cutting end-to-end latency by another 0.79% and increasing throughput by about 1.0%.
- Fused prefill selection and writeback: TTFT fell by about 2%, but end-to-end latency increased by 0.01% and TPOT rose from 5.88 to 5.96 ms. The reduced memory round trip did not become a net system gain.
- Paged Indexer K-tile reuse during verification: Avoiding redundant processing of some key tiles reduced end-to-end latency by 1.59% and brought TPOT back from 5.96 to 5.62 ms, although TTFT increased by about 5.1% relative to the preceding step.
Production tuning should therefore not mechanically enable all seven changes. TTFT, TPOT, queue depth and tail latency should jointly determine which kernel-level changes are retained.
Colocated results must be treated separately
The original post also lists follow-up measurements for the colocated baseline, colocated optimized configuration and PD router, but the collected excerpt does not retain the final colocated table. The 65.5% latency reduction from the 4+4 disaggregated deployment should not be applied to colocated serving without direct measurements.
In general, colocation can reduce GPU count and avoid moving complete KV state between prefill and decode workers. The trade-off is contention: compute-intensive prefill kernels and bandwidth-sensitive decode operations compete for the same devices, so scheduling and batch shape become decisive. The choice should be based on the actual input-length, output-length, concurrency and KV-footprint distribution.
Limits of the benchmark
All runs used the same DeepSeek-V4.1-Flash checkpoint, Humming W4A8 MoE, DSpark block size 5 and 8,192-token prefill chunks. The workload contained 256 requests with 24 in flight. Each request nominally combined 61,440 shared tokens with 4,096 request-specific tokens and generated 500 output tokens. All requests completed, producing 128,000 output tokens per run.
Several statistical and workload caveats matter:
- Ten warm-up requests were followed by a cache flush, but the measured phase still recorded a 93.21% cache-hit rate. Shared prefixes amplify the end-to-end contribution of prefill optimizations.
- The TP4 baseline and first three steps were single runs from the original sweep, while the last four steps were means over completed follow-up runs. Equal statistical confidence cannot be assumed for every row.
- P99 was calculated per run and then averaged, which can conceal an individual severe tail.
- The post includes a GSM8K accuracy measurement, but its values are absent from the collected excerpt. It is therefore not justified to claim that FP8 scoring, TP MoE or graph capture leaves quality unchanged.
- These are first-party measurements. Driver, CUDA, compiler, precision mode and hardware topology can all affect absolute performance.
Deployment guidance
- Reproduce the real traffic distribution: Separate high- and low-cache-hit workloads, long and short outputs, and multiple concurrency levels. Do not extrapolate a production SLA from shared-prefix, 500-token requests alone.
- Adopt the highest-impact parallel combination first: Validate Prefill CP4 plus Decode DP4, then FP8 DeepGEMM. These two steps account for most of the end-to-end improvement.
- Choose the MoE strategy from routing imbalance: Test TP MoE when hot experts create visible all-reduce waits, and compare it with DeepEP, MegaMoE and EPLB rather than assuming one approach always wins.
- Capacity-plan CUDA Graph separately: Reserve roughly 15 GB per prefill rank for capture, include several minutes of capture time and verify whether the 262,144-token context cap meets service requirements.
- Make quality a release gate: Compare BF16 and FP8 Indexer top-k agreement, retrieval recall, code and mathematics accuracy, and check whether candidate reordering changes model outputs.
- Monitor queues rather than GPU utilization alone: Track TTFT, TPOT, P50/P99 end-to-end latency, prefill and decode queue depth, KV-transfer time and power consumption. The current stack improves TTFT sharply while increasing TPOT by about 75.6%, demonstrating why one throughput number is insufficient.
The most reusable contribution is not an isolated kernel. It is the decision to match separate parallel strategies to the distinct compute profiles of prefill and decode, then constrain every optimization with queueing, tail-latency and quality metrics. This makes the work valuable for constrained hardware and shared-long-context serving, although independent reproduction is still needed.
— END —Source: LMSYS / SGLang Blog (2026-11-19)
Tags: #DeepSeek-V4.1-Flash #SGLang #NVIDIA H20-3e #Disaggregated Prefill-Decode #FP8 DeepGEMM
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments