Skip to content

CollectiveX: kv-transfer suite on vLLM 0.32.0's DeepSeek-V4 layout, run by hand / CollectiveX:基于 vLLM 0.32.0 DeepSeek-V4 布局、手动运行的 kv-transfer 测试套件 - #2510

Merged
Oseltamivir merged 1 commit into
mainfrom
collectivex-kv-transfer
Oct 31, 2026
Merged

Oseltamivir merged 1 commit into
mainfrom
collectivex-kv-transfer

Conversation

@Oseltamivir

@Oseltamivir Oseltamivir commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a third CollectiveX suite, kv-transfer. It times the hop a disaggregated engine makes between prefill and decode: one request's KV cache moving between one GPU on each of two nodes, through NIXL and Mooncake. Each library posts the descriptors vLLM 0.32.0's connector for it builds for DeepSeek-V4-Pro, and every timed transfer is verified. CollectiveX had no KV-transfer coverage; this gives the dashboard's KV tab real data per pool and library.

This revision rebuilds the PR on current main as one commit, replacing the old head (8a01500):

  • Runs by hand over SSH, like the other suites. On a pool's login node, run.sh <sku> --suite kv-transfer runs one shard per (backend, fabric) from the registry's kv_backends. The sweep workflow is untouched; CI's cases.json consistency check now includes the kv suite.
  • Libraries come from the image. The vllm/vllm-openai:v0.32.0 image supplies NIXL and Mooncake instead of pip pins; EFA pools swap in Mooncake's EFA build of the same version.
  • Results publish through the app. They are case-attempt documents the app ingest accepts: no hostnames or addresses, and source_sha/source_dirty come from run.sh.

What vLLM 0.32.0 changed. The layout below was dumped from vLLM itself on b300 (KV cache config, both connectors' registrations, the block ids its scheduler hands them):

  • Groups and window tails. Groups come in vLLM's order: swa-a, swa-b, mla, c128a-state, c4a-state. A windowed group moves only its blocks still inside the window: the prefill side's tail leads with the null block, but the decode side lists only live blocks and both connectors end-trim to that count. A 2048-token request moves 30 ids (43.1 MB).
  • NIXL. One whole 1,435,968-byte row per id, as before.
  • Mooncake transfer plan. Mooncake no longer posts per-layer pages. The connector folds and coalesces its 213 layer views into 5 transfer regions, so a 2048-token request posts 32 entries: the 30 rows plus swa-a's two ids again as 37,376-byte pages. The model reproduces what vLLM's own region planner returned on the real views.
  • Mooncake is candidate. On b300, vLLM 0.32.0 cannot start MooncakeConnector for DeepSeek-V4: ValueError: No common block size for 4 (DEEPSEEK_SPARSE_SWA: [MultipleOf(32)]; ...) from its kernel block-size check. These rows time the library on the plan the connector's code builds.
  • vLLM's configuration, not recipe tuning. Each library runs what vLLM's connector sets (NIXL num_threads 4, telemetry, UCX_RCACHE_MAX_UNRELEASED=1024; Mooncake's 10 workers and batch sync write). Deployment tuning from InferenceX's serving recipes, such as NIXL_UCX_SGL_ENABLE, is not applied. Rows publish implementation.library_config with the engine contract and the UCX settings they ran under.
  • One payload for GB/s. GB/s divides the request's KV bytes, the same for every backend, by the p50 burst latency; rows also record what each backend posts (descs, posted_bytes).
  • NIXL on EFA (b300). The LIBFABRIC plugin needs libhwloc.so.15, which the image does not ship. nixl shards bind the host's copy (the same Ubuntu 24.04 and glibc 2.39), and backend prep starts a LIBFABRIC agent before any case runs.
  • MoRI-IO removed. MI355X two-node RDMA waits on the hosts' AINIC user space matching the image's, and the ROCm image ships no Mooncake, so mi355x has no kv entry yet.

Details are in collectivex/docs/kv-transfer.md.

Risks and follow-ups:

Validation (b200-nscale, by hand, both shards green, every timed transfer verified): at 524288 tokens, NIXL moves a request in 61.3 ms (48.5 GB/s, pull and push within 0.4%), at one 400 Gb/s NIC's line rate and level with a single contiguous copy at every ISL and batch. Mooncake push takes 78.5 ms (37.9 GB/s), 20-35% behind NIXL push on the same nodes.

Validation details

Rerun from this head (fce5d16), matching the first run within 1%. b300 (EFA, NIXL over LIBFABRIC, Mooncake EFA build) from the same head: NIXL 96-97 GB/s and Mooncake 89 GB/s paged at 524288 tokens, all verified. Results not yet uploaded to the database.

Backend ISL Batch p50 GB/s
nixl pull 2048 1 0.900 ms 47.84
nixl push 2048 1 0.904 ms 47.67
nixl pull 2048 32 28.40 ms 48.55
nixl pull 32768 1 4.451 ms 48.39
nixl pull 524288 1 61.31 ms 48.48
mooncake push 2048 1 1.347 ms 31.97
mooncake push 2048 32 34.99 ms 39.40
mooncake push 32768 1 5.640 ms 38.19
mooncake push 524288 1 78.46 ms 37.89
中文

新增 CollectiveX 第三个测试套件 kv-transfer。它测量分离式推理引擎在 prefill 与 decode 之间的一跳:单个请求的 KV cache 通过 NIXL 和 Mooncake,在两个节点各一块 GPU 之间传输。每个库按照 vLLM 0.32.0 中对应 connector 为 DeepSeek-V4-Pro 构建的描述符形态提交传输,每次计时的传输都会经过校验。此前 CollectiveX 没有 KV 传输覆盖;本 PR 为看板的 KV 页提供各集群、各库的真实数据。

本版本在当前 main 上重建为单个提交,替换旧的 head(8a015008f):

  • 与其他套件一样通过 SSH 手动运行。 在集群登录节点上,run.sh <sku> --suite kv-transfer 按注册表中的 kv_backends 为每个(后端、互连)组合运行一个分片。sweep 工作流未改动;CI 的 cases.json 一致性检查现已包含 kv 套件。
  • 库来自镜像。 NIXL 与 Mooncake 由 vllm/vllm-openai:v0.32.0 镜像提供,不再使用 pip 固定版本;EFA 集群会换装同版本的 Mooncake EFA 构建。
  • 结果经由 app 发布。 结果为 app 导入可接受的 case-attempt 文档:不含主机名或地址,source_sha/source_dirty 由 run.sh 记录。

vLLM 0.32.0 带来的变化。 以下布局在 b300 上直接从 vLLM 导出(KV cache 配置、两个 connector 的注册、调度器交给它们的 block id):

  • 分组与窗口尾部。 分组顺序与 vLLM 一致:swa-a、swa-b、mla、c128a-state、c4a-state。滑动窗口分组只传输仍在窗口内的块:prefill 侧的尾部以空块(null block)开头,但 decode 侧只列出有效块,两个 connector 都会把 prefill 侧的 id 从尾部截到相同数量。一个 2048 token 的请求传输 30 个 id(43.1 MB)。
  • NIXL。 每个 id 一整行(1,435,968 字节),与之前相同。
  • Mooncake 传输方案。 Mooncake 不再提交逐层页面。connector 将 213 个逐层视图折叠合并为 5 个传输区域,因此一个 2048 token 的请求提交 32 个条目:30 行,加上 swa-a 的 2 个 id 再以 37,376 字节页面各传一次。本模型与 vLLM 自身的区域规划在真实视图上的结果一致。
  • Mooncake 标为 candidate。 在 b300 上,vLLM 0.32.0 无法为 DeepSeek-V4 启动 MooncakeConnector:其 kernel block size 检查报错 ValueError: No common block size for 4 (DEEPSEEK_SPARSE_SWA: [MultipleOf(32)]; ...)。这些结果测的是该库执行 connector 代码所生成方案时的表现。
  • 采用 vLLM 的配置,而非部署调优。 每个库都按 vLLM connector 的设置运行(NIXL num_threads 4、遥测、UCX_RCACHE_MAX_UNRELEASED=1024;Mooncake 的 10 个 worker 与批量同步写)。InferenceX 服务配方中额外的部署调优(如 NIXL_UCX_SGL_ENABLE)不予采用。结果会在 implementation.library_config 中记录引擎约定与实际生效的 UCX 设置。
  • 统一的 GB/s 口径。 GB/s 以请求的 KV 字节数(各后端相同)除以 p50 突发延迟;结果另行记录各后端实际提交的内容(descs、posted_bytes)。
  • EFA(b300)上的 NIXL。 LIBFABRIC 插件依赖镜像中没有的 libhwloc.so.15。nixl 分片会挂载主机上的该库(相同的 Ubuntu 24.04 与 glibc 2.39),后端准备阶段会在运行任何 case 之前先启动一个 LIBFABRIC agent。
  • 移除 MoRI-IO。 MI355X 的双节点 RDMA 需等待主机 AINIC 用户态与镜像版本一致,且 ROCm 镜像不含 Mooncake,因此 mi355x 暂无 kv 条目。

详见 collectivex/docs/kv-transfer.md。

风险与后续:

AI model disclosure
  • claude-opus-5-5[1m] (Claude Code): rebuilt the suite on main, ran the vLLM 0.32.0 layout and EFA probes on b300, wrote the code, tests and docs.
  • claude-opus-5-5[1m] (delegated review agent): independent correctness review of the diff.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional findings (outside current diff — PR may have been updated during review):

  • 🟡 experimental/CollectiveX/configs/platform_config.json:105-112 — Enabling kv_backends on gb200 routes its KV leg through launch_gb-nv.sh, which unconditionally exports COLLX_TRANSPORT=mnnvl for every shard and never calls collx_validate_network_profile_on_job — unlike launch_single-slurm.sh/launch_mi-amds.sh, which branch to an -rdma transport for scale-out and validate the fabric. Because transport stays mnnvl, collx_apply_network_profile, the rank wrapper's network branch, and prepare_backend.sh's validate_container_network all skip the fail-closed HCA/interface checks for this leg, even though this PR's own fabric note calls the gb200 KV leg real cross-node InfiniBand. The transfer itself likely still works (run_kv pins UCX/gloo selectors from the operator config independently of transport), so the concrete loss is the missing pre-flight fabric validation, not a guaranteed break.

    Extended reasoning...

    What's happening: configs/platform_config.json now sets kv_backends: {nixl: [rdma]} on gb200 (line 108) alongside a new network.rdma_devices/socket_ifname block and a fabric note that explicitly calls the KV leg "4x ConnectX-7 NDR400 InfiniBand (KV scale-out; EP stays MNNVL)". That's a genuine cross-node RDMA transfer.

    sweep_matrix._kv_cases() schedules this as a 2-node x 1-GPU shard using PLATFORMS["gb200"]["launcher"], which is gb-nv. launchers/launch_gb-nv.sh (untouched by this PR) unconditionally does export COLLX_TRANSPORT=mnnvl for every shard it runs and never calls collx_validate_network_profile_on_job. Compare that to launch_single-slurm.sh and launch_mi-amds.sh, which branch COLLX_TRANSPORT to an -rdma variant when NODES>1 and then validate the fabric on the job before proceeding.

    Why this was fine before, and why it isn't now: gb200/gb300 previously only ran the EP suite, whose EP16 always stays inside the 72-GPU MNNVL scale-up domain, so mnnvl was always the correct transport label for anything gb-nv launched. This PR is the first thing that schedules a real scale-out RDMA leg (KV transfer) on a gb-nv-launched SKU, and the launcher has no branch to distinguish that case from the EP/MNNVL case.

    Concrete effect: because COLLX_TRANSPORT stays mnnvl for the KV shard, three fail-closed validation paths all skip:

    • collx_apply_network_profile (runtime/common.sh) early-returns on its nodes>1 && transport!=mnnvl gate, so it never validates or exports NCCL_IB_HCA/GLOO_SOCKET_IFNAME for this leg.
    • The rank wrapper's own network branch in common.sh is gated the same way and is skipped.
    • prepare_backend.sh's validate_container_network is likewise gated on transport != mnnvl and returns early.

    So the gb200 KV leg is the only scale-out RDMA row in the registry that never gets the "prove the configured socket interface and RDMA HCA actually exist on every allocated node" check every other scale-out fabric (b200-nscale, mi355x, and the EP16 x86 rows) gets.

    Step-by-step to see it:

    1. platform_config.json:105-112 — gb200 has launcher: gb-nv and kv_backends: {nixl: [rdma]}.
    2. sweep_matrix._kv_cases() builds a case with nodes=2, gpus_per_node=1 for this SKU/backend.
    3. That case dispatches through launch_gb-nv.sh, which does export COLLX_TRANSPORT=mnnvl with no NODES-based branch (contrast launch_single-slurm.sh's scale-out branch).
    4. collx_apply_network_profile 2 mnnvl is called somewhere downstream; its gate [ "$nodes" -gt 1 ] && [ "$transport" != mnnvl ] evaluates 2 -gt 1 && mnnvl != mnnvl → false, so it returns immediately without validating anything.
    5. Same story for validate_container_network and the rank wrapper's branch — both keyed off the same transport != mnnvl test.
    6. Net effect: the KV shard runs without ever confirming the InfiniBand interfaces/HCAs named in the new network block actually exist on the allocated nodes.

    Why it's not a hard break: run_kv.py's export_ucx_selectors() pins UCX_NET_DEVICES/UCX_IB_GID_INDEX directly from COLLX_RDMA_DEVICES/COLLX_IB_GID_INDEX, independent of the mnnvl branch, and it derives GLOO_SOCKET_IFNAME similarly. So the actual UCX/gloo transfer likely still selects the right devices and runs correctly on a healthy node — the loss is specifically the pre-flight, fail-closed proof (that methodology.md documents as required for every non-MNNVL scale-out node) that those devices exist and are up, not a guaranteed crash or silently wrong measurement.

    How to fix: give launch_gb-nv.sh the same NODES>1 branch the other two launchers have — select an -rdma transport variant for the KV shard and call collx_validate_network_profile_on_job on it — so a bad or missing IB config on a gb200 node fails the shard early instead of running the transfer unvalidated. Note this is independent of the separately-reported COLLX_BENCH allowlist issue on the same launcher family: that gate is a backend-name check that happens after the COLLX_TRANSPORT=mnnvl assignment, so fixing it alone would still leave this transport hardcoding in place.

Oseltamivir added a commit that referenced this pull request Aug 7, 2026
…date gb-nv rdma legs

Review findings on #2510, both real. The launchers collx_die on COLLX_BENCH
values outside their EP enum, so every kv shard died at the identity stage;
nixl/mooncake/mori-io are now accepted where the registry schedules them,
pinned by a test that greps each SKU's launcher for its kv backends.

launch_gb-nv.sh also exported COLLX_TRANSPORT=mnnvl unconditionally, which
made a gb200 kv rdma leg the only scale-out fabric that skipped
collx_apply_network_profile, the rank wrapper's network branch, and
validate_container_network. kv rdma shards now carry mnnvl-rdma (the
workflow exports the shard mode) and the launcher proves the pinned socket
interface and HCAs on the allocation before running, like every other
scale-out launcher; mnnvl shards keep skipping, as elsewhere.
@Oseltamivir

Copy link
Copy Markdown
Collaborator Author

On the gb-nv transport finding from the review: fixed in dac114e. kv rdma shards on gb-nv now carry COLLX_TRANSPORT=mnnvl-rdma (the workflow exports the shard mode), which re-enables collx_apply_network_profile, the rank wrapper's network branch, and validate_container_network for those legs, and the launcher gained the same on-allocation collx_validate_network_profile_on_job check the other scale-out launchers run. mnnvl shards keep the mnnvl label and skip, as before.

Base automatically changed from collectivex-fixes to main August 10, 2026 06:19
@Oseltamivir
Oseltamivir requested a review from a team August 10, 2026 06:19
Oseltamivir added a commit that referenced this pull request Aug 10, 2026
…date gb-nv rdma legs

Review findings on #2510, both real. The launchers collx_die on COLLX_BENCH
values outside their EP enum, so every kv shard died at the identity stage;
nixl/mooncake/mori-io are now accepted where the registry schedules them,
pinned by a test that greps each SKU's launcher for its kv backends.

launch_gb-nv.sh also exported COLLX_TRANSPORT=mnnvl unconditionally, which
made a gb200 kv rdma leg the only scale-out fabric that skipped
collx_apply_network_profile, the rank wrapper's network branch, and
validate_container_network. kv rdma shards now carry mnnvl-rdma (the
workflow exports the shard mode) and the launcher proves the pinned socket
interface and HCAs on the allocation before running, like every other
scale-out launcher; mnnvl shards keep skipping, as elsewhere.
@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch from 72c1c3b to f2f36c3 Compare August 10, 2026 06:37
Comment thread .github/workflows/collectivex-sweep.yml Outdated
matrix.queue-token
)),
toJSON(format('ci-attempt-{0}', github.run_attempt))
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip-queue ignored without node slots

Medium Severity

skip_queue_pr is nested under NODE_SLOT_SCHEDULER_ENABLED, so the ci-skip-queue-pr-* label is only requested when the node-slot flag is on. With that flag unset or false, a filled skip_queue_pr falls through to the three-label runs-on path and the job queues normally. skip_queue_pr and node-slot matching are independent; the other sweep templates attach the skip-queue label whenever the priority scheduler is on.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c6e2d26. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 93feafc. Configure here.

@functionstackx

Copy link
Copy Markdown
Collaborator

Sorry, over the weekend, there was 2 major refactors to clean up the technical debt accumalated over the past 11 months of moving at the speed of light. We don't see any major refactors in the forthseeable future besides cleaning up AMD multinode AgentX pile of bash. As much, due to the refactors, u would need to ask your agent to rebase from remote main@latest. Thank you in advance for ur understanding

@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch from dc68d14 to 249ee19 Compare September 28, 2026 14:58
@Oseltamivir Oseltamivir changed the title CollectiveX: kv-transfer suite — NIXL + MoRI-IO KV-cache handoff benchmark (stacked on #2489) CollectiveX: kv-transfer suite — NIXL, Mooncake, MoRI-IO KV-cache handoff (stacked on #3541) Sep 28, 2026
@Oseltamivir
Oseltamivir changed the base branch from main to cx-swap-suite September 28, 2026 14:58
@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch from 249ee19 to 60dbf2b Compare September 28, 2026 15:20
Base automatically changed from cx-swap-suite to main September 28, 2026 15:37
@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch 2 times, most recently from 60dbf2b to 3b42529 Compare September 28, 2026 16:03
@Oseltamivir Oseltamivir changed the title CollectiveX: kv-transfer suite — NIXL, Mooncake, MoRI-IO KV-cache handoff (stacked on #3541) CollectiveX: kv-transfer suite — NIXL, Mooncake, MoRI-IO KV-cache handoff Sep 28, 2026
@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch from 8a01500 to 9f63c5c Compare October 31, 2026 10:39
@Oseltamivir Oseltamivir changed the title CollectiveX: kv-transfer suite — NIXL, Mooncake, MoRI-IO KV-cache handoff CollectiveX: kv-transfer suite on vLLM 0.32.0's DeepSeek-V4 layout, run by hand / CollectiveX:基于 vLLM 0.32.0 DeepSeek-V4 布局、手动运行的 kv-transfer 测试套件 Oct 31, 2026
@Oseltamivir
Oseltamivir force-pushed the collectivex-kv-transfer branch 3 times, most recently from bcd893c to 05d40cb Compare October 31, 2026 11:55
Time the prefill-to-decode KV-cache hop between one GPU on each of two
nodes, through NIXL and Mooncake, in the descriptor shape vLLM 0.32.0's
connectors post for DeepSeek-V4-Pro, verifying every timed transfer.

- Hand-run like the other suites: `run.sh <sku> --suite kv-transfer`
  resolves one shard per (backend, fabric) from the registry's
  kv_backends; the case codec, rank wrapper, launchers and run.sh carry
  the suite, and run.sh exports the shard's fabric.
- The workload follows the layout dumped from vLLM 0.32.0 on b300: group
  order, windowed groups moving only their live in-window blocks, NIXL's
  whole-row descriptors and the MooncakeConnector's five transfer regions.
- Each library runs vLLM's connector configuration on the builds the
  vllm/vllm-openai:v0.32.0 image ships; EFA pools swap in Mooncake's EFA
  build and bind the host libhwloc that NIXL's LIBFABRIC plugin needs.
- GB/s divides the request's KV bytes, the same for every backend, by the
  p50 burst latency; rows publish implementation.library_config.
- Mooncake is a candidate backend: vLLM 0.32.0 cannot start its
  MooncakeConnector for DeepSeek-V4.
- Results are case-attempt documents the app ingest accepts;
  results/cases.json, the summary and the docs cover the suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants