const int32_t nb31,
const int32_t nb32,
const int64_t nb33) {
+
#ifdef SYCL_FLASH_ATTN
// Skip unused kernel variants for faster compilation:
}
}
-
item_ct1.barrier(sycl::access::fence_space::local_space);
#pragma unroll
const auto arch = ggml_sycl_info().devices[ctx.device].hw_info.arch;
const int nthreads = ggml_sycl_fattn_vec_get_nthreads_device(arch);
- // 256 threads would overflow the 64 KB work-group local memory at D == 512, so keep 128 there.
- if (D <= 256 && nthreads == 256) {
- constexpr int nthreads_hw = 256;
- constexpr int nwarps = nthreads_hw / warp_size;
- launch_fattn<D, cols_per_block, 1,
- flash_attn_ext_vec<D, cols_per_block, type_K, type_V,
- use_logit_softcap, warp_size, nthreads_hw>, warp_size>(
- ctx, dst, nwarps, nbytes_shared, D, need_f16_K, need_f16_V, false);
- } else {
- constexpr int nthreads_hw = 128;
- constexpr int nwarps = nthreads_hw / warp_size;
- launch_fattn<D, cols_per_block, 1,
- flash_attn_ext_vec<D, cols_per_block, type_K, type_V,
- use_logit_softcap, warp_size, nthreads_hw>, warp_size>(
- ctx, dst, nwarps, nbytes_shared, D, need_f16_K, need_f16_V, false);
+ if constexpr (D <= 256) {
+ if (nthreads == 256) {
+ constexpr int nthreads_hw = 256;
+ constexpr int nwarps = nthreads_hw / warp_size;
+ launch_fattn<D, cols_per_block, 1,
+ flash_attn_ext_vec<D, cols_per_block, type_K, type_V,
+ use_logit_softcap, warp_size, nthreads_hw>, warp_size>(
+ ctx, dst, nwarps, nbytes_shared, D, need_f16_K, need_f16_V, false);
+ return;
+ }
}
+
+ constexpr int nthreads_hw = 128;
+ constexpr int nwarps = nthreads_hw / warp_size;
+ launch_fattn<D, cols_per_block, 1,
+ flash_attn_ext_vec<D, cols_per_block, type_K, type_V,
+ use_logit_softcap, warp_size, nthreads_hw>, warp_size>(
+ ctx, dst, nwarps, nbytes_shared, D, need_f16_K, need_f16_V, false);
}
template <int D, int type_K, int type_V>