Skip to content

graph : avoid reallocations in the "no cache" path - #30439

Merged
ggerganov merged 1 commit into
masterfrom
gg/graph-avoid-no-cache-realloc
Oct 13, 2026
Merged

ggerganov merged 1 commit into
masterfrom
gg/graph-avoid-no-cache-realloc

Conversation

@ggerganov

Copy link
Copy Markdown
Member

Overview

cont #30416

Make the K/V pad unconditional in the "no cache" attention path. This avoids unnecessary graph reallocations by keeping the graph static.

Fixes: https://github.com/ggml-org/llama.cpp/actions/runs/38307883592/job/115006220055#step:3:36916

Before:

image

After:

image

Also optimize the BERT graph by arranging the GET_ROWS at the beginning:

Before:

image

After:

image

Additional information

Requirements

@ggerganov
ggerganov requested a review from CISC as a code owner October 13, 2026 07:58
@github-actions github-actions Bot added the model Model specific label Oct 13, 2026
@ggerganov
ggerganov merged commit 9880157 into master Oct 13, 2026
18 checks passed
@ggerganov
ggerganov deleted the gg/graph-avoid-no-cache-realloc branch October 13, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants