feat: add q2_k fast and modify q2_k logic, add preliminary support for rms_norm_aware_importance but currently assumption is wrong and will lead to corrupted result
This commit is contained in:
@@ -25,13 +25,15 @@ typedef enum {
|
||||
IQ2_XXS = 13,
|
||||
IQ2_XS = 14,
|
||||
IQ2_S = 15,
|
||||
Q2_K_FAST = 16,
|
||||
TOPK_IM = 17,
|
||||
} bsq_method_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t num_elements; /* for 1D formats */
|
||||
uint16_t num_tokens; /* for 2D sparsity */
|
||||
uint16_t num_features; /* for 2D sparsity */
|
||||
float sparse_ratio; /* only meaningful for TOPK */
|
||||
float sparse_ratio; /* only meaningful for TOPK, TOPK_IM */
|
||||
} bsq_shape_t;
|
||||
|
||||
typedef struct bitsqueeze_buffer {
|
||||
@@ -50,12 +52,17 @@ int bsq_compress_2d(const float *src,
|
||||
uint16_t num_features,
|
||||
float sparse_ratio,
|
||||
bsq_method_t method,
|
||||
bitsqueeze_buffer_t **out);
|
||||
bitsqueeze_buffer_t **out,
|
||||
const float *im);
|
||||
|
||||
int bsq_decompress(const bitsqueeze_buffer_t *buf,
|
||||
float *dst,
|
||||
uint64_t dst_num_elements);
|
||||
|
||||
int bsq_apply(const bitsqueeze_buffer_t *buf,
|
||||
float *dst,
|
||||
uint64_t dst_num_elements);
|
||||
|
||||
int64_t bsq_get_packed_size(const bitsqueeze_buffer_t *buf);
|
||||
|
||||
bitsqueeze_buffer_t *load_bsq_from_buffer(const void *buffer, int64_t buffer_size);
|
||||
|
||||
Reference in New Issue
Block a user