NanoCP: Request-Level Dynamic Context Parallelism for Data-Expert Parallel Decoding

Jiefei Chen, Binbin Lin, Jinming Ma, Jiangfei Duan, Haojie Duanmu, Hao Liu, Qinxiu Cheng, Xiuhong Li, Zhilin Pei, Hui Wang, Xingcheng Zhang, Dahua LinarXiv 2026

TL;DR

NanoCP introduces request-level Dynamic Context Parallelism (DCP) for Mixture-of-Experts (MoE) model serving, decoupling MoE communication from KV cache placement. By dynamically scaling the context parallelism degree based on each request's length, NanoCP eliminates execution stragglers and memory fragmentation, boosting sustainable request rates by up to 3.27× under strict latency constraints.

What Problem Does This Paper Address?

When serving large Mixture-of-Experts (MoE) models, systems typically use a hybrid approach: Data Parallelism (DP) replicates attention layers across instances to handle different requests, while Expert Parallelism (EP) shards the massive expert weights across GPUs.

Standard serving systems rigidly bind a request's attention computation, MoE routing, and KV cache to a single DP instance. However, under real-world variable-length workloads, this binding creates a fundamental scheduling conflict:

  1. Attention latency scales with the total KV cache size (context length).
  2. MoE communication latency scales with the token batch size.

If you route requests to balance the KV cache, you skew the batch sizes. If you route to balance batch sizes, you skew the KV cache load. Because EP requires lock-step synchronization across GPUs, any imbalance creates "EP stragglers"—faster GPUs sitting idle waiting for the slowest one. Furthermore, massive long-context requests can easily overwhelm the memory of a single instance, causing Head-of-Line (HoL) blocking and severe tail latency, even when the cluster has plenty of aggregate free memory.

Existing Context Parallelism (CP) systems try to fix this by spreading a request's KV cache across multiple instances, but they apply a uniform parallelism degree to all requests. This forces short requests to undergo unnecessary cross-GPU communication, tanking overall efficiency.

Figure 1. Existing load balancing strategies: (a1) least cache routes each incoming request to the instance with the most free KV blocks, (a2) least batch routes it to the instance with the smallest running batch size, and (b) Helix applies a uniform CP degree to all requests; (c) NanoCP.

Methods

NanoCP solves this by introducing Dynamic Context Parallelism (DCP), which completely decouples MoE communication from KV cache placement. Long requests dynamically distribute their attention across multiple instances, while short requests remain entirely local to avoid communication overhead.

The system is split into two main components:

1. Control Plane: Dual-Balanced Scheduling

NanoCP uses a single centralized scheduler with a global view of the cluster. For every request, it independently selects an MoE binding (to balance batch sizes across instances) and a KV binding (to balance attention computation). It uses an offline-profiled length-bucket function to determine the optimal CP degree for a request and a global page table to track physical memory allocations across the cluster.

2. Data Plane: Static Runtimes & Custom Communication

Varying routing patterns across iterations normally conflict with high-performance GPU runtimes like CUDA Graphs. NanoCP bridges this gap with two innovations:

  • Ahead-of-Time (AOT) Graph Manager: Pre-compiles a bounded family of static execution graphs based on shape bucketing, allowing zero-overhead runtime replays.
  • Routing-Based Communication Backend: Instead of relying on heavy collective communication libraries (like NCCL or DeepEP) that require dense data exchanges, NanoCP uses a lightweight 2D mask matrix to directly steer sparse query and result transfers outside the collective path.
Timeline analysis of how different scheduling strategies introduce or mitigate stragglers.

Datasets

The authors evaluated NanoCP using production-derived variable-length traces:

  • ShareGPT-4o: Used as the short-context dataset.
  • GitHub Issues: Used as the long-context dataset.
  • Mixed Workloads: Synthesized blends of the two datasets at 1% and 5% long-context ratios to mimic real-world production traffic and heavy stress cases.

Evaluations were performed using DeepSeek-V3 and Kimi-K2 model backbones on a cluster of NVIDIA H200 GPUs.

Key Insights and Ideas

  • Decoupling is Key: MoE routing and KV cache do not need to be co-located. Separating them allows the system to optimize for batch size and context length independently.
  • "Liquefying" the KV Cache: Spreading long-context footprints across the cluster effectively turns fragmented memory into a shared pool, solving HoL blocking without the overhead of uniform CP.
  • AOT Graph Bucketing: You don't need a fully dynamic graph engine to support dynamic routing. Pre-allocating a shared memory pool and slicing it into predefined shape buckets satisfies static CUDA Graph constraints while preserving runtime flexibility.

Key Results

  • Higher Throughput: NanoCP achieves 1.88× to 3.27× higher request rates compared to state-of-the-art baselines (like vLLM) while strictly adhering to a 99% Time-Per-Output-Token (TPOT) Service Level Objective (SLO).
  • Tail Latency Reduction: By mitigating EP stragglers and HoL blocking, NanoCP reduces P99 tail latency by 1.79×–2.12×.
  • Minimal Communication Overhead: NanoCP reduces CP communication overhead by 90.41% compared to uniform CP configurations (e.g., 4DP8CP) because it only triggers context parallelism when genuinely beneficial.
  • Backend Efficiency: The custom routing backend reduces query transfer latency by 8.56%–52.85% over standard NCCL.

Limitations and Future Work

  • Profiling Dependency: The length-bucket function relies on offline profiling to determine the optimal CP degrees for different request lengths, which may need to be re-run for different hardware topologies.
  • Memory Overhead: Prebuilding the 48 CUDA Graphs introduces a small memory overhead (~4.30 GiB or ~3% of H200 HBM) per GPU, though the authors note this is comparable to or better than uniform CP baselines.

Summary updated

BibTeX
@misc{chen2026nanocp,
  author = {Jiefei Chen and Binbin Lin and Jinming Ma and Jiangfei Duan and Haojie Duanmu and Hao Liu and Qinxiu Cheng and Xiuhong Li and Zhilin Pei and Hui Wang and Xingcheng Zhang and Dahua Lin},
  title = {{NanoCP: Request-Level Dynamic Context Parallelism for Data-Expert Parallel Decoding}},
  year = {2026},
  eprint = {2605.21100},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.21100},
}

Loading related content...

Figure