Skip to content

feat: share Fabric host KV shards across local workers. - #2974

Draft
rhythm-agent-infra wants to merge 1 commit into
xLLM-AI:mainfrom
rhythm-agent-infra:codex/feat/shared-fabric-host-kv-upstream
Draft

rhythm-agent-infra wants to merge 1 commit into
xLLM-AI:mainfrom
rhythm-agent-infra:codex/feat/shared-fabric-host-kv-upstream

Conversation

@rhythm-agent-infra

Copy link
Copy Markdown
Contributor

Description

A prefix written back by one data-parallel (DP) group can now be restored by another DP group on the same host. This extends the Fabric H2D and D2H path from #2967. Sharing is enabled when Fabric Host KV is active, the global KV store is disabled and all workers belong to the same Linux IPC namespace on one host.

  • The scheduler uses one Host block manager and prefix index for all participating DP groups. A Host block ID addresses the same slot in every shard. A prefix becomes visible after all workers acknowledge writeback, and an in-flight restore holds its source slot until completion.
  • At registration, rank zero allocates one shared HugeTLB segment per distinct shard of each target or draft KV component. Each worker attaches its shard and registers the mapping with its own NPU. Within the source DP group, one worker writes each distinct shard. All destination workers can restore the shard they need.

Validation

Four-rank Fabric transfer tests exercised replicated, partially replicated and fully sharded KV layouts. A scheduler test verified that a second DP group can restore a published Host block and that the slot can be reused after its last reader releases it.

The service runs used the same patch on the CANN 9.1-compatible revision of #2967 (301856def), with torch_npu 2.10.0.post4 on Ascend 910C. The published commit applies that patch to current main. End-to-end measurements on main's CANN 9.3 toolchain are pending.

Qwen3.8-27B Python BF16 ran with ACLGraph and asynchronous scheduling. Each run sent seven multimodal requests at concurrency one, with 2,314–2,323 input tokens and 300 output tokens each, then replayed them in order on the same service. The metrics below compare the first pass with prefix replay within each configuration.

Topology Speculative decoding Mean TTFT, first / replay (ms) Mean TPOT, first / replay (ms/token) Observed Host restore
DP2 × TP2 Off 598.04 / 277.96 27.419 / 27.257 All seven prefixes were written by one DP group and restored by the other, in both directions across the run. Each replay hit 1,536 tokens.
DP1 × TP4 MTP3 417.12 / 204.26 6.274 / 6.275 The first three replays loaded target and draft KV on all four ranks. The other four had no Host H2D.

In both configurations, every replay produced the same text and output token count as its first pass. Worker mappings showed two physical segments per target component at DP2 × TP2, with corresponding TP ranks in the two DP groups sharing a segment. DP1 × TP4 used four segments per target or draft component.

DP2 × TP2 with MTP3 stopped during image warmup before service readiness. The ACLGraph runner received one local input row while DP metadata specified four. Disabling Fabric and using ordinary Host KV reproduced the same mismatch with the same build and workload.

Change type and checks

  • New feature, with CLI documentation and tests.
  • Changed-file formatting and spelling checks passed on the published commit.

@netlify

netlify Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Netlify Deploy Preview ready

Built without sensitive environment variables

Name Link
🔨 Latest commit b73496c
🔍 Latest deploy log https://app.netlify.com/projects/xllm-docs-preview/deploys/6b1286eae3b12a68f96bb4ad
😎 Deploy Preview https://deploy-preview-2974--xllm-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@rhythm-agent-infra
rhythm-agent-infra marked this pull request as ready for review December 4, 2026 09:41
@rhythm-agent-infra
rhythm-agent-infra marked this pull request as draft December 4, 2026 09:42

This branch has not been deployed

No deployments
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