Commit 6d5f64872 for llama.cpp
commit 6d5f6487219ec7171a5558aa5d75b97c5720dad6
Author: Alexey Kopytko <alexey@kopytko.com>
Date: Wed Nov 25 18:48:31 2026 +0900
ggml-cpu : accept the flash_attn_ext indexed bias (#33016)
The reference implementation is in place, but the device rejected the op, so
test-backend-ops skipped all the indexed-bias cases. The spacemit FA path
leaves the op to the generic CPU path.
diff --git a/ggml/src/ggml-cpu/ggml-cpu.cpp b/ggml/src/ggml-cpu/ggml-cpu.cpp
index eadf943b6..b7e35d176 100644
--- a/ggml/src/ggml-cpu/ggml-cpu.cpp
+++ b/ggml/src/ggml-cpu/ggml-cpu.cpp
@@ -423,10 +423,6 @@ static ggml_backend_buffer_t ggml_backend_cpu_device_buffer_from_host_ptr(ggml_b
}
static bool ggml_backend_cpu_device_supports_op(ggml_backend_dev_t dev, const struct ggml_tensor * op) {
- if (ggml_flash_attn_ext_has_indexed_bias(op)) {
- return false;
- }
-
const struct ggml_tensor * src0 = op->src[0];
const struct ggml_tensor * src1 = op->src[1];
diff --git a/ggml/src/ggml-cpu/spacemit/ime.cpp b/ggml/src/ggml-cpu/spacemit/ime.cpp
index a23e70bc4..0486d2861 100644
--- a/ggml/src/ggml-cpu/spacemit/ime.cpp
+++ b/ggml/src/ggml-cpu/spacemit/ime.cpp
@@ -1047,8 +1047,8 @@ class tensor_traits_common : public tensor_traits_base {
return true;
}
case GGML_OP_FLASH_ATTN_EXT:
- // K/V row lists are handled by the generic CPU path
- if (op->src[5] != nullptr) {
+ // K/V row lists and the indexed bias are handled by the generic CPU path
+ if (op->src[5] != nullptr || ggml_flash_attn_ext_has_indexed_bias(op)) {
return false;
}
forward_flash_attn_ext_f16(params, op);