Skip to content

feat(cache): support FlashStates decode context parallelism - #1807

Merged
AlpinDale merged 1 commit into
feat/flashstatesfrom
feat/flashstates-context-parallel
Nov 13, 2026
Merged

AlpinDale merged 1 commit into
feat/flashstatesfrom
feat/flashstates-context-parallel

Conversation

@AlpinDale

@AlpinDale AlpinDale commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds decode context parallelism (DCP) support to FlashStates for supported attention/recurrent hybrid models.

DCP shards attention KV across ranks within a tensor-parallel group. This reduces each rank's attention-KV storage and distributes KV reads during decoding. Recurrent state keeps its existing tensor-parallel layout and receives no additional DCP sharding.

This PR preserves FlashStates checkpoint lookup and eviction when a recurrent checkpoint falls inside a larger logical attention page. Earlier retained checkpoints remain usable when that page fills or a conversation branches.

Example for GLM on 4 GPUs:

sonar serve nvidia/GLM-5.3-Flash-NVFP4 \
  --tensor-parallel-size 4 \
  --decode-context-parallel-size 4 \
  --cp-kv-cache-interleave-size 4 \
  --language-model-only \
  --enforce-eager \
  --max-model-len 32768 \
  --enable-prefix-caching \
  --mamba-frontier-checkpoint \
  --mamba-prefill-export \
  --prefix-cache-eviction gds \
  --prefill-cost-coefficients 1.862e-5 3.33e-6 \
  --prefix-cache-leaf-last

What changes?

  • --decode-context-parallel-size 4 forms DCP groups within TP. TP 4 / DCP 4 uses four GPUs in total.
  • --cp-kv-cache-interleave-size 4 matches GLM's four-token indexer compression.
  • Checkpoint lookup uses each cache group's logical token span. Attention groups must share a span divisible by the recurrent checkpoint span.
  • GDS eviction accounts for attention pages shared by multiple checkpoints.

Signed-off-by: AlpinDale <alpindale@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T16:31:12.684516Z 1a90edf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AlpinDale
AlpinDale added this pull request to stack #1810 November 13, 2026 16:50
@AlpinDale
AlpinDale merged commit 33a0078 into main Nov 13, 2026
2 checks passed
@AlpinDale
AlpinDale deleted the feat/flashstates-context-parallel branch November 22, 2026 11:26
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