Skip to content

ggml-cuda: fattn do not check oob if k_VKQ_0 = (k_VKQ_max - nbatch_fa) - #30572

Merged
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
thelittlefireman:fix-fattn-tile-oob-check
Oct 18, 2026
Merged

JohannesGaessler merged 1 commit into
ggml-org:masterfrom
thelittlefireman:fix-fattn-tile-oob-check

Conversation

@thelittlefireman

@thelittlefireman thelittlefireman commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Do not check oob if k_VKQ_0 = (k_VKQ_max - nbatch_fa)

Additional information

For example if k_VKQ_max = 256 and nbatch_fa = 128 :
Before:

  • First tile 0->127 : oob_check=false
  • Second tile 128->255 : oob_check=true (Not needed)

After:

  • First tile 0->127 : oob_check=false
  • Second tile 128->255 : oob_check=false

Both tile are full and does not need to be oob check.

Requirements

@thelittlefireman
thelittlefireman requested a review from a team as a code owner October 15, 2026 07:23
@thelittlefireman thelittlefireman changed the title ggml-cuda: fattn do not check oob if k_VKQ_max = (k_VKQ_max - nbatch_fa) ggml-cuda: fattn do not check oob if k_VKQ_0 = (k_VKQ_max - nbatch_fa) Oct 15, 2026
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning CUDA Related to the CUDA backend labels Oct 15, 2026
@JohannesGaessler
JohannesGaessler merged commit 5aeac37 into ggml-org:master Oct 18, 2026
14 of 15 checks passed
wispoffates added a commit to wispoffates/llama.cpp that referenced this pull request Oct 24, 2026
…e no-oob loop) -- p100-series keeps the v5.25 path

Gate R26: with ggml-org#30572 the gemma4 prefill KLD vs the F32 reference went 0.00187 -> 0.00367 (pf16 0.00266 -> 0.00287) and the gemma4
triage reply changed; decode (vec kernel) identical. Mathematically the same tile, but gemma4's fp16 tile-FA prefill on Pascal is
rounding-sensitive, and the KV views of a prefill (512/1024/1536/2048) are exact multiples of nbatch_fa = exactly the case it moves.
We declined it as a micro-opt at the 10-16 PR check; it arrived with the rebase. This reverts commit 5aeac37.

Assisted-by: Claude Opus 5.5 (Claude Code)
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
wispoffates added a commit to wispoffates/llama.cpp that referenced this pull request Oct 25, 2026
…e no-oob loop) -- p100-series keeps the v5.25 path

Gate R26: with ggml-org#30572 the gemma4 prefill KLD vs the F32 reference went 0.00187 -> 0.00367 (pf16 0.00266 -> 0.00287) and the gemma4
triage reply changed; decode (vec kernel) identical. Mathematically the same tile, but gemma4's fp16 tile-FA prefill on Pascal is
rounding-sensitive, and the KV views of a prefill (512/1024/1536/2048) are exact multiples of nbatch_fa = exactly the case it moves.
We declined it as a micro-opt at the 10-16 PR check; it arrived with the rebase. This reverts commit 5aeac37.

Assisted-by: Claude Opus 5.5 (Claude Code)
wispoffates added a commit to wispoffates/llama.cpp that referenced this pull request Oct 26, 2026
…e no-oob loop) -- p100-series keeps the v5.25 path

Gate R26: with ggml-org#30572 the gemma4 prefill KLD vs the F32 reference went 0.00187 -> 0.00367 (pf16 0.00266 -> 0.00287) and the gemma4
triage reply changed; decode (vec kernel) identical. Mathematically the same tile, but gemma4's fp16 tile-FA prefill on Pascal is
rounding-sensitive, and the KV views of a prefill (512/1024/1536/2048) are exact multiples of nbatch_fa = exactly the case it moves.
We declined it as a micro-opt at the 10-16 PR check; it arrived with the rebase. This reverts commit 5aeac37.

Assisted-by: Claude Opus 5.5 (Claude Code)
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants