Ant International Optimizes DeepSeek-V4.1 on H200, Cutting Prefill Latency by up to 79%
Summary:Ant International's AI Infra team optimized the SGLang serving path for DeepSeek-V4.1-Flash on an eight-H200, 1P1D deployment. The work targets BF16 Prefill Indexer scoring, candidate selection, score-epilogue memory traffic, MoE output communication, CP return behavior, and Prefill chunking. In the combined configuration, E2E latency fell by 15–64% and TTFT by 41–79% across eight cases, while TPOT rose by 3–52%. GSM8K accuracy moved from 96.74% to 95.38%, a 1.36-percentage-point regression. Th
Ant International's AI Infra team targeted the Prefill supply path of DeepSeek-V4.1-Flash on an eight-H200 deployment. The work separates client-visible delay into queueing, Prefill computation, P/D handoff, and Decode. Its combined configuration sharply reduces TTFT and E2E latency, but it also raises TPOT and introduces a 1.36-percentage-point GSM8K regression.
Deployment Topology and Bottleneck Analysis
In this test, 1P1D means one Prefill worker and one Decode worker, with four H200 GPUs assigned to each rather than one GPU per stage. The Prefill worker runs TP4, CP4, and EP4: tensor parallelism shards tensor operations, context parallelism partitions long prompts, and expert parallelism distributes MoE experts. The Decode worker uses TP4, DP4, and EP4 to combine tensor, data, and expert parallelism. These dimensions share the same four GPUs within each worker and should not be interpreted as additive GPU counts.
DeepSeek-V4.1 uses shared compressed KV, shared Indexer candidates, and sliding-window attention, placing candidate selection, long-context computation, and P/D handoff on the same critical path. The team observed requests accumulating in the Prefill queue at moderate concurrency even though Decode-side cache capacity did not explain the backlog. It therefore focused on reducing Prefill service time before changing the P/D ratio.
In one representative Prefill profile, the Indexer took 209.47 ms, or 39.06% of the reported per-forward breakdown. MoE computation and NCCL each accounted for approximately another 18%. This was a forward-pass profile rather than request-level E2E latency, but it identified the main targets for the H200 Torch BF16 path: Indexer scoring, MoE output reduction, and collective communication.
Six Core Optimizations
1. Aligning the BF16 Indexer Score Width
The team aligned the BF16 Prefill Indexer score width with a shape that the target kernels could process efficiently, avoiding wasted compute lanes and padding overhead. The mathematical model path was not changed; the gain came from eliminating shape-related waste. Microbenchmarks that included padding costs showed roughly 40% lower Indexer scoring latency.
The limitation is important: these results target the Torch BF16 implementation on H200. The Blackwell path uses DeepGEMM for the relevant Indexer operations, so the same percentage cannot be extrapolated to other GPUs or numerical paths.
2. Scoring Only Candidate Positions
The original Indexer Consumer path scored every context position and then selected the shared candidates. The optimization moves candidate filtering ahead of the dot product, calculating scores only for retained positions.
If L is the number of context positions, C the number of retained candidates, and D the Indexer feature dimension, the conceptual work changes from O(L×D) to O(C×D), while intermediate score tensors require less write and read traffic. The associated PR reports a 22.1% E2E reduction. Production use still needs explicit handling for empty candidate sets, boundary positions, shared prefixes, and approximation errors in candidate generation.
3. Fusing the Indexer Score Epilogue
ReLU, head weighting, head reduction, and FP32 conversion are combined in one epilogue, avoiding repeated global-memory round trips and kernel boundaries while preserving the tested BF16 rounding behavior. The associated PR reports an 18.2% E2E reduction.
Fusion reduces launch overhead, memory traffic, and synchronization points, but increases register pressure and code complexity across head sizes. The numerical order of FP32 accumulation and conversion must also be aligned with the baseline, because small rounding differences can compound during long generations.
4. Larger Prefill Chunks and Decode Graph Metadata
Raising the Prefill chunk from 8,192 to 16,384 tokens is intended to amortize scheduling and repeated launch overhead; the recorded TTFT reduction reaches 31.3%. Related Decode graph-metadata work is tracked in SGLang PR #46777.
Larger chunks create longer uninterrupted execution intervals. They can reduce scheduling overhead, but they may also increase instantaneous memory pressure, queueing delay, and failure-recovery granularity. The article treats the 8K-to-16K change as a configuration-level observation and does not isolate how it contributes to the TTFT, E2E, and TPOT movements.
5. Returning CP MoE Output Shards with Reduce-Scatter
On the eligible DeepSeek-V4.1 CP return path, each rank no longer receives the full MoE output. Reduce-Scatter performs the reduction and distributes only the shard required by each rank, removing full-output replication. Profiled MoE output communication time fell by 19.4%–21.7% per rank.
The gain depends on NCCL topology, message size, and overlap between collectives and computation. Congestion or rank imbalance can weaken the result. The reduction order and numerical type also need to be covered by precision regression tests.
6. Enabling Bounded Replay with CP and DSpark
The team repaired compact-output gathering so eager CP Prefill could execute late-layer tail computation, then combined bounded replay with the CP and DSpark paths. The associated PR reports a TTFT reduction of up to 46.7%.
Bounded replay trades limited repeated work for earlier execution of later layers, but it adds temporary buffering, scheduler state, and validation overhead. Because this path intersects speculative execution with P/D state management, deployments should also track acceptance length, replay count, failure rate, and recovery time for exceptional requests.
Combined Results and Engineering Trade-offs
The combined configuration produced the following results across eight recorded workloads:
| Metric | Optimized vs. baseline | Engineering implication | | --- | --- | --- | | E2E | Approximately 15–64% lower | Lower overall request cost | | TTFT | 41–79% lower | Much faster first-token response | | TPOT | 3–52% higher | Slower generation per output token | | GSM8K | 96.74% to 95.38% | 1.36 percentage points lower |
This was not a cost-free upgrade. TTFT fell sharply while TPOT rose, indicating that the bottleneck moved under a fixed 4P4D allocation. The evaluation did not isolate the respective effects of Prefill acceleration, chunk sizing, and bounded replay on E2E and TPOT. The accuracy regression is equally important: candidate filtering and epilogue fusion are intended to preserve mathematical semantics, so the 1.36-point GSM8K loss requires dedicated investigation rather than being accepted as a serving-side side effect.
Benchmark Scope and Reliability Limits
The workload used nominal 65,536-token inputs and 512-token outputs. Nominal shared-prefix labels of 50%, 70%, and 90% corresponded to actual configured fractions of 50.0%, 70.3%, and 93.75%. Concurrency ranged from 4 to 32. Each case was run three times, with 512 requests and 10 warmup requests per run.
The reported sample standard deviation uses ddof=1 and is calculated across the three run means, not across individual request latencies within one run. It describes run-to-run variation but does not establish statistical significance for small mean differences. The authors explicitly warn against treating the summary means as proof of significance.
Several additional limitations apply. Initial Indexer experiments disabled Prefill BCG. The tables do not contain complete per-run SGLang revisions for every configuration. Sections 1–3 independently start from commit d0a75654368a470d8484e3ea45b06e500fee57af, Section 4 combines the three Indexer changes, and the later experiments build on different subsets of those results. GSM8K is evaluated separately from the serving benchmark, so its accuracy movement cannot be attributed to one particular PR.
Developer Rollout and Deployment Guidance
- Pin the model, runtime, and configuration. Record the DeepSeek-V4.1-Flash weights, base SGLang commit, TP/CP/EP/DP layout, chunk size, and parallel settings. A final mean without revision metadata is not reproducible.
- Use incremental A/B tests. Evaluate the three Indexer changes separately, then add the 16K chunk, Reduce-Scatter, and bounded replay. Track TTFT, TPOT, E2E, GPU utilization, NCCL time, and queue length for every step.
- Create a numerical-quality gate. Compare retained candidates element by element across empty-candidate, first/last-position, shared-prefix-boundary, and different-head cases. Run organization-specific long-context evaluations to explain the GSM8K regression.
- Add tail-latency and queue telemetry. Record p50, p95, p99, Prefill queue time, P/D handoff time, and KV transfer time rather than relying on averages alone.
- Tune the P/D ratio against the actual SLO. For first-token-sensitive services, test larger Prefill chunks and bounded replay. If TPOT is a hard constraint, add Decode capacity or reduce the Prefill optimization level; a fixed 4P4D allocation cannot scale both gains indefinitely.
- Validate the target hardware and network. Test Reduce-Scatter on the intended NCCL topology and evaluate the H200 Torch BF16 path separately from the Blackwell DeepGEMM path rather than reusing the same performance ratio.
The value of this work is not a new model architecture. It maps several concrete serving bottlenecks—shape-sensitive Indexer GEMMs, redundant candidate scoring, epilogue memory traffic, replicated MoE outputs, and CP replay behavior—to implementable runtime changes. It is a useful engineering reference for serving long-context MoE models on H200, but production adoption still depends on PR-level reproduction, quality regression testing, and tail-latency observation.
— END —Source: LMSYS / SGLang Blog (2026-11-10)
Tags: #DeepSeek-V4.1-Flash #SGLang #Prefill-Decode Disaggregation #NVIDIA H200 #MoE Communication
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