Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-sycl/fattn-onednn.cpp # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-sycl / fattn-onednn.cpp` 426 lines ยท 20638 bytes Raw Blame History 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 #include "fattn-onednn.hpp" 11 #include "fattn-tile.hpp" 12 #include "convert.hpp" 13 14 // set minimum query length to treat as prefill (32) 15 #define GGML_SYCL_FA_ONEDNN_MIN_Q 32 16 17 bool ggml_sycl_fattn_onednn_binds_kv(const ggml_tensor * K, const ggml_tensor * V) { 18 if (K->type != GGML_TYPE_F16 || V->type != GGML_TYPE_F16) { 19 return false; 20 } 21 auto bindable = [](const ggml_tensor * t) { 22 return t->nb[0] == sizeof(sycl::half) && t->nb[1] % sizeof(sycl::half) == 0 && 23 t->nb[2] % sizeof(sycl::half) == 0 && t->nb[3] % sizeof(sycl::half) == 0; 24 }; 25 return bindable(K) && bindable(V); 26 } 27 28 bool ggml_sycl_flash_attn_ext_onednn_supported(const ggml_tensor * dst, bool use_shape_limit) { 29 #if !GGML_SYCL_DNNL 30 GGML_UNUSED(dst); 31 GGML_UNUSED(use_shape_limit); 32 return false; 33 #else 34 if (!g_ggml_sycl_fa_onednn) { 35 return false; 36 } 37 // without a fused SDPA kernel oneDNN falls back to the same matmul, so reuse the check 38 if (!ggml_sycl_dnnl_has_optimized_gemm(ggml_sycl_get_device())) { 39 return false; 40 } 41 const ggml_tensor * Q = dst->src[0]; 42 const ggml_tensor * K = dst->src[1]; 43 const ggml_tensor * V = dst->src[2]; 44 const ggml_tensor * mask = dst->src[3]; 45 const ggml_tensor * sinks = dst->src[4]; 46 47 // F16 KV: native SDPA at any KV length. 48 // Non-F16: dequant to F16 then SDPA at prefill lengths. Only the 49 // standard quantized KV cache types (Q4_0-Q8_0) and F32 are accepted 50 // because their to_fp16_sycl conversion is verified. BF16 and IQ* 51 // are excluded: BF16 needs a strided conversion kernel that does not 52 // exist yet; IQ types are model-weight-only quants with no dequant 53 // registration and are never used as KV caches. 54 if (K->type != GGML_TYPE_F16 || V->type != GGML_TYPE_F16) { 55 auto kt = K->type, vt = V->type; 56 bool k_ok = kt == GGML_TYPE_F32 || kt == GGML_TYPE_Q4_0 || kt == GGML_TYPE_Q4_1 || 57 kt == GGML_TYPE_Q5_0 || kt == GGML_TYPE_Q5_1 || kt == GGML_TYPE_Q8_0; 58 bool v_ok = vt == GGML_TYPE_F32 || vt == GGML_TYPE_Q4_0 || vt == GGML_TYPE_Q4_1 || 59 vt == GGML_TYPE_Q5_0 || vt == GGML_TYPE_Q5_1 || vt == GGML_TYPE_Q8_0; 60 if (!k_ok || !v_ok) { 61 return false; 62 } 63 if (use_shape_limit && (Q->ne[1] < 32 || K->ne[1] < 1024)) { 64 return false; 65 } 66 for (const ggml_tensor * t : {K, V}) { 67 if (t->type == GGML_TYPE_F16 && t->nb[1] % (t->ne[0] * 2) != 0) { 68 return false; 69 } 70 } 71 } 72 // This is the improved SPDA gate. Rather than gating Alchemist GPUs from all SPDA features, we instead target only the failing shapes. 73 // If the GPU being assessed isn't in the grouping below, it has full access to all SPDA shapes. Otherwise, if it's an Alchemist GPU, we block only the shapes with head sizes that fail. 74 // It is much easier to compare the device to a small list of failing cases than to define all the passing ones. 75 const gpu_arch arch = ggml_sycl_info().devices[ggml_sycl_get_device()].hw_info.arch; 76 bool support_spda = !(arch == gpu_arch::intel_gpu_dg2_g10 || 77 arch == gpu_arch::intel_gpu_dg2_g11 || 78 arch == gpu_arch::intel_gpu_dg2_g12); 79 80 if (!support_spda && K->ne[0] == 64) { 81 return false; 82 } 83 // Optional KV-length ceiling (GGML_SYCL_FA_ONEDNN_MAX_KV, 0 = unlimited). Escape hatch: 84 // very long sequences make the fused SDPA slow enough to risk the xe driver watchdog on 85 // some stacks; past the cap we fall back to the native FA kernel instead. 86 if (g_ggml_sycl_fa_onednn_max_kv > 0 && K->ne[1] > g_ggml_sycl_fa_onednn_max_kv) { 87 return false; 88 } 89 // gate for the following cases 90 // 1. if the oneDNN graph Add node has no input --> skip 91 // 2. types other than f16 need different logical_tensor declaration 92 // 3. the mask must be shape [1, 1, q, seq] 93 // 4. sinks: excludes attention sink (Xiao et al., 2024) that can't be modeled by oneDNN graph 94 if (!mask || mask->type != GGML_TYPE_F16 || mask->ne[2] != 1 || mask->ne[3] != 1 || sinks) { 95 return false; 96 } 97 float max_bias = 0.0f, logit_softcap = 0.0f; 98 memcpy(&max_bias, (const float *) dst->op_params + 1, sizeof(float)); 99 memcpy(&logit_softcap, (const float *) dst->op_params + 2, sizeof(float)); 100 if (max_bias != 0.0f || logit_softcap != 0.0f) { 101 return false; 102 } 103 // K and V must share head_dim: the SDPA graph uses a single `d` for both. 104 const int64_t d = K->ne[0]; 105 if (V->ne[0] != d || Q->ne[3] != 1) { 106 return false; 107 } 108 // GQA must divide evenly. 109 if (K->ne[2] == 0 || Q->ne[2] % K->ne[2] != 0) { 110 return false; 111 } 112 // Prefill only. 113 if (use_shape_limit && Q->ne[1] < GGML_SYCL_FA_ONEDNN_MIN_Q) { 114 return false; 115 } 116 return true; 117 #endif 118 } 119 120 #if GGML_SYCL_DNNL 121 122 #include "dnnl.hpp" 123 #include "dnnl_sycl.hpp" 124 #include "oneapi/dnnl/dnnl_graph.hpp" // graph API lives only under oneapi/dnnl/, not at the include root 125 126 using namespace dnnl; 127 using namespace dnnl::graph; 128 129 // strided src (f16 or f32) -> contiguous f16 [ne0,ne1,ne2,ne3] (ne0 innermost). nb* are BYTE strides. 130 template 131 static void cont_to_f16_sycl(const char * src, sycl::half * dst, 132 int64_t ne0, int64_t ne1, int64_t ne2, int64_t ne3, 133 size_t nb1, size_t nb2, size_t nb3, dpct::queue_ptr stream) { 134 const int64_t n = ne0 * ne1 * ne2 * ne3; 135 stream->parallel_for(sycl::range<1>(n), [=](sycl::id<1> ix) { 136 const int64_t gid = ix[0]; 137 int64_t i = gid; 138 const int64_t i0 = i % ne0; i /= ne0; 139 const int64_t i1 = i % ne1; i /= ne1; 140 const int64_t i2 = i % ne2; const int64_t i3 = i / ne2; 141 const src_t * p = (const src_t *) (src + i1 * nb1 + i2 * nb2 + i3 * nb3) + i0; 142 dst[gid] = (sycl::half) (*p); 143 }); 144 } 145 146 // oneDNN SDPA out (f16 contiguous [mb,H,q,d]) -> ggml dst (f32 [head_dim,H,n_tok,mb], contiguous). 147 static void permute_sdpa_out_sycl(const sycl::half * out, float * dst, 148 int64_t mb, int64_t H, int64_t q, int64_t d, dpct::queue_ptr stream) { 149 const int64_t n = mb * H * q * d; 150 stream->parallel_for(sycl::range<1>(n), [=](sycl::id<1> ix) { 151 const int64_t gid = ix[0]; 152 int64_t i = gid; 153 const int64_t e = i % d; i /= d; 154 const int64_t t = i % q; i /= q; 155 const int64_t h = i % H; const int64_t b = i / H; 156 dst[e + h * d + t * d * H + b * d * H * q] = (float) out[gid]; 157 }); 158 } 159 160 struct sdpa_partition { 161 compiled_partition cp; 162 std::vector ins; 163 logical_tensor out; 164 size_t id_q = 0, id_k = 0, id_v = 0, id_scale = 0, id_mask = 0; 165 bool ok = false; 166 }; 167 168 // Build + compile the contiguous-input GQA SDPA graph (MatMul->Divide->Add->SoftMax->MatMul), f32 out. 169 // Mirrors the hardware-verified scratch/onednn_sdpa_probe.cpp build_gqa (partitions=1, sdp_primitive_kernel_t). 170 static sdpa_partition build_sdpa(const engine & eng, int H, int Hkv, int q, int seq, int d, 171 const std::array & k_str, const std::array & v_str) try { 172 using ltype = logical_tensor::layout_type; 173 using dt = logical_tensor::data_type; 174 using ldims = logical_tensor::dims; 175 const dt fi = dt::f32, t = dt::f16; 176 const int rep = H / Hkv; 177 const ldims q_sz = {1, Hkv, rep, q, d}, kv_sz = {1, Hkv, 1, seq, d}, s_sz = {1, Hkv, rep, q, seq}, 178 sc = {1, 1, 1, 1, 1}, msk = {1, 1, 1, q, seq}, o_sz = {1, Hkv, rep, q, d}; 179 const ldims k_st(k_str.begin(), k_str.end()), v_st(v_str.begin(), v_str.end()); 180 int64_t id = 0; 181 sdpa_partition E; 182 183 auto query = logical_tensor(id++, t, q_sz, ltype::strided); 184 auto key = logical_tensor(id++, t, kv_sz, k_st); 185 auto score = logical_tensor(id++, fi, s_sz, ltype::strided); 186 auto bmm1 = op(id++, op::kind::MatMul, "bmm1"); 187 bmm1.set_attr(op::attr::transpose_b, true); // key is [.., seq, d] 188 bmm1.add_inputs({query, key}); bmm1.add_outputs({score}); 189 190 auto scale = logical_tensor(id++, t, sc, ltype::strided); 191 auto scaled = logical_tensor(id++, fi, s_sz, ltype::strided); 192 auto sdiv = op(id++, op::kind::Divide, "scale_div"); // score / (1/kq_scale) == score * kq_scale 193 sdiv.add_inputs({score, scale}); sdiv.add_outputs({scaled}); 194 195 auto mask = logical_tensor(id++, t, msk, ltype::strided); 196 auto masked = logical_tensor(id++, fi, s_sz, ltype::strided); 197 auto madd = op(id++, op::kind::Add, "mask_add"); 198 madd.add_inputs({scaled, mask}); madd.add_outputs({masked}); 199 200 auto probs = logical_tensor(id++, t, s_sz, ltype::strided); 201 auto smax = op(id++, op::kind::SoftMax, "softmax"); 202 smax.set_attr(op::attr::axis, -1); 203 smax.set_attr(op::attr::mode, "inf_as_zero"); 204 smax.add_inputs({masked}); smax.add_outputs({probs}); 205 206 auto value = logical_tensor(id++, t, kv_sz, v_st); 207 // f16 output is REQUIRED to hit sdp_primitive_kernel_t (the systolic micro-kernel); an f32 output 208 // falls to larger_partition_kernel_t which materializes N^2 (confirmed: scratch/onednn_sdpa_kernel_probe.cpp). 209 // converted to the f32 ggml dst in the permute below. 210 auto output = logical_tensor(id++, t, o_sz, ltype::strided); // f16 contiguous [mb,Hkv,rep,q,d] 211 auto bmm2 = op(id++, op::kind::MatMul, "bmm2"); 212 bmm2.add_inputs({probs, value}); bmm2.add_outputs({output}); 213 214 dnnl::graph::graph g(eng.get_kind()); 215 g.add_op(bmm1); g.add_op(sdiv); g.add_op(madd); g.add_op(smax); g.add_op(bmm2); 216 g.finalize(); 217 218 auto parts = g.get_partitions(); 219 if (parts.size() != 1 || !parts[0].is_supported()) { 220 GGML_LOG_WARN("%s: oneDNN did not fuse the SDPA graph; falling back to TILE kernel\n", __func__); 221 return E; // ok stays false -> caller falls back to TILE 222 } 223 E.ins = parts[0].get_input_ports(); 224 E.out = parts[0].get_output_ports()[0]; 225 E.cp = parts[0].compile(E.ins, {E.out}, eng); 226 E.out = E.cp.query_logical_tensor(E.out.get_id()); 227 E.id_q = query.get_id(); E.id_k = key.get_id(); E.id_v = value.get_id(); 228 E.id_scale = scale.get_id(); E.id_mask = mask.get_id(); 229 E.ok = true; 230 return E; 231 } 232 catch (const std::exception & e) { 233 // compile() can reject a stride set the partitioner never inspects; memoise the failure so the 234 // fallback costs one build rather than one per call. 235 GGML_LOG_WARN("%s: oneDNN SDPA partition build failed (%s); falling back to TILE kernel\n", __func__, e.what()); 236 return {}; 237 } 238 239 void ggml_sycl_flash_attn_ext_onednn(ggml_backend_sycl_context & ctx, ggml_tensor * dst) try { 240 const ggml_tensor * Q = dst->src[0]; 241 const ggml_tensor * K = dst->src[1]; 242 const ggml_tensor * V = dst->src[2]; 243 const ggml_tensor * mask = dst->src[3]; 244 245 const int64_t d = K->ne[0]; // head_dim 246 const int64_t seq = K->ne[1]; // n_kv 247 const int64_t Hkv = K->ne[2]; // n_head_kv 248 const int64_t H = Q->ne[2]; // n_head 249 const int64_t q = Q->ne[1]; // n_tok 250 const int64_t mb = Q->ne[3]; // batch (== 1, gated) 251 252 float kq_scale = 1.0f; 253 memcpy(&kq_scale, (const float *) dst->op_params + 0, sizeof(float)); 254 255 dpct::queue_ptr stream = ctx.stream(); 256 dnnl::engine eng = ctx.engine_dnnl(stream); 257 dnnl::stream strm = ctx.stream_dnnl(stream); 258 259 const ggml_sycl_fattn_extra extra = ggml_sycl_fattn_get_extra(dst); 260 261 // Q: always f32 -- copy to dense f16. 262 std::optional> Qf_pool; 263 sycl::half * Qf_ptr = (sycl::half *) extra.Q_buffer_ptr; 264 if (!Qf_ptr) { 265 Qf_pool.emplace(ctx.pool(), (size_t) H * q * d); 266 Qf_ptr = Qf_pool->get(); 267 } 268 cont_to_f16_sycl((const char *) Q->data, Qf_ptr, d, q, H, mb, Q->nb[1], Q->nb[2], Q->nb[3], stream); 269 270 // K/V: bind the f16 cache in place. llama.cpp permutes it to [token][head][dim], so its head 271 // plane is strided rather than dense, which is what an explicit stride vector expresses. 272 // Quantized and f32 KV still stage a dense copy -- the layout the k_str/v_str defaults describe. 273 sycl::half * K_ptr = nullptr; 274 sycl::half * V_ptr = nullptr; 275 std::array k_str{ Hkv * seq * d, seq * d, seq * d, d, 1 }; 276 std::array v_str = k_str; 277 std::optional> Kf_pool; 278 std::optional> Vf_pool; 279 // Helper: hand out reserved space, or fall back to the pool. 280 auto stage_k = [&](size_t n) { if (extra.K_buffer_ptr) { return (sycl::half *) extra.K_buffer_ptr; } 281 Kf_pool.emplace(ctx.pool(), n); return Kf_pool->get(); }; 282 auto stage_v = [&](size_t n) { if (extra.V_buffer_ptr) { return (sycl::half *) extra.V_buffer_ptr; } 283 Vf_pool.emplace(ctx.pool(), n); return Vf_pool->get(); }; 284 285 auto elem_strides = [](const ggml_tensor * t) { 286 const int64_t s1 = (int64_t) (t->nb[1] / t->nb[0]); 287 const int64_t s2 = (int64_t) (t->nb[2] / t->nb[0]); 288 const int64_t s3 = (int64_t) (t->nb[3] / t->nb[0]); 289 // dims are {mb=1, Hkv, rep=1, seq, d}; the size-1 dims at 0 and 2 never advance an address. 290 return std::array{ s3, s2, s2, s1, 1 }; 291 }; 292 293 if (ggml_sycl_fattn_onednn_binds_kv(K, V)) { 294 K_ptr = (sycl::half *) K->data; 295 V_ptr = (sycl::half *) V->data; 296 k_str = elem_strides(K); 297 v_str = elem_strides(V); 298 } else if (K->type == GGML_TYPE_F16 && V->type == GGML_TYPE_F16) { 299 K_ptr = stage_k((size_t) Hkv * seq * d); 300 V_ptr = stage_v((size_t) Hkv * seq * d); 301 cont_to_f16_sycl((const char *) K->data, K_ptr, d, seq, Hkv, mb, K->nb[1], K->nb[2], K->nb[3], stream); 302 cont_to_f16_sycl((const char *) V->data, V_ptr, d, seq, Hkv, mb, V->nb[1], V->nb[2], V->nb[3], stream); 303 } else if (ggml_is_quantized(K->type)) { 304 // Quantized K/V: dequant to dense F16 using pool, same lifetime as F16 path. 305 K_ptr = stage_k((size_t) ggml_nelements(K)); 306 { 307 const char * K_data = (const char *)K->data; 308 const bool k_non_dense = ((int64_t)K->ne[1] * K->nb[1] != K->nb[2]) && K->ne[2] > 1; 309 if (ggml_is_contiguously_allocated(K) && !k_non_dense) { 310 to_fp16_sycl_t to_fp16 = ggml_get_to_fp16_sycl(K->type, dst); 311 to_fp16(K_data, K_ptr, ggml_nelements(K), stream); 312 } else { 313 const size_t ts = ggml_type_size(K->type); 314 to_fp16_nc_sycl_t to_fp16 = ggml_get_to_fp16_nc_sycl(K->type); 315 to_fp16(K_data, K_ptr, 316 K->ne[0], K->ne[1], K->ne[2], K->ne[3], 317 (int64_t)K->nb[1] / ts, (int64_t)K->nb[2] / ts, (int64_t)K->nb[3] / ts, stream); 318 } 319 } 320 // Quantized V: always dequant separately. Even when K and V share 321 // the same underlying allocation (V is a view of K with the same 322 // data pointer), their logical values differ because the quantized 323 // elements at different positions/offsets represent different K/V 324 // data. Master's F16 path also never aliases K and V. 325 V_ptr = stage_v((size_t) ggml_nelements(V)); 326 { 327 const char * V_data = (const char *)V->data; 328 const bool v_non_dense = ((int64_t)V->ne[1] * V->nb[1] != V->nb[2]) && V->ne[2] > 1; 329 if (ggml_is_contiguously_allocated(V) && !v_non_dense) { 330 to_fp16_sycl_t to_fp16 = ggml_get_to_fp16_sycl(V->type, dst); 331 to_fp16(V_data, V_ptr, ggml_nelements(V), stream); 332 } else { 333 const size_t ts = ggml_type_size(V->type); 334 to_fp16_nc_sycl_t to_fp16 = ggml_get_to_fp16_nc_sycl(V->type); 335 to_fp16(V_data, V_ptr, 336 V->ne[0], V->ne[1], V->ne[2], V->ne[3], 337 (int64_t)V->nb[1] / ts, (int64_t)V->nb[2] / ts, (int64_t)V->nb[3] / ts, stream); 338 } 339 } 340 } else { 341 // F32: strided copy to dense F16 via cont_to_f16_sycl. 342 K_ptr = stage_k((size_t) ggml_nelements(K)); 343 cont_to_f16_sycl((const char *) K->data, K_ptr, K->ne[0], K->ne[1], K->ne[2], K->ne[3], 344 K->nb[1], K->nb[2], K->nb[3], stream); 345 V_ptr = stage_v((size_t) ggml_nelements(V)); 346 cont_to_f16_sycl((const char *) V->data, V_ptr, V->ne[0], V->ne[1], V->ne[2], V->ne[3], 347 V->nb[1], V->nb[2], V->nb[3], stream); 348 } 349 350 // divide-by-(1/scale) reproduces ggml's score *= kq_scale on the proven probe graph. 351 // 352 // The scale must not be uploaded with an async memcpy from a stack local: on the in-order 353 // queue that copy waits behind the K/V staging kernels, and once those take long enough 354 // (n_kv >= ~26k on B70) the host frame is recycled before the copy runs, feeding the SDPA a 355 // garbage scale (output collapses to a repeated token). Write the scalar from a kernel 356 // instead -- the value is captured into the command, so no host memory has to outlive the 357 // call, and the enqueue stays async. 358 const sycl::half scale_h = (sycl::half) (1.0f / kq_scale); 359 std::optional> scbuf; 360 sycl::half * scale_dev = (sycl::half *) extra.scale_buffer_ptr; 361 if (!scale_dev) { 362 scbuf.emplace(ctx.pool(), 1); 363 scale_dev = scbuf->get(); 364 } 365 stream->single_task([=]() { *scale_dev = scale_h; }); 366 367 // f16 contiguous SDPA out [mb,H,q,d] 368 std::optional> outf_pool; 369 sycl::half * outf_ptr = (sycl::half *) extra.out_buffer_ptr; 370 if (!outf_ptr) { 371 outf_pool.emplace(ctx.pool(), (size_t) H * q * d); 372 outf_ptr = outf_pool->get(); 373 } 374 375 // compile once per (device, shape, KV strides), reuse across layers/calls. Stride 2 always 376 // repeats stride 1 and stride 4 is always 1, so the key covers every entry that can differ. 377 static std::unordered_map cache; 378 char keyb[256]; 379 snprintf(keyb, sizeof(keyb), "%d:%lld:%lld:%lld:%lld:%lld:%lld:%lld:%lld:%lld:%lld:%lld", ggml_sycl_get_device(), 380 (long long) H, (long long) Hkv, (long long) q, (long long) seq, (long long) d, 381 (long long) k_str[0], (long long) k_str[1], (long long) k_str[3], 382 (long long) v_str[0], (long long) v_str[1], (long long) v_str[3]); 383 auto it = cache.find(keyb); 384 if (it == cache.end()) { 385 it = cache.emplace(keyb, build_sdpa(eng, (int) H, (int) Hkv, (int) q, (int) seq, (int) d, k_str, v_str)).first; 386 } 387 sdpa_partition & E = it->second; 388 if (!E.ok) { 389 // oneDNN can decline a shape or a stride set that _supported() never sees; build_sdpa warns per key. 390 ggml_sycl_flash_attn_ext_tile(ctx, dst); 391 return; 392 } 393 394 auto id2ptr = [&](size_t r) -> void * { 395 if (r == E.id_q) return Qf_ptr; 396 if (r == E.id_k) return K_ptr; 397 if (r == E.id_v) return V_ptr; 398 if (r == E.id_scale) return scale_dev; 399 if (r == E.id_mask) return (void *) mask->data; 400 return nullptr; 401 }; 402 std::vector ti; 403 ti.reserve(E.ins.size()); 404 for (auto & lt : E.ins) { 405 ti.emplace_back(lt, eng, id2ptr(lt.get_id())); 406 } 407 tensor to(E.out, eng, outf_ptr); 408 E.cp.execute(strm, ti, {to}); 409 410 permute_sdpa_out_sycl(outf_ptr, (float *) dst->data, mb, H, q, d, stream); 411 // Single device needs no sync: the dnnl stream wraps this same in-order queue, so the SDPA 412 // serializes with the staging kernels before it and the permute/pool reuse after it. The 413 // garbage output formerly blamed on the missing sync here was the scale use-after-return 414 // fixed above. Keep the conservative wait for multi-GPU, where other devices' streams can 415 // race the pool: 416 if (ggml_sycl_info().device_count > 1) { 417 stream->wait_and_throw(); 418 } 419 } 420 catch (const std::exception & e) { 421 // any oneDNN/SYCL failure is non-fatal: fall back to the existing kernel (strictly additive). 422 GGML_LOG_WARN("%s: oneDNN SDPA failed (%s); falling back to TILE kernel\n", __func__, e.what()); 423 ggml_sycl_flash_attn_ext_tile(ctx, dst); 424 } 425 426 #endif // GGML_SYCL_DNNL