Skip to content

vulkan: add iq4_nl support back to FA - #24585

Merged
jeffbolznv merged 2 commits into
ggml-org:masterfrom
jeffbolznv:fa_iq4_nl
Jul 28, 2026
Merged

jeffbolznv merged 2 commits into
ggml-org:masterfrom
jeffbolznv:fa_iq4_nl

Conversation

@jeffbolznv

@jeffbolznv jeffbolznv commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Overview

I was originally concerned about wasting shared memory on the LUT, but it's small and unlikely to matter in practice.

Also support q1_0 for non-coopmat2. Removed q1_0 FA support.

Fixes #23681

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, used codex, I've reviewed and tested everything.

@jeffbolznv
jeffbolznv requested a review from a team as a code owner June 13, 2026 16:50
@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Jun 13, 2026
@0cc4m

0cc4m commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

I think it would make more sense to remove q1_0 instead of expanding it. Is there any valid use of that?

@CISC

CISC commented Jun 15, 2026

Copy link
Copy Markdown
Member

I think it would make more sense to remove q1_0 instead of expanding it. Is there any valid use of that?

Bonsai (and @Green-Sky KV-experiments). :)

@0cc4m

0cc4m commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

I know about Bonsai, but I mean specifically for KV.

@CISC

CISC commented Jun 15, 2026

Copy link
Copy Markdown
Member

I know about Bonsai, but I mean specifically for KV.

#21273 (comment)

@Green-Sky

Copy link
Copy Markdown
Collaborator

My conclusion was that its not really useful, beside showing that the bit per weight perplexity ceiling is surprisingly low with the rotation stuff. :)

@0cc4m

0cc4m commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

I would prefer to remove it (as in its FA support), instead of adding more support on top, but it's not a strong opinion. Sorry for the delay.

I was originally concerned about wasting shared memory on the LUT, but it's small
and unlikely to matter in practice.

Also support q1_0 for non-coopmat2.

Fixes ggml-org#23681
@jeffbolznv

Copy link
Copy Markdown
Contributor Author

I've removed q1_0 support for FA in ggml-vulkan.

@0cc4m 0cc4m left a comment

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 is fine, my only concern is increasing shmem use for the other types, some instances of the shader are already using too much IIRC.

@jeffbolznv
jeffbolznv merged commit 8161641 into ggml-org:master Jul 28, 2026
23 of 27 checks passed
Nathanw1014 added a commit to Nathanw1014/llama.cpp that referenced this pull request Jul 28, 2026
…iq4_nl fix)

iq4_nl has no native FA shader on the scalar/coopmat1 paths: the FaTypeK/
FaTypeV spec constants select dequant code that silently reads garbage for
types outside the native list, which is how the iq4_nl+sinks FLASH_ATTN_EXT
failures (ERR=inf) escaped - supports_op admitted iq4_nl under conditions
the dispatch-time gate could then reject, falling back to the garbage-
reading native shader.

Introduce ggml_vk_fa_kv_native() as the single source of truth for which
K/V types the FA shaders read directly, force the dequant-once path for
non-native types (bypassing only the VRAM heuristic, never the hard
gates), mirror every hard gate in supports_op so dispatch and admission
agree, and assert the invariant at dispatch.

Extracted from the iq4_nl+sinks investigation (separate session); its
test cases land with that work. Split out of a mixed commit so this
change and the f16 contiguize default flip are independently
cherry-pickable; note upstream 8161641 "vulkan: add iq4_nl support back
to FA (ggml-org#24585)" touches the same area and must be reconciled before any
upstream submission.

Co-Authored-By: Claude Fable 5 <[email protected]>
huaxel pushed a commit to huaxel/strix-llama.cpp that referenced this pull request Aug 2, 2026
* vulkan: add iq4_nl support back to FA

I was originally concerned about wasting shared memory on the LUT, but it's small
and unlikely to matter in practice.

Also support q1_0 for non-coopmat2.

Fixes ggml-org#23681

* remove q1_0 FA support
satindergrewal pushed a commit to satindergrewal/llama.cpp that referenced this pull request Aug 12, 2026
* vulkan: add iq4_nl support back to FA

I was originally concerned about wasting shared memory on the LUT, but it's small
and unlikely to matter in practice.

Also support q1_0 for non-coopmat2.

Fixes ggml-org#23681

* remove q1_0 FA support
thecodacus pushed a commit to thecodacus/llama.cpp that referenced this pull request Sep 7, 2026
* vulkan: add iq4_nl support back to FA

I was originally concerned about wasting shared memory on the LUT, but it's small
and unlikely to matter in practice.

Also support q1_0 for non-coopmat2.

Fixes ggml-org#23681

* remove q1_0 FA support
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
* vulkan: add iq4_nl support back to FA

I was originally concerned about wasting shared memory on the LUT, but it's small
and unlikely to matter in practice.

Also support q1_0 for non-coopmat2.

Fixes ggml-org#23681

* remove q1_0 FA support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval bug: vulkan performance drop pp512 560 -> 180

4 participants