opencl: fix two issues on flash attention for Adreno a7x (#25697)

* opencl: route `sub_group_shuffle_xor` to qcom ext when KHR ext is unavailable

KHR `sub_group_shuffle_xor` is not defined by compiler when
`cl_qcom_subgroup_shuffle` is present, causing certain FA
kernels fail to build. Define the KHR shuffle_xor using
the qcom extension.

* opencl: skip FA kernels with mixed and quant types for A7x to avoid compiler crash
This commit is contained in:
Hongqiang Wang
2026-07-15 09:08:40 -07:00
committed by GitHub
parent f6f12e43fa
commit c3d47e696b
5 changed files with 24 additions and 0 deletions
+8
View File
@@ -7319,6 +7319,14 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
return false;
}
// Some compilers for A7x (Adreno 740, compiler E031.41) crashes when
// building FA kernels with mixed or quant types (f32_f16, f32_q8_0, f32_q4_0)
// Here we skip all A7x for these kernels to avoid crash
if (backend_ctx->adreno_gen == ADRENO_GPU_GEN::A7X &&
(is_f32_f16 || is_f32_q8_0 || is_f32_q4_0)) {
return false;
}
if (dk == 512) {
if (backend_ctx->gpu_family == INTEL) {
return false;