Skip to content

Generalize attention Q/KV modes#582

Merged
uuuvn merged 7 commits into
mainfrom
generalize_attention
Jul 6, 2026
Merged

Generalize attention Q/KV modes#582
uuuvn merged 7 commits into
mainfrom
generalize_attention

Conversation

@CC-Yeh

@CC-Yeh CC-Yeh commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  • Makes borrowed-cache query-only attention explicit for Gemma4-style sharing.
  • Adds split Q/KV primitives needed by DFlash:
    • ephemeral suffix attend
    • KV-only append
    • non-causal full KV state

@CC-Yeh CC-Yeh force-pushed the generalize_attention branch from ff8666f to ef037d6 Compare July 6, 2026 05:20
@CC-Yeh CC-Yeh changed the title Refactor Attention Generalize attention Q/KV modes Jul 6, 2026
@CC-Yeh CC-Yeh marked this pull request as ready for review July 6, 2026 06:26
@CC-Yeh CC-Yeh requested a review from uuuvn as a code owner July 6, 2026 06:26
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@CC-Yeh CC-Yeh requested a review from eugenebokhan July 6, 2026 06:26
utils::maybe_mut::MaybeMut,
};

pub(super) type AttentionPrepare<B> = <<B as Backend>::Kernels as Kernels>::AttentionPrepareKernel;

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.

This obscures what AttentionPrepare is by making it look like a block where in fact it is a kernel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced it with PrepareKernel

@CC-Yeh CC-Yeh force-pushed the generalize_attention branch from be91bf4 to 1d3b275 Compare July 6, 2026 08:51
@CC-Yeh CC-Yeh requested a review from uuuvn July 6, 2026 09:02
@uuuvn uuuvn merged commit adb9764 into main Jul 6, 2026
7 checks passed
@uuuvn uuuvn deleted the generalize_attention branch July 6, 2026 09:47
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.

2 participants