ik_llama_opt/ggml/src
mb8565 72201359dd
CUDA: MLA flash-attention decode on Pascal (vec_f32 K=576/V=512), incl. Q8_0 KV (#2079)
On GPUs without FP16 tensor cores (Pascal / sm_60, e.g. Tesla P100) MLA
flash-attention decode falls back to the CPU. The !fp16_mma_available path
routes decode to the f16 vector kernel, whose is_supported check requires
K == V head sizes; MLA's absorbed head sizes are 576/512 (asymmetric), so it is
rejected and attention runs on the CPU. With --cpu-moe that recomputes the full
MLA attention on the CPU every decoded token, which dominates decode at long
context.

Route Pascal MLA decode (Q->ne[1] <= 8 && K == 576 && V == 512) to the f32
vector kernel and enable that kernel for the 576/512 case, including Q8_0 KV.

Scope: decode only (batch <= 8). Prefill (batch > 8) and -fa 0 are untouched;
tensor-core GPUs never reach this branch. Aligned head sizes are byte-identical
(the asymmetric/Q8_0 work folds to a no-op at compile time), so no other model
or configuration is affected.

- fattn.cu: route 576/512 decode to vec_f32 in the !fp16_mma dispatch and its
  is_supported mirror.
- fattn-vec-f32.cu/.cuh: accept + instantiate 576/512 (F16 and Q8_0); fix latent
  issues exposed by the first asymmetric/large-head use (KQ-row granularity uses
  FATTN_KQ_STRIDE not Dv; guard the dst store to tid < Dv; guard the softmax exp
  on the KV tail; size Q_i32 by ceil; only convert K/V to F16 when the type is
  F16). All are no-ops for the previously-exercised symmetric cases.
- fattn-vec-f32.cuh / fattn-vec-common.cuh: guard the Q8_0 ragged tail (Dk=576 is
  144 int32 lanes = 4.5 warps) with the ragged-dim idiom; compile-time-constant
  for aligned head dims, so it folds away.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 17:58:50 +02:00
..
cmake Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-cann Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
ggml-cuda CUDA: MLA flash-attention decode on Pascal (vec_f32 K=576/V=512), incl. Q8_0 KV (#2079) 2026-07-06 17:58:50 +02:00
ggml-sycl Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
iqk GLM-DSA: much better PP performance (CPU-only) (#2074) 2026-07-06 11:57:40 +02:00
kompute@4565194ed7 Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
kompute-shaders Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
llamafile Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
vulkan-shaders Port of Qwen3-VL support from mainline (#883) 2025-11-04 19:20:54 +02:00
CMakeLists.txt Fix Windows build after CUB addition (#2076) 2026-07-03 18:40:20 +02:00
ggml-aarch64.c Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
ggml-aarch64.h Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
ggml-alloc.c Support for Qwen 3.5 MTP (dense models only) (#1698) 2026-04-28 07:47:50 +02:00
ggml-backend-impl.h Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-backend.cpp GLM-DSA: improve TG performance even more (#2068) 2026-07-06 11:15:54 +02:00
ggml-cann.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-common.h Bonsai support (AVX2, generic) (#1570) 2026-04-02 16:54:08 +02:00
ggml-cuda.cu deepseek2 : GLM-DSA sparse attention (lightning indexer), --dsa off by default (#2045) 2026-07-02 09:36:49 +02:00
ggml-impl.h MXFP4 (#682) 2025-08-09 08:40:18 +03:00
ggml-kompute.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-metal.m Fix clang warnings on macOS (#1354) 2026-03-03 16:27:16 +01:00
ggml-metal.metal MXFP4 (#682) 2025-08-09 08:40:18 +03:00
ggml-quants.c Use AVX version VNNI intrinsic when AVX512VNNI not available. (#1748) 2026-05-09 09:02:06 +03:00
ggml-quants.h Quantization options (#1677) 2026-04-23 09:05:39 +02:00
ggml-rpc.cpp server: improve speed of speculative decoding (#1119) 2026-01-10 08:01:22 +02:00
ggml-sycl.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-vulkan.cpp Port of Qwen3-VL support from mainline (#883) 2025-11-04 19:20:54 +02:00
ggml.c GLM-DSA: much better PP performance (CPU-only) (#2074) 2026-07-06 11:57:40 +02:00