Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Artificial Intelligence
8 min read

Baidu's G3.5 SSD Pool Cuts KV Cache TTFT 90% for Long-Context LLMs

Baidu's G3.5 centralized SSD pooling extends KV Cache capacity to 256TB via RDMA/NVMe-oF, using chunked DMA aggregation, MLA duplicate-read elimination, and KV-semantic direct access to achieve 90.2% lower tail TTFT and 7.31x throughput versus host-memory baseline, matching memory-pool performance at lower cost.

Long-context, multi-turn dialogue, and high-concurrency inference drive growing KV Cache capacity demands that exceed GPU HBM and host DRAM. Baidu's Baige system on Kunlun XPU hardware evolved from node-local memory (G2) to a pooled memory layer (G2.5) and finally to G3.5: a centralized NVMe SSD pool shared across compute nodes via RDMA/NVMe-oF.

1. KV Cache Capacity Extension: From Node Memory to Remote Storage

KV Cache stores Prefill-phase K/V tensors for reuse during Decode and across requests with common prefixes (Prefix Cache). As context length, turns, and concurrency increase, capacity must scale. Early G2 offloaded evicted prefix KV from HBM to host DRAM on the same node, but capacity was limited by per-node memory slots and could not be shared across nodes. G2.5 pooled idle host DRAM from Decode nodes via Mooncake for Prefill nodes, improving utilization but still bounded by Decode node count and memory headroom; Decode nodes also need memory for Sparse Attention, and growing workloads eventually hit capacity ceilings, evicting history KV and losing prefix-reuse gains.

G3.5 moves NVMe SSDs to dedicated storage nodes, presenting a shared, independently scalable pool to multiple compute nodes over RDMA/NVMe-oF. This decouples storage capacity from compute node count and DRAM budget, while SSD's lower $/GB makes large-scale KV Cache economically viable.

G3.5 architecture overview
G3.5 architecture overview

2. G3.5 Centralized SSD Pooling: Capacity Utilization and Efficient Access

Two challenges arise: (1) making the new capacity effective across the cache hierarchy (G1 HBM, G2 host DRAM, G3 local NVMe, G3.5 remote SSD pool, G4 distributed cold storage), and (2) overcoming the longer access path of remote SSD (storage I/O, network transfer, memory copies) to avoid TTFT penalties.

3. Baige on Kunlun: Three-Layer Software Stack and Optimizations

Baige builds a three-layer stack:

Inference Engine Layer : KV organization, tiered scheduling, prefix matching, page management, multi-level cache eviction/prefetch, async read/write.

Cache Service Layer : Abstracts KV as addressable, shared distributed objects; handles cross-node data management and transport; optimizes metadata for zero-copy passthrough.

Storage I/O Layer : Runs on storage nodes as KV Target; uses user-space NVMe driver to bypass kernel stack, pushing remote-disk latency close to local disk.

Three-layer software stack
Three-layer software stack

3.1 Unified Pool Management for Storage Efficiency

The hierarchy is organized as:

G1: GPU HBM – active KV residency

G2: Host DRAM – near-hot cache and staging

G3: Node-local NVMe – session-level KV persistence

G4: Remote distributed storage pool – global cold KV

G3.5 extends G3 by centralizing node-local NVMe into a shared pool via RDMA/NVMe-oF, combining G3's low latency with G4's sharing and elasticity. Baige manages G3 local SSD and G3.5 pool together, using the memory pool for hot/cold tiering across media, with the cache service layer handling metadata and data movement.

3.2 Optimizing Read/Write Paths to Reduce Remote Access Overhead

3.2.1 Operator-Level: Chunked DMA Aggregation

Mooncake's zero-copy requires KV in L2 with page_first_direct layout, which is unfriendly for data movement: a single load issues num_pages × num_layers × kv_count DMA submissions, each only 72 KiB. This hits Kunlun XPU queue depth limits and falls far below DMA's efficient transfer size.

Baige changes aggregation direction from Page to Layer: data for the same page across layers is read contiguously into a staging buffer, then a single kernel scatters it to each layer. D2H uses symmetric gather-then-DMA. To preserve overlap with computation, they introduce Chunk partitioning : all layers' data is split into multiple chunks; each chunk still aggregates across layers, reducing DMA submissions while keeping data movement overlapped with compute.

Chunked DMA aggregation diagram
Chunked DMA aggregation diagram

After chunking, DMA submissions drop from 468 to 48, per-transfer granularity increases an order of magnitude, and compute-overlap is retained – enabling efficient KV swap-in/out from remote SSD.

3.2.2 Framework-Level: Eliminating MLA Duplicate Reads

Under Multi-Head Latent Attention (MLA), different ranks may read the same KV data. If each rank independently fetches from HiCache L3 (remote SSD), storage bandwidth is wasted. Baige optimizes: one rank reads from L3 into shared L2 host memory; other ranks reuse that copy. This avoids redundant remote reads and cuts storage bandwidth pressure.

In G3.5 hot-spot testing, optimized TTFT fell from 5.43 s to 3.03 s, matching the G2.5 memory-pool baseline of 3.05 s, closing the SSD-vs-DRAM performance gap.

3.2.3 Control-Plane: KV-Semantic Direct Access

Traditional Mooncake PUT/GET requires RPC to Master for metadata (node, address, length) per request, creating Master contention at scale. Baige implements a KV semantic layer on the storage side: compute nodes submit only the Key; the storage node resolves the Value's LBA internally. Compute nodes use a direct-access mode to select target disks, eliminating Master RPC entirely (0 Master visits per PUT/GET).

KV semantic direct access
KV semantic direct access

Measured results: small-value write throughput increases multiple times over Master-mediated path; large-value read/write bandwidth with data sharding exceeds native NVMe-oF block semantics. The KV semantic layer simplifies the access path and removes control-plane overhead.

4. Performance Verification

4.1 Long-Context Multi-Turn Dialogue: 90.2% Tail TTFT Reduction, 7.31× Throughput

Test setup : GLM5 model, 24-turn conversations, 2048 tokens/turn, 350 sessions, 32 concurrent. Hardware: Baidu Tianchi 32-card super-node; G3.5 storage nodes with 16× Gen5×4 NVMe (~256 TB), 2× CX7 400 GbE delivering ~80 GB/s aggregate read bandwidth, end-to-end read latency <20 µs. Cluster: P4+D4 prefill-decode separation, P-node DP=4, page_first_direct + direct. Cache configs compared: L1 (HBM only), L2 (HBM+host DRAM), G2.5 (HBM+host DRAM+Mooncake memory pool, pure RDMA no disk), G3.5 (HBM+host DRAM+Mooncake memory pool+remote SSD pool).

Multi-turn performance trends
Multi-turn performance trends

L2 alone shows near-zero cumulative gain: throughput matches L1, only leads first 5 turns, then evicts due to capacity; final-turn hit rate 2.74%.

G2.5 memory pool collapses mid-conversation: hit rate crashes, TTFT spikes, final turn reverts to L1 level.

G3.5 remains stable: final-turn hit rate 95.79%, TTFT slope 1/10 of baseline.

Key metrics comparison
Key metrics comparison

Key metrics vs. L2 baseline: final-turn TTFT reduced 90.2%, average throughput 7.31× baseline. Late-stage throughput dip correlates with reduced resident request count and batch shrinkage, not hit-rate loss; hit rate continues rising, throughput stays >8× baseline per turn.

4.2 Third-Party Agent Dataset Replay: Steady-State TTFT ~3 s, SSD Pool Matches Memory Pool

Replay of 540 requests from a third-party Agent dataset on same hardware/cluster. Steady-state replay region shows highest gains: G2.5 and G3.5 both achieve 99.93% replay hit rate, TTFT converges to ~3.0 s (~88% reduction vs. baseline). G3.5's 88.3% reduction matches G2.5 exactly, proving remote SSD access latency is fully hidden by async pipelining.

Agent dataset replay TTFT comparison
Agent dataset replay TTFT comparison

This confirms that extending storage media from DRAM to remote SSD does not sacrifice inference performance when the software stack is properly optimized.

5. From Technical Practice to PreCache Elastic Pooled Inference Cache

The G3.5 architecture decouples KV Cache storage from compute nodes, using an independent storage pool for massive cache data, combined with high-speed networking, cache management, and transport optimizations to control access overhead. This design is hardware- and framework-agnostic; specific software stack, network, and storage implementations can be composed per deployment.

Baidu Intelligent Cloud productizes this as PreCache (Pooled Rapid Elastic KVCache) : a shared, elastically scalable KV Cache pool between AI compute nodes and persistent storage. PreCache uses high-density storage nodes with large-capacity NVMe SSD, supporting single-instance capacity from 100 TB to 100 PB on demand. RDMA data transfer and user-space I/O deliver up to Tbps cache read/write bandwidth per GPU server, with sub-millisecond latency for MB-sized blocks.

6. Summary

Baidu Intelligent Cloud now offers a spectrum of KV Cache capacity solutions:

For moderate performance needs and stable capacity: G2.5 reuses idle Decode-node memory via Mooncake for low-cost sharing.

For ever-growing context, turns, and concurrency: PreCache adds independent SSD pool with lower $/GB and independent scalability.

Both cover different trade-offs among performance, capacity, and cost. Through hardware-software co-optimization, PreCache keeps remote storage access overhead low, delivering capacity expansion without compromising inference performance.

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 0

Write a comment

Sign in to join the discussion

No public comments on this page. Sign in to comment