Skip to content

pd: import dense subprocess KV into hybrid GPU cache groups (#258) - #283

Merged
gspark-etri merged 1 commit into
optimus-rmfrom
fix/258-dense-hybrid-kv-land
Oct 30, 2026
Merged

gspark-etri merged 1 commit into
optimus-rmfrom
fix/258-dense-hybrid-kv-land

Conversation

@gspark-etri

Copy link
Copy Markdown
Collaborator

Background

Subprocess prefill producers export KV as one dense tensor in model-layer order. A hybrid GPU receiver (PagedKV with several attention-geometry groups) expected one tensor per group, so dense imports into hybrid models failed (#258).

Changes

From fix/258-dense-hybrid-kv (#259), only:

  • opt_prime/opt_prime/accel/pd/paged.py: write_span splits a dense model-layer-order span into the receiver's groups by layer index, and validates group count, rank and every group's shape before copying any group. Diffed against optimus-rm: the only change is this function.
  • opt_prime/tests/test_pd_dense_hybrid.py (new).

Verification

  • pytest -q tests/test_pd_dense_hybrid.py: 4 passed.
  • Same file against the optimus-rm version of paged.py: 4 failed.
  • Full suite: CI (cpu-tests).

Compatibility and limits

  • Grouped (list) inputs and single-group dense inputs behave as before; invalid shapes now raise ValueError before any write instead of failing midway.
  • A dense span must contain every model layer.

Related Issue

Closes #258

Supersedes #259.

🤖 Generated with Claude Code

PagedKV.write_span splits dense model-layer-order KV (subprocess producers)
into the receiver's per-geometry groups and validates all shapes before any
copy. From fix/258-dense-hybrid-kv (#259).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gspark-etri
gspark-etri merged commit 4dd30cf into optimus-rm Oct 30, 2026
1 check passed
@gspark-etri
gspark-etri deleted the fix/258-dense-hybrid-kv-land branch October 30, 2026 00:57
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