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-metal/kernels/fa_q4_1.metal # 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-metal / kernels / fa_q4_1.metal` 54 lines ยท 4637 bytes Raw Blame History 1 #include "common.h" 2 #include "dequantize.h" 3 #include "fa_common.metal" 4 5 #define FA_TYPES \ 6 half, half4, simdgroup_half8x8, \ 7 half, half4x4, simdgroup_half8x8, \ 8 half, half4x4, simdgroup_half8x8, \ 9 float, simdgroup_float8x8, \ 10 float, float2, simdgroup_float8x8, \ 11 float, float4, simdgroup_float8x8 12 //half, half4, simdgroup_half8x8 13 14 #define FA_TYPES_BF \ 15 bfloat, bfloat4, simdgroup_bfloat8x8, \ 16 bfloat, bfloat4x4, simdgroup_bfloat8x8, \ 17 bfloat, bfloat4x4, simdgroup_bfloat8x8, \ 18 float, simdgroup_float8x8, \ 19 float, float2, simdgroup_float8x8, \ 20 half, half4, simdgroup_half8x8 21 //float, float4, simdgroup_float8x8 22 23 #define FA_TYPES_F32 \ 24 half, half4, simdgroup_half8x8, \ 25 float, float4x4, simdgroup_float8x8, \ 26 float, float4x4, simdgroup_float8x8, \ 27 float, simdgroup_float8x8, \ 28 float, float2, simdgroup_float8x8, \ 29 float, float4, simdgroup_float8x8 30 //half, half4, simdgroup_half8x8 31 32 typedef decltype(kernel_flash_attn_ext) flash_attn_ext_t; 33 34 template [[host_name("kernel_flash_attn_ext_q4_1_dk32_dv32" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 35 template [[host_name("kernel_flash_attn_ext_q4_1_dk40_dv40" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 36 template [[host_name("kernel_flash_attn_ext_q4_1_dk48_dv48" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 37 template [[host_name("kernel_flash_attn_ext_q4_1_dk64_dv64" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 38 template [[host_name("kernel_flash_attn_ext_q4_1_dk72_dv72" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 39 template [[host_name("kernel_flash_attn_ext_q4_1_dk80_dv80" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 40 template [[host_name("kernel_flash_attn_ext_q4_1_dk96_dv96" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 41 template [[host_name("kernel_flash_attn_ext_q4_1_dk96_dv64" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 42 template [[host_name("kernel_flash_attn_ext_q4_1_dk112_dv112")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 43 template [[host_name("kernel_flash_attn_ext_q4_1_dk128_dv128")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 44 template [[host_name("kernel_flash_attn_ext_q4_1_dk128_dv96" )]] kernel flash_attn_ext_t kernel_flash_attn_ext; 45 template [[host_name("kernel_flash_attn_ext_q4_1_dk192_dv192")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 46 template [[host_name("kernel_flash_attn_ext_q4_1_dk192_dv128")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 47 template [[host_name("kernel_flash_attn_ext_q4_1_dk256_dv256")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 48 template [[host_name("kernel_flash_attn_ext_q4_1_dk320_dv256")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 49 template [[host_name("kernel_flash_attn_ext_q4_1_dk512_dv512")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 50 template [[host_name("kernel_flash_attn_ext_q4_1_dk576_dv512")]] kernel flash_attn_ext_t kernel_flash_attn_ext; 51 52 #undef FA_TYPES 53 #undef FA_TYPES_BF 54 #undef FA_TYPES_F32