VNNI Q4_K x Q8_K matvec kernel (inference only) More...
#include <stddef.h>#include <stdint.h>#include <math.h>#include <stdlib.h>#include <string.h>#include "ckernel_engine.h"#include "ck_threadpool.h"#include "ckernel_quant.h"#include "ck_speed_profiles.h"Go to the source code of this file.
Functions | |
| static void | accum_q4_k_packed_meta_x16_q8_k_block (float acc[16], const block_q4_K_packed_meta_x16 *w, int active, const block_q8_K *x) |
| static void | accum_q4_k_packed_meta_x16_q8_k_block_mreuse (float acc[8][16], const block_q4_K_packed_meta_x16 *w, int active, const block_q8_K *A, int blocks_per_vec, int block_index, int m0, int m_count) |
| static void | accum_q4_k_packed_meta_x16_q8_k_block_mreuse_chunk4 (float acc[8][16], const block_q4_K_packed_meta_x16 *w, int active, const block_q8_K *A, int blocks_per_vec, int block_index, int m0, int m_count) |
| static void | accum_q4_k_packed_meta_x8_q8_k_block (float acc[8], const block_q4_K_packed_meta_x8 *w, int active, const block_q8_K *x) |
| static void | accum_q4_k_packed_meta_x8_q8_k_block_mreuse (float acc[8][8], const block_q4_K_packed_meta_x8 *w, int active, const block_q8_K *A, int blocks_per_vec, int block_index, int m0, int m_count) |
| static void | accum_q4_k_packed_meta_x8_q8_k_gemv_block (float acc[8], float acc_min[8], const block_q4_K_packed_meta_x8 *w, int active, const block_q8_K *x) |
| static void | accum_q4_k_packed_meta_x8_q8_k_superblock (float acc[8], float acc_min[8], const block_q4_K_packed_meta_x8 *w, int active, const block_q8_K *x) |
| static void | accum_q4_k_packed_meta_x8_q8_k_superblock_rows (float acc[8][8], float acc_min[8][8], const block_q4_K_packed_meta_x8 *w, int active, const block_q8_K *x[8], int rows) |
| static void | accum_q4_k_packed_u8_x16_q8_k_block (float acc[16], const block_q4_K_packed_u8_x16 *w, int active, const block_q8_K *x) |
| static void | accum_q4_k_packed_vnni_x16_q8_k_16m_superblock (float acc[16][16], float acc_min[16][16], const block_q4_K_packed_vnni_x16 *w, const block_q8_K *x[16], int rows) |
| static void | accum_q4_k_packed_vnni_x16_q8_k_gemv_block (float acc[16], float acc_min[16], const block_q4_K_packed_vnni_x16 *w, const block_q8_K *x) |
| static void | accum_q4_k_packed_vnni_x8_q8_k_4m_superblock (float acc[4][8], float acc_min[4][8], const block_q4_K_packed_vnni_x8 *w, const block_q8_K *x[4], int rows) |
| int | ck_q4k_packed_vnni_x16_available (void) |
| int | ck_q4k_packed_vnni_x8_available (void) |
| int | ck_q4k_packed_vnni_x8_compact_order_available (void) |
| static float | ck_q4k_silu_f32 (float x) |
| static int | ck_q4k_x16_chunk4_enabled (void) |
| static float | dot_q4_k_packed_meta_q8_k_block (const block_q4_K_packed_meta *w, const block_q8_K *x) |
| static float | dot_q4_k_packed_u8_q8_k_block (const block_q4_K_packed_u8 *w, const block_q8_K *x) |
| static void | dot_q4_k_packed_vnni_x8_q8_k_compact_order (float block_sums[4][8], const block_q4_K_packed_vnni_x8 *w, const block_q8_K *x[4], int rows) |
| static int32_t | dot_q4_packed_u8_q8_32_ref (const uint8_t *q4_32, const int8_t *q8_32) |
| void | gemm_nt_q4_k_packed_meta_q8_k (const void *A_q8, const void *B_packed, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_meta_q8_k_threaded (const void *A_q8, const void *B_packed, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_q8_k_threaded_nsplit (const void *A_q8, const void *B_packed, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_q8_k_tile (const void *A_q8, const void *B_packed, const float *bias, float *C, int M, int N, int K, int m0, int m1, int n0, int n1) |
| void | gemm_nt_q4_k_packed_meta_x16_gateup_swiglu_fused_vnni (const void *A_q8, const void *B_packed_x16, const float *bias, float *C, int M, int D, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x16_q8_k_llama_order (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mreuse (const void *A_q8, const void *B_packed_x16, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mtile (const void *A_q8, const void *B_packed_x16, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_gemv_order (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_4m (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_8m (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_mreuse (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_superblock_order (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mreuse (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mtile (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_nsplit (const void *A_q8, const void *B_packed_x8, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_u8_q8_k (const void *A_q8, const void *B_packed, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_u8_x16_q8_k_threaded_mtile (const void *A_q8, const void *B_packed_u8_x16, const float *bias, float *C, int M, int N, int K, int tile_m, int active_threads) |
| void | gemm_nt_q4_k_packed_vnni_x16_q8_k_gemv_order (const void *A_q8, const void *B_packed_x16, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q4_k_packed_vnni_x16_q8_k_split_min_threaded_16m (const void *A_q8, const void *B_packed_vnni_x16, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_packed_vnni_x8_q8_k_split_min_threaded_4m (const void *A_q8, const void *B_packed_vnni_x8, const float *bias, float *C, int M, int N, int K, int active_threads) |
| void | gemm_nt_q4_k_q8_k_gateup_swiglu_fused_vnni (const void *A_q8, const void *B_gate_up, const float *bias, float *C, int M, int D, int K, int threads) |
| static void | gemm_q4_gateup_swiglu_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_gateup_swiglu_x16_thread_fn (int ith, int nth, void *args) |
| void | gemm_q4_k_q8_k_compact_rows4 (float *output, int output_stride, const void *weights, const void *const input_rows[4], int rows, int output_dim, int input_dim) |
| void | gemm_q4_k_q8_k_packed_vnni_x8_compact_order_rows4 (float *output, const void *weights_packed, const void *input_q8, int rows, int output_dim, int input_dim) |
| static void | gemm_q4_packed_meta_nsplit_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x16_mreuse_process_job (const gemm_q4_packed_meta_x16_thread_work_t *a, int job, int mt, int tile_m) |
| static void | gemm_q4_packed_meta_x16_mreuse_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x16_mtile_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_mreuse_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_mtile_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_nsplit_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_split_min_4m_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_split_min_8m_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_meta_x8_split_min_mreuse_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_u8_x16_mtile_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_vnni_x16_q8k_16m_thread_fn (int ith, int nth, void *args) |
| static void | gemm_q4_packed_vnni_x8_q8k_4m_job (gemm_q4_packed_vnni_x8_thread_work_t *a, int job, int row_tiles) |
| static void | gemm_q4_packed_vnni_x8_q8k_4m_range_fn (int begin, int end, void *args) |
| static void | gemm_q4_packed_vnni_x8_q8k_4m_thread_fn (int ith, int nth, void *args) |
| void | gemv_q4_k_q8_k_avx2 (float *y, const void *W, const void *x_q8, int M, int K) |
| void | gemv_q4_k_q8_k_parallel_vnni (float *y, const void *W, const void *x_q8, int M, int K, int ith, int nth) |
| void | gemv_q4_k_q8_k_ref (float *y, const void *W, const void *x_q8, int M, int K) |
| void | gemv_q4_k_q8_k_vnni (float *y, const void *W, const void *x_q8, int M, int K) |
| void | pack_q4_k_to_packed_meta (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_meta_x16 (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_meta_x8 (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_u8 (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_u8_x16 (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_vnni_x16 (const void *src, void *dst, int N, int K) |
| void | pack_q4_k_to_packed_vnni_x8 (const void *src, void *dst, int N, int K) |
| size_t | q4_k_packed_meta_block_size (void) |
| size_t | q4_k_packed_meta_x16_block_size (void) |
| size_t | q4_k_packed_meta_x8_block_size (void) |
| size_t | q4_k_packed_u8_block_size (void) |
| size_t | q4_k_packed_u8_x16_block_size (void) |
| size_t | q4_k_packed_vnni_x16_block_size (void) |
| size_t | q4_k_packed_vnni_x8_block_size (void) |
VNNI Q4_K x Q8_K matvec kernel (inference only)
After changes: make test && make llamacpp-parity-full
The canonical providers require AVX2. The x8 output-interleaved provider uses 256-bit VNNI from AVX-VNNI or AVX-512 VNNI+VL. The x16 provider is a separate AVX-512 VNNI diagnostic path; production promotion is sweep-gated.
Packed-meta status: Packed layouts are internal providers selected by the declared production dispatcher. Weight-identity caches own their lifetime until runtime shutdown; the kernel map records layout and ISA requirements. Canonical GGUF-layout Q4_K remains the parity fallback for unsupported ISAs and uncovered shapes.
Definition in file gemm_kernels_q4k_q8k_vnni.c.
|
inlinestatic |
Definition at line 1712 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_q4_packed_meta_x16_mtile_thread_fn().
|
inlinestatic |
Definition at line 1561 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by accum_q4_k_packed_meta_x16_q8_k_block_mreuse_chunk4(), gemm_q4_gateup_swiglu_x16_thread_fn(), and gemm_q4_packed_meta_x16_mreuse_process_job().
|
inlinestatic |
Definition at line 1636 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x16_q8_k_block_mreuse(), block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_q4_gateup_swiglu_x16_thread_fn(), and gemm_q4_packed_meta_x16_mreuse_process_job().
|
inlinestatic |
Definition at line 703 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by accum_q4_k_packed_meta_x8_q8_k_block_mreuse(), gemm_nt_q4_k_packed_meta_x8_q8_k(), gemm_q4_packed_meta_x8_mtile_thread_fn(), and gemm_q4_packed_meta_x8_nsplit_thread_fn().
|
inlinestatic |
Definition at line 1469 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_block(), block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_q4_packed_meta_x8_mreuse_thread_fn().
|
inlinestatic |
Definition at line 1393 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_gemv_order().
|
inlinestatic |
Definition at line 757 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by accum_q4_k_packed_meta_x8_q8_k_superblock_rows(), gemm_nt_q4_k_packed_meta_x8_q8_k_superblock_order(), and gemm_q4_packed_meta_x8_split_min_mreuse_thread_fn().
|
inlinestatic |
Definition at line 843 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_superblock(), block_q8_K::bsums, CK_FP16_TO_FP32, and QK_K.
Referenced by gemm_q4_packed_meta_x8_split_min_4m_thread_fn(), and gemm_q4_packed_meta_x8_split_min_8m_thread_fn().
|
inlinestatic |
Definition at line 1532 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, dot_q4_packed_u8_q8_32_ref(), QK_K, and block_q8_K::qs.
Referenced by gemm_q4_packed_u8_x16_mtile_thread_fn().
|
inlinestatic |
Definition at line 1194 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_q4_packed_vnni_x16_q8k_16m_thread_fn().
|
inlinestatic |
Definition at line 1300 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_nt_q4_k_packed_vnni_x16_q8_k_gemv_order().
|
inlinestatic |
Definition at line 937 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, and QK_K.
Referenced by gemm_q4_packed_vnni_x8_q8k_4m_job().
| int ck_q4k_packed_vnni_x16_available | ( | void | ) |
Definition at line 286 of file gemm_kernels_q4k_q8k_vnni.c.
Referenced by gemm_nt_q4_k_packed_vnni_x16_q8_k_gemv_order(), and gemm_nt_q4_k_packed_vnni_x16_q8_k_split_min_threaded_16m().
| int ck_q4k_packed_vnni_x8_available | ( | void | ) |
Definition at line 272 of file gemm_kernels_q4k_q8k_vnni.c.
| int ck_q4k_packed_vnni_x8_compact_order_available | ( | void | ) |
Definition at line 1178 of file gemm_kernels_q4k_q8k_vnni.c.
|
inlinestatic |
Definition at line 3671 of file gemm_kernels_q4k_q8k_vnni.c.
Referenced by gemm_q4_gateup_swiglu_thread_fn().
|
static |
Definition at line 36 of file gemm_kernels_q4k_q8k_vnni.c.
References ck_env_value_truthy().
Referenced by gemm_q4_gateup_swiglu_x16_thread_fn(), and gemm_q4_packed_meta_x16_mreuse_process_job().
|
inlinestatic |
Definition at line 668 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, QK_K, and block_q8_K::qs.
Referenced by gemm_nt_q4_k_packed_meta_q8_k(), gemm_nt_q4_k_packed_meta_q8_k_tile(), gemm_q4_packed_meta_nsplit_thread_fn(), and gemm_q4_packed_meta_thread_fn().
|
inlinestatic |
Definition at line 648 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, block_q8_K::d, dot_q4_packed_u8_q8_32_ref(), QK_K, and block_q8_K::qs.
Referenced by gemm_nt_q4_k_packed_u8_q8_k().
|
inlinestatic |
Definition at line 1032 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, CK_FP16_TO_FP32, and QK_K.
Referenced by gemm_q4_k_q8_k_packed_vnni_x8_compact_order_rows4().
|
inlinestatic |
Definition at line 637 of file gemm_kernels_q4k_q8k_vnni.c.
Referenced by accum_q4_k_packed_u8_x16_q8_k_block(), and dot_q4_k_packed_u8_q8_k_block().
| void gemm_nt_q4_k_packed_meta_q8_k | ( | const void * | A_q8, |
| const void * | B_packed, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 1798 of file gemm_kernels_q4k_q8k_vnni.c.
References C, dot_q4_k_packed_meta_q8_k_block(), and QK_K.
Referenced by gemm_nt_q4_k_packed_meta_q8_k_threaded(), and gemm_nt_q4_k_packed_meta_q8_k_threaded_nsplit().
| void gemm_nt_q4_k_packed_meta_q8_k_threaded | ( | const void * | A_q8, |
| const void * | B_packed, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 2247 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_nt_q4_k_packed_meta_q8_k(), gemm_q4_packed_meta_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_q8_k_threaded_nsplit | ( | const void * | A_q8, |
| const void * | B_packed, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 2310 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_nt_q4_k_packed_meta_q8_k(), gemm_q4_packed_meta_nsplit_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_q8_k_tile | ( | const void * | A_q8, |
| const void * | B_packed, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | m0, | ||
| int | m1, | ||
| int | n0, | ||
| int | n1 | ||
| ) |
Definition at line 1825 of file gemm_kernels_q4k_q8k_vnni.c.
References C, dot_q4_k_packed_meta_q8_k_block(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x16_gateup_swiglu_fused_vnni | ( | const void * | A_q8, |
| const void * | B_packed_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | D, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 3401 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_gateup_swiglu_x16_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x16_q8_k_llama_order | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 1944 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q8_K::bsums, C, CK_FP16_TO_FP32, block_q8_K::d, gemm_nt_q4_k_packed_meta_x8_q8_k_superblock_order(), QK_K, and block_q8_K::qs.
| void gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mreuse | ( | const void * | A_q8, |
| const void * | B_packed_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 3228 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x16_mreuse_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mtile | ( | const void * | A_q8, |
| const void * | B_packed_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 3273 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x16_mtile_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 1862 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_block(), C, and QK_K.
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mtile(), and gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_nsplit().
| void gemm_nt_q4_k_packed_meta_x8_q8_k_gemv_order | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 2055 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_gemv_block(), C, and QK_K.
Referenced by ck_moe_q4k_llama_projection().
| void gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_4m | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 2947 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x8_split_min_4m_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_8m | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 2987 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x8_split_min_8m_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_mreuse | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 2905 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x8_split_min_mreuse_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k_superblock_order | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 1899 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_superblock(), C, and QK_K.
Referenced by gemm_nt_q4_k_packed_meta_x16_q8_k_llama_order().
| void gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mreuse | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 2860 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_meta_x8_mreuse_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mtile | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 2814 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_nt_q4_k_packed_meta_x8_q8_k(), gemm_q4_packed_meta_x8_mtile_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_nsplit | ( | const void * | A_q8, |
| const void * | B_packed_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 2381 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_nt_q4_k_packed_meta_x8_q8_k(), gemm_q4_packed_meta_x8_nsplit_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_u8_q8_k | ( | const void * | A_q8, |
| const void * | B_packed, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 1770 of file gemm_kernels_q4k_q8k_vnni.c.
References C, dot_q4_k_packed_u8_q8_k_block(), and QK_K.
| void gemm_nt_q4_k_packed_u8_x16_q8_k_threaded_mtile | ( | const void * | A_q8, |
| const void * | B_packed_u8_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | tile_m, | ||
| int | active_threads | ||
| ) |
Definition at line 3494 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_packed_u8_x16_mtile_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_vnni_x16_q8_k_gemv_order | ( | const void * | A_q8, |
| const void * | B_packed_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 2094 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_vnni_x16_q8_k_gemv_block(), C, ck_q4k_packed_vnni_x16_available(), and QK_K.
| void gemm_nt_q4_k_packed_vnni_x16_q8_k_split_min_threaded_16m | ( | const void * | A_q8, |
| const void * | B_packed_vnni_x16, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 3070 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_q4k_packed_vnni_x16_available(), ck_threadpool_capacity(), ck_threadpool_dispatch_n(), ck_threadpool_global(), gemm_q4_packed_vnni_x16_q8k_16m_thread_fn(), and QK_K.
| void gemm_nt_q4_k_packed_vnni_x8_q8_k_split_min_threaded_4m | ( | const void * | A_q8, |
| const void * | B_packed_vnni_x8, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| int | active_threads | ||
| ) |
Definition at line 3027 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_gemm_dynamic_schedule_enabled(), ck_threadpool_capacity(), ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_parallel_for_n(), gemm_q4_packed_vnni_x8_q8k_4m_range_fn(), gemm_q4_packed_vnni_x8_q8k_4m_thread_fn(), and QK_K.
| void gemm_nt_q4_k_q8_k_gateup_swiglu_fused_vnni | ( | const void * | A_q8, |
| const void * | B_gate_up, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | D, | ||
| int | K, | ||
| int | threads | ||
| ) |
Definition at line 3722 of file gemm_kernels_q4k_q8k_vnni.c.
References C, ck_threadpool_dispatch_n(), ck_threadpool_global(), ck_threadpool_n_threads(), gemm_q4_gateup_swiglu_thread_fn(), and QK_K.
|
static |
Definition at line 3688 of file gemm_kernels_q4k_q8k_vnni.c.
References ck_q4k_silu_f32().
Referenced by gemm_nt_q4_k_q8_k_gateup_swiglu_fused_vnni().
|
static |
Definition at line 3335 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x16_q8_k_block_mreuse(), accum_q4_k_packed_meta_x16_q8_k_block_mreuse_chunk4(), and ck_q4k_x16_chunk4_enabled().
Referenced by gemm_nt_q4_k_packed_meta_x16_gateup_swiglu_fused_vnni().
| void gemm_q4_k_q8_k_compact_rows4 | ( | float * | output, |
| int | output_stride, | ||
| const void * | weights, | ||
| const void *const | input_rows[4], | ||
| int | rows, | ||
| int | output_dim, | ||
| int | input_dim | ||
| ) |
Definition at line 3615 of file gemm_kernels_q4k_q8k_vnni.c.
References gemv_q4_k_q8_k(), and QK_K.
Referenced by ck_moe_q4k_q5k_bucket_work().
| void gemm_q4_k_q8_k_packed_vnni_x8_compact_order_rows4 | ( | float * | output, |
| const void * | weights_packed, | ||
| const void * | input_q8, | ||
| int | rows, | ||
| int | output_dim, | ||
| int | input_dim | ||
| ) |
Definition at line 1123 of file gemm_kernels_q4k_q8k_vnni.c.
References dot_q4_k_packed_vnni_x8_q8_k_compact_order(), and QK_K.
Referenced by ck_moe_q4k_q5k_bucket_work().
|
static |
Definition at line 2284 of file gemm_kernels_q4k_q8k_vnni.c.
References dot_q4_k_packed_meta_q8_k_block().
Referenced by gemm_nt_q4_k_packed_meta_q8_k_threaded_nsplit().
|
static |
Definition at line 2221 of file gemm_kernels_q4k_q8k_vnni.c.
References dot_q4_k_packed_meta_q8_k_block().
Referenced by gemm_nt_q4_k_packed_meta_q8_k_threaded().
|
inlinestatic |
Definition at line 3156 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x16_q8_k_block_mreuse(), accum_q4_k_packed_meta_x16_q8_k_block_mreuse_chunk4(), and ck_q4k_x16_chunk4_enabled().
Referenced by gemm_q4_packed_meta_x16_mreuse_thread_fn().
|
static |
Definition at line 3212 of file gemm_kernels_q4k_q8k_vnni.c.
References gemm_q4_packed_meta_x16_mreuse_process_job().
Referenced by gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mreuse().
|
static |
Definition at line 3108 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x16_q8_k_block().
Referenced by gemm_nt_q4_k_packed_meta_x16_q8_k_threaded_mtile().
|
static |
Definition at line 2467 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_block_mreuse().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mreuse().
|
static |
Definition at line 2419 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_block().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_mtile().
|
static |
Definition at line 2346 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_block().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_threaded_nsplit().
|
static |
Definition at line 2576 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_superblock_rows().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_4m().
|
static |
Definition at line 2633 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_superblock_rows().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_8m().
|
static |
Definition at line 2516 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_meta_x8_q8_k_superblock().
Referenced by gemm_nt_q4_k_packed_meta_x8_q8_k_split_min_threaded_mreuse().
|
static |
Definition at line 3451 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_u8_x16_q8_k_block().
Referenced by gemm_nt_q4_k_packed_u8_x16_q8_k_threaded_mtile().
|
static |
Definition at line 2759 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_vnni_x16_q8_k_16m_superblock().
Referenced by gemm_nt_q4_k_packed_vnni_x16_q8_k_split_min_threaded_16m().
|
inlinestatic |
Definition at line 2690 of file gemm_kernels_q4k_q8k_vnni.c.
References accum_q4_k_packed_vnni_x8_q8_k_4m_superblock().
Referenced by gemm_q4_packed_vnni_x8_q8k_4m_range_fn(), and gemm_q4_packed_vnni_x8_q8k_4m_thread_fn().
|
static |
Definition at line 2747 of file gemm_kernels_q4k_q8k_vnni.c.
References end, and gemm_q4_packed_vnni_x8_q8k_4m_job().
Referenced by gemm_nt_q4_k_packed_vnni_x8_q8_k_split_min_threaded_4m().
|
static |
Definition at line 2733 of file gemm_kernels_q4k_q8k_vnni.c.
References gemm_q4_packed_vnni_x8_q8k_4m_job().
Referenced by gemm_nt_q4_k_packed_vnni_x8_q8_k_split_min_threaded_4m().
| void gemv_q4_k_q8_k_avx2 | ( | float * | y, |
| const void * | W, | ||
| const void * | x_q8, | ||
| int | M, | ||
| int | K | ||
| ) |
Definition at line 118 of file gemm_kernels_q4k_q8k_avx2.c.
| void gemv_q4_k_q8_k_parallel_vnni | ( | float * | y, |
| const void * | W, | ||
| const void * | x_q8, | ||
| int | M, | ||
| int | K, | ||
| int | ith, | ||
| int | nth | ||
| ) |
Definition at line 3771 of file gemm_kernels_q4k_q8k_vnni.c.
References QK_K.
| void gemv_q4_k_q8_k_ref | ( | float * | y, |
| const void * | W, | ||
| const void * | x_q8, | ||
| int | M, | ||
| int | K | ||
| ) |
Definition at line 201 of file gemm_kernels_q4k_q8k.c.
Referenced by gemm_q4_k_q8_k_ref(), gemv_q4_k_q8_k(), and gemv_q4_k_q8_k_vnni().
| void gemv_q4_k_q8_k_vnni | ( | float * | y, |
| const void * | W, | ||
| const void * | x_q8, | ||
| int | M, | ||
| int | K | ||
| ) |
Definition at line 3534 of file gemm_kernels_q4k_q8k_vnni.c.
References ck_strict_parity_enabled(), gemv_q4_k_q8_k_ref(), and QK_K.
Referenced by gemv_q4_k_q8_k(), and gemv_q4_k_q8_k_amx().
| void pack_q4_k_to_packed_meta | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 505 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| void pack_q4_k_to_packed_meta_x16 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 553 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| void pack_q4_k_to_packed_meta_x8 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 525 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
Referenced by ck_moe_q4k_llama_projection().
| void pack_q4_k_to_packed_u8 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 479 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| void pack_q4_k_to_packed_u8_x16 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 581 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| void pack_q4_k_to_packed_vnni_x16 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 343 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| void pack_q4_k_to_packed_vnni_x8 | ( | const void * | src, |
| void * | dst, | ||
| int | N, | ||
| int | K | ||
| ) |
Definition at line 295 of file gemm_kernels_q4k_q8k_vnni.c.
References block_q4_K::d, block_q4_K::dmin, QK_K, block_q4_K::qs, block_q4_K::scales, and unpack_q4_k_scales().
| size_t q4_k_packed_meta_block_size | ( | void | ) |
Definition at line 459 of file gemm_kernels_q4k_q8k_vnni.c.
| size_t q4_k_packed_meta_x16_block_size | ( | void | ) |
Definition at line 469 of file gemm_kernels_q4k_q8k_vnni.c.
| size_t q4_k_packed_meta_x8_block_size | ( | void | ) |
Definition at line 464 of file gemm_kernels_q4k_q8k_vnni.c.
Referenced by ck_moe_q4k_llama_projection_scratch_bytes().
| size_t q4_k_packed_u8_block_size | ( | void | ) |
Definition at line 454 of file gemm_kernels_q4k_q8k_vnni.c.
| size_t q4_k_packed_u8_x16_block_size | ( | void | ) |
Definition at line 474 of file gemm_kernels_q4k_q8k_vnni.c.
| size_t q4_k_packed_vnni_x16_block_size | ( | void | ) |
Definition at line 281 of file gemm_kernels_q4k_q8k_vnni.c.
| size_t q4_k_packed_vnni_x8_block_size | ( | void | ) |
Definition at line 267 of file gemm_kernels_q4k_q8k_vnni.c.
Referenced by ck_moe_swiglu_expert_forward_q4k_q5k_bucketed_impl().