Commit d9dae0344 for llama.cpp
commit d9dae03443bd8cae19b2ecd75d5da316b0b238e7
Author: lhez <lih@qti.qualcomm.com>
Date: Wed Nov 25 11:20:30 2026 -0800
opencl: Adreno E17 compiler quirks off by default (#33013)
diff --git a/docs/backend/OPENCL.md b/docs/backend/OPENCL.md
index c912d331c..1f04e94ba 100644
--- a/docs/backend/OPENCL.md
+++ b/docs/backend/OPENCL.md
@@ -318,6 +318,7 @@ ninja
## Known Issues
+- Adreno E17 compiler workarounds are disabled by default. If you encounter Flash Attention compilation failures or incorrect MoE results, set `GGML_OPENCL_ADRENO_E17_QUIRKS=1` before starting llama.cpp.
- Flash attention does not always improve performance.
- Currently OpenCL backend works on A6xx GPUs with recent drivers and compilers (usually found in IoT platforms).
However, it does not work on A6xx GPUs found in phones with old drivers and compilers.
diff --git a/ggml/src/ggml-opencl/ggml-opencl.cpp b/ggml/src/ggml-opencl/ggml-opencl.cpp
index 18d8b9ce5..2770c1638 100644
--- a/ggml/src/ggml-opencl/ggml-opencl.cpp
+++ b/ggml/src/ggml-opencl/ggml-opencl.cpp
@@ -11958,8 +11958,12 @@ static bool adreno_e17_compiler_quirks(const ggml_backend_opencl_context *backen
backend_ctx->adreno_cl_compiler_version.type != ADRENO_CL_COMPILER_TYPE::E17) {
return false;
}
- const char * env = getenv("GGML_OPENCL_ADRENO_E17_QUIRKS");
- return !(env && env[0] == '0');
+
+ static const bool enabled = []() {
+ const char * e = getenv("GGML_OPENCL_ADRENO_E17_QUIRKS");
+ return e && e[0] && e[0] != '0';
+ }();
+ return enabled;
}
static bool ggml_cl_q2_k_use_noshuffle(const ggml_backend_opencl_context * backend_ctx, const ggml_tensor * tensor) {
@@ -12989,7 +12993,7 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
return true;
}
#endif
- // The E17 compilers segfault while building FA kernels, skip E17 for now
+ // Some E17 compilers crash while building FA kernels.
if (adreno_e17_compiler_quirks(backend_ctx)) {
return false;
}