Skip to content

Interleave 8 rows (Q8_0, IQ4_XS) #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 27, 2025
15 changes: 10 additions & 5 deletions ggml/src/ggml-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ typedef struct {
int8_t qs[4*QK8_0];
} block_q8_0_x4;
static_assert(sizeof(block_q8_0_x4) == 4*sizeof(block_q8_0), "wrong q8_0_x4 block size/padding");
typedef struct {
ggml_half d[8];
int8_t qs[8*QK8_0];
} block_q8_0_r8;
static_assert(sizeof(block_q8_0_r8) == 8*sizeof(block_q8_0), "wrong q8_0_r8 block size/padding");

typedef struct {
ggml_half d[4]; // deltas for 4 q4_0 blocks
Expand Down Expand Up @@ -534,12 +539,12 @@ typedef struct {
static_assert(sizeof(block_iq4_xs) == sizeof(ggml_half) + sizeof(uint16_t) + QK_K/64 + QK_K/2, "wrong iq4_xs block size/padding");

typedef struct {
ggml_half d[4];
uint8_t scales_h[QK_K/32];
uint8_t scales_l[QK_K/16];
uint8_t qs[QK_K*2];
ggml_half d[8];
uint8_t scales_h[QK_K/16];
uint8_t scales_l[QK_K/ 8];
uint8_t qs[QK_K*4];
} block_iq4_xs_r4;
static_assert(sizeof(block_iq4_xs_r4) == 4*sizeof(ggml_half) + QK_K/32 + QK_K/16 + QK_K*2, "wrong iq4_xs_rs block size/padding");
static_assert(sizeof(block_iq4_xs_r4) == 8*sizeof(block_iq4_xs), "wrong iq4_xs_rs block size/padding");

typedef struct {
uint8_t scales[QK_K/32];
Expand Down
1 change: 0 additions & 1 deletion ggml/src/ggml-quants.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,6 @@ void quantize_row_q8_0(const float * restrict x, void * restrict vy, int64_t k)

#if defined(__ARM_NEON)
for (int i = 0; i < nb; i++) {
int i4 = i/4, ir = i%4;
float32x4_t srcv [8];
float32x4_t asrcv[8];
float32x4_t amaxv[8];
Expand Down
Loading