Skip to content

Expose multi-view rollout layout options - #626

Open
aidanfnv wants to merge 3 commits into
NVIDIA:mainfrom
aidanfnv:dev/aidanf/multiview-inference
Open

aidanfnv wants to merge 3 commits into
NVIDIA:mainfrom
aidanfnv:dev/aidanf/multiview-inference

Conversation

@aidanfnv

@aidanfnv aidanfnv commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #617 that exposes two layout controls for optimized multi-view inference:

  • Forward configurable block-mask geometry through ChunkRollout and run_rollout, including asymmetric (Q, KV) block sizes.
  • Allow FixedSlotKVCache to use caller-owned K/V buffers, validating all layers before mutation and preserving aliased prefill data while clearing unused capacity.

Testing

  • Multi-view cache and rollout tests: 25 passed.
  • Ruff checks, formatting, and ty passed.

Signed-off-by: Aidan Foster <aidanf@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@aidanfnv

Copy link
Copy Markdown
Collaborator Author

/ok to test efb9950

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously reported cache initialization issues are fully addressed and no new actionable failures remain.

Summary

This PR exposes configurable block-mask geometry throughout multi-view rollout and adds validated caller-owned buffers to the fixed-slot KV cache.

  • Forwards scalar or asymmetric (Q, KV) block sizes through run_rollout and ChunkRollout.
  • Validates all caller-owned cache layers before mutation.
  • Copies prefill data before clearing unused capacity, preserving prefill views into the same buffer’s suffix.
  • Adds tests for external storage retention, atomic validation, alias-safe initialization, and asymmetric block geometry.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Caller[Rollout caller] -->|mask_block_size| Run[run_rollout]
    Run --> Chunk[ChunkRollout]
    Chunk --> Metadata[Attention metadata]
    Metadata -->|block_size| Mask[BlockMask]

    Prefill[Prefilled K/V] --> Cache[FixedSlotKVCache]
    Storage[Caller-owned K/V buffers] -->|validate all layers| Cache
    Cache -->|copy prefixes first| Prefix[Initialized cache prefixes]
    Cache -->|clear unused suffixes| Suffix[Zeroed spare capacity]
Loading

Reviews (3) · Last reviewed commit: "fix: preserve aliased cache prefill data"

Comment thread flashdreams/flashdreams/core/attention/kvcache.py Outdated
Comment thread flashdreams/flashdreams/core/attention/kvcache.py Outdated
Signed-off-by: Aidan Foster <aidanf@nvidia.com>
Comment thread flashdreams/flashdreams/core/attention/kvcache.py Outdated
Signed-off-by: Aidan Foster <aidanf@nvidia.com>
@aidanfnv

Copy link
Copy Markdown
Collaborator Author

/ok to test f5d0d1d

@NVIDIA NVIDIA deleted a comment from copy-pr-bot Bot Sep 15, 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