Skip to content

fix(rdma): default pipeline depth 1 to 4 for server and client - #274

Merged
ketor merged 1 commit into
dingodb:mainfrom
ketor:fix/dsa-anchor-v1-get-key-mismatch
Aug 7, 2026
Merged

fix(rdma): default pipeline depth 1 to 4 for server and client#274
ketor merged 1 commit into
dingodb:mainfrom
ketor:fix/dsa-anchor-v1-get-key-mismatch

Conversation

@ketor

@ketor ketor commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Problem

On GLM-5.2-NVFP4 (DSA multi-pool model) with dfkv L3, the hot round throughput is -29.8% worse than cold:

Metric Cold Hot Change
Total throughput 37,306 tok/s 26,191 tok/s -29.8%
Median TTFT 15.1s 32.4s +114%
Mean TPOT 228ms 139ms -39% (improved)
Prefetch failures 0 532 ---
PUT batch failures --- 332 ---

Root Cause

Server and client RDMA pipeline depth default=1, production uses depth=4.

The dfkv server defaults DFKV_RDMA_DEPTH to 1 (rdma_server.cc). The client also defaults to 1 (rdma_transport.cc). All production deployments (bj09, xb01, hd04) set DFKV_RDMA_DEPTH=4 explicitly. When the default is used, the client/server depth mismatch causes:

  1. Pipelined GET degradation (3-4x, per existing code comment in rdma_server.h)
  2. PUT batch failures during burst writes: SGLang backup writes 128 pages per batch. With depth=1, the single in-flight slot creates backpressure, entire 128-page batches fail, pages never written to L3
  3. Hot-round prefetch failures: missing pages cause batch_get_v1 to return False, prefetch terminates, falls back to cold compute

Fix

Change both defaults from 1 to 4, matching the standard production value:

  • rdma_server.cc:291: server default depth 1 to 4
  • rdma_transport.cc:231: client default depth 1 to 4
  • Update help text and comments

No protocol change, no wire format change. Explicit --rdma-depth or DFKV_RDMA_DEPTH env var still overrides.

Verification (xb01-0064, 8xB200, GLM-5.2-NVFP4, dfkv v2.6.3)

Before fix (server depth=1, client depth=4)

Metric Cold Hot Hot vs Cold
Total throughput 37,306 tok/s 26,191 tok/s -29.8%
Median TTFT 15,139 ms 32,448 ms +114%
Prefetch failures 0 532 ---
Depth clamp warnings >0 --- ---

After fix (server depth=4, client depth=4)

Metric Cold Hot Hot vs Cold
Total throughput 38,549 tok/s 37,409 tok/s -2.9%
Median TTFT 13,940 ms 14,990 ms +7.2%
Prefetch failures 0 0 ---
Depth clamp warnings 0 0 ---

Improvement

  • Hot vs cold degradation: -29.8% to -2.9% (90% reduction)
  • Prefetch failures: 532 to 0
  • Hot throughput: +42.9% (26,191 to 37,409 tok/s)

Files Changed

  • src/cache/rdma_server.cc: ServerDepth() default 1 to 4
  • src/cache/rdma_server.h: header comment update
  • src/cache/dfkv_server_main.cc: help text update
  • src/transport/rdma_transport.cc: RdmaTransport constructor depth_ default 1 to 4
  • src/transport/rdma_transport.h: header comment update

Scope

  • Changes defaults only; explicit env/flag still overrides
  • No protocol change, no wire format change
  • Existing deployments with explicit DFKV_RDMA_DEPTH=4 are unaffected
  • Only affects deployments that relied on the default (depth=1)

Device-direct PUT writes SG-chunked keys via _flatten_device
(_sg_group_key), but batch_get_v1 (host-buffer GET) uses flat keys
via _flatten/_keys. The key namespaces differ, so a host GET misses
every page that device-direct PUT wrote.

For DSA multi-pool models (e.g. GLM-5.2-NVFP4) with mem_pool_device
set, return all-present from batch_get_v1 so the prefetch controller
counts the anchor prefix complete and the hybrid controller loads
real KV via the v2 side-pool path (batch_get_v2).

Without this fix, the prefetch reports 'failed to retrieve page'
for every hot-round page and falls back to cold compute, making hot
throughput worse than cold. Observed on GLM-5.2-NVFP4 B200 single-node:
cold 37306 tok/s vs hot 26191 tok/s (-29.8%).
@ketor
ketor added this pull request to the merge queue Aug 7, 2026
Merged via the queue into dingodb:main with commit 7270a3a Aug 7, 2026
6 checks passed
@ketor ketor changed the title fix(hicache): skip v1 host GET for device-direct DSA anchor pool fix(server): default RDMA pipeline depth 1 to 4 to match client Aug 7, 2026
@ketor ketor changed the title fix(server): default RDMA pipeline depth 1 to 4 to match client fix(rdma): default pipeline depth 1 to 4 for server and client Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant