Repository navigation
model: use the indexed bias in the Inkling 2 graph - #33053
Merged
Merged
Conversation
Assisted-by: Codex
am17an
reviewed
Nov 25, 2026
Member
|
@pwilkin Mind reviewing RAON-1 PR so it can proceed (fix your notifications)? :) |
ngxson
approved these changes
Nov 25, 2026
am17an
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
ljedrz
added a commit
to ljedrz/llama.cpp
that referenced
this pull request
Nov 26, 2026
The gathered bias was made contiguous in the mask layout before the add; the add now takes the permuted gather and writes the contiguous mask itself. This is the layout the SYCL fusion of the gather and the add (GET_ROWS, RESHAPE, PERMUTE, ADD) matches. Port of a707963 ("model : inkling2 gathers the relative bias without two CONTs") onto the indexed bias of ggml-org#33053: the table layout is now the one flash attention takes, so the CONT of the table for the gather stays. Assisted-by: Claude Opus 5.5
ljedrz
added a commit
to ljedrz/llama.cpp
that referenced
this pull request
Nov 26, 2026
The relative-position bias without flash attention is added to the mask as a new n_kv x n_tokens x n_head tensor. Built after KQ, the gathered bias, the sum and KQ were all alive at once. Expanded before KQ, the gathered bias is freed first, so two such tensors are the peak instead of three. Inkling 2 Mini, Arc Pro B70, llama-server with --flash-attn off (measured before the rebase onto ggml-org#33053, whose non-FA path also makes the table contiguous for the gather: not re-measured): compute buffer at 65536 ctx / -ub 512 9652 -> 6584 MiB. With --spec-draft-n-ubatch 64 the server starts with ctx 131072 at -ub 256 (was 73728 at -ub 512 / -ub 64 for 262144) and runs a 124K token prompt: 670 s at -ub 64 -> 530 s at -ub 256. KLD over 6 chunks of wikitext-2: 0.0024 (-ub 64), 0.0019 (-ub 256), 0.0022 (-ub 4), at the noise of the backend. Assisted-by: Claude Opus 5.5
ljedrz
added a commit
to ljedrz/llama.cpp
that referenced
this pull request
Nov 26, 2026
The table product took R as [n_relative, n_head, n_tokens], so the 2D bias table was broadcast over the tokens and the SYCL backend ran it as one small GEMM per token (49152 oneMKL calls per 1024-token step). R is now reshaped to [n_relative, n_head*n_tokens] for one GEMM and the table back to [n_dist, n_head, n_tokens], as before ggml-org#33053. Inkling 2 Mini, Arc Pro B70, -fa 1 -ub 1024: pp4096 2027 -> 2352 t/s, pp1024 @ d32768 1757 -> 2008, tg64 unchanged; KLD on the 4096 chunk unchanged (0.001432). Assisted-by: Claude Opus 5.5
Mr-J-369
pushed a commit
to Mr-J-369/llama.cpp-Android
that referenced
this pull request
Nov 26, 2026
* use the indexed bias in the Inkling 2 graph * Remove RPC check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Enables the efficient indexed bias FATTN path in the Inkling 2 graph so that backends can start enabling it.
Additional information
Currently, no backends support it, so it will fall back to the dense path, requiring large amounts of VRAM for context. Backend support will be added gradually.
Requirements