char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
b54cb2e3d
char/aliceai-t5-moe
1#include <sycl/sycl.hpp> 2#include <sycl/ext/oneapi/work_group_static.hpp> 3#include "dpct/helper.hpp" 4#include "common.hpp" 5#include "fattn-common.hpp" 6#include "fattn-tile.hpp" 7#include <cmath> 8#include <float.h> 9namespace syclex= sycl::ext::oneapi::experimental; 10 11void ggml_sycl_flash_attn_ext_tile (ggml_backend_sycl_context & ctx ,ggml_tensor * dst ) { 12const ggml_tensor * K = dst -> src [1 ]; 13const ggml_tensor * V = dst -> src [2 ]; 14switch (K -> ne [0 ]) { 15case 40 : { 16GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 17ggml_sycl_flash_attn_ext_tile_case < 40 ,40 > (ctx ,dst ); 18 }break ; 19case 64 : { 20GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 21ggml_sycl_flash_attn_ext_tile_case < 64 ,64 > (ctx ,dst ); 22 }break ; 23case 72 : { 24GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 25ggml_sycl_flash_attn_ext_tile_case < 72 ,72 > (ctx ,dst ); 26 }break ; 27case 80 : { 28GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 29ggml_sycl_flash_attn_ext_tile_case < 80 ,80 > (ctx ,dst ); 30 }break ; 31case 96 : { 32GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 33ggml_sycl_flash_attn_ext_tile_case < 96 ,96 > (ctx ,dst ); 34 }break ; 35case 112 : { 36GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 37ggml_sycl_flash_attn_ext_tile_case < 112 ,112 > (ctx ,dst ); 38 }break ; 39case 128 : { 40GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 41ggml_sycl_flash_attn_ext_tile_case < 128 ,128 > (ctx ,dst ); 42 }break ; 43case 256 : { 44GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 45ggml_sycl_flash_attn_ext_tile_case < 256 ,256 > (ctx ,dst ); 46 }break ; 47case 512 : { 48GGML_ASSERT (V -> ne [0 ]== K -> ne [0 ]); 49ggml_sycl_flash_attn_ext_tile_case < 512 ,512 > (ctx ,dst ); 50 }break ; 51case 576 : { 52GGML_ASSERT (V -> ne [0 ]== 512 ); 53ggml_sycl_flash_attn_ext_tile_case < 576 ,512 > (ctx ,dst ); 54 }break ; 55default : { 56GGML_ABORT ("Unsupported head size" ); 57 }break ; 58 } 59}