Skip to content

vulkan: fix Flash Attention shmem write out of bounds - #29988

Merged
0cc4m merged 1 commit into
masterfrom
0cc4m/vulkan-flash-attn-fix-oob-shmem
Oct 5, 2026
Merged

0cc4m merged 1 commit into
masterfrom
0cc4m/vulkan-flash-attn-fix-oob-shmem

Conversation

@0cc4m

@0cc4m 0cc4m commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Overview

Fixes the Nvidia DeviceLost crash found in #29958 (comment)

Requirements

@0cc4m
0cc4m requested a review from a team as a code owner October 5, 2026 10:25
@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 Oct 5, 2026
@0cc4m
0cc4m merged commit 6c59c40 into master Oct 5, 2026
14 of 18 checks passed
@0cc4m
0cc4m deleted the 0cc4m/vulkan-flash-attn-fix-oob-shmem branch October 5, 2026 13:15
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 8, 2026
asf0 pushed a commit to asf0/strix-llama.cpp that referenced this pull request Oct 12, 2026
halo-box/llama.cpp is archived, so its last master comes in once: the
2026-10-07 upstream sync (halo halo-box#34) with its resolutions, plus the archival
README of that repository is not taken (strix keeps its own README).

Resolution rules: MTP follows upstream's design; everywhere else strix's
side wins where the two collide, and upstream's non-conflicting changes stay.

- qwen4exp: strix's QSA stack (selected-key / WMMA block selection,
  incremental pooled keys, PLE prefetch, HIP prefill work) is kept whole in
  qwen4exp.cpp and the qwen4exp struct of models.h. strix's graph_mtp is kept:
  it builds the same draft as upstream's ggml-org#29761 (eh_proj of [enorm(e);
  hnorm(h)], the draft's own nextn.hc_head_* mixer, sparse QSA attention) and
  also loads shared sidecars without embeddings / LM head. The converter,
  gguf-py tensor maps and arch tables are upstream's, so new conversions
  follow upstream's layout; strix loads both.
- llama-memory-hybrid-idx: both APIs kept side by side - strix's qsa_* for
  qwen4exp and upstream's k-pool for the new GLM5Next (ggml-org#27773 and follow-ups).
  strix's context set_input_qsa, which upstream deleted, is restored.
- llama-graph: strix's in-place gated-delta-net state path is kept; upstream's
  single recurrent-state gather (ggml-org#29856, avoids a realloc abort under
  GGML_SCHED_NO_REALLOC) is reverted on this path and needs porting.
- vulkan: strix's flash_attn.comp and lightning_indexer.comp are kept whole;
  upstream's FA shmem out-of-bounds fix (ggml-org#29988) is ported into strix's
  shader. Upstream's lightning indexer rewrite (ggml-org#29825) is reverted on the
  Vulkan host side to match strix's shader; its CUDA/Metal parts stay.
  Upstream's sparse FA path (ggml-org#29639) stays out: strix deleted its shader.
- ggml-alloc: upstream's alloc_buffer_n refactor (ggml-org#23671) replaces strix's
  backport of the view-init fix; strix's regression test is kept.
- cuda: strix's RDNA3.5 paths kept; upstream's shared-expert MoE fusion added
  next to strix's fused GDN decode, with both sets of fusion args.
- server: speculative accept keeps strix's replay branch, then upstream's
  rejection sampling at temp > 0.
- tests: both sides' new tests kept (rollback table gets both columns,
  save-load-state test 10 is strix's, 11 upstream's); strix's rollback test
  migrated to common_batch / llama_process.
- fusion.yml kept (upstream removed it), flash_attn_sparse_compact.comp
  stays deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nathanw1014 pushed a commit to Nathanw1014/llama.cpp that referenced this pull request Oct 24, 2026
(cherry picked from commit 6c59c40)

[fork port: conflict resolved by hand. The fork's MMQ Q quantization uses
FLOAT_TYPE math and FA_TYPE_Q8_0, and skips the row-sum reduction for
Q8_0 K. Kept that, moved the subgroupClusteredAdd out of the r < Br
guard so every lane still joins it, and guarded the Qf writes with
r < Br as upstream does.]
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
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.

5 participants