From 53c4b182c96d4f748dd4ad9b910c23cbafb41c12 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 23 Apr 2023 12:33:21 +0000 Subject: [PATCH] [auto] Sync version 2304231232.0.0+llamacpp-release.master-53c8434 --- Cargo.toml | 2 +- VERSION.txt | 2 +- ggml-src/ggml.c | 14 +++++--------- ggml-tag-current.txt | 2 +- ggml-tag-previous.txt | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3eee410..98334c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ggml-sys-bleedingedge" -version = "2304230824.0.0+llamacpp-release.master-c9e2c26" +version = "2304231232.0.0+llamacpp-release.master-53c8434" description = "Bleeding edge low-level bindings to GGML. " repository = "https://github.com/KerfuffleV2/ggml-bleeding-edge" keywords = ["deep-learning", "machine-learning", "tensors", "ggml", "ml"] diff --git a/VERSION.txt b/VERSION.txt index ae36730..f094f60 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -2304230824.0.0+llamacpp-release.master-c9e2c26 +2304231232.0.0+llamacpp-release.master-53c8434 diff --git a/ggml-src/ggml.c b/ggml-src/ggml.c index 3c45c5e..3ee2d08 100644 --- a/ggml-src/ggml.c +++ b/ggml-src/ggml.c @@ -2947,6 +2947,7 @@ static void ggml_vec_dot_q4_3_q8_0(const int n, float * restrict s, const void * #elif defined(__AVX2__) // Initialize accumulator with zeros __m256 acc = _mm256_setzero_ps(); + float summs = 0.0f; // Main loop for (int i = 0; i < nb; i++) { @@ -2954,9 +2955,8 @@ static void ggml_vec_dot_q4_3_q8_0(const int n, float * restrict s, const void * const __m128 d1 = _mm_set1_ps(GGML_FP16_TO_FP32(x[2*i + 1].d)); const __m256 dx = _mm256_set_m128(d1, d0); - const __m128 m0 = _mm_set1_ps(GGML_FP16_TO_FP32(x[2*i + 0].m)); - const __m128 m1 = _mm_set1_ps(GGML_FP16_TO_FP32(x[2*i + 1].m)); - const __m256 mx = _mm256_set_m128(m1, m0); + summs += GGML_FP16_TO_FP32(x[2*i + 0].m) * y[i].s0 + + GGML_FP16_TO_FP32(x[2*i + 1].m) * y[i].s1; const __m128i bx0 = bytes_from_nibbles_16(x[2*i + 0].qs); const __m128i bx1 = bytes_from_nibbles_16(x[2*i + 1].qs); @@ -2965,16 +2965,12 @@ static void ggml_vec_dot_q4_3_q8_0(const int n, float * restrict s, const void * const __m256 dy = _mm256_broadcast_ss(&y[i].d); const __m256i by = _mm256_loadu_si256((const __m256i *)y[i].qs); - const __m256i syi = _mm256_maddubs_epi16(_mm256_set1_epi8(1), by); - const __m256 syf = sum_i16_pairs_float(syi); - const __m256 q = mul_sum_i8_pairs_float(bx, by); - const __m256 sxy = _mm256_fmadd_ps(q, dx, _mm256_mul_ps(mx, syf)); - acc = _mm256_fmadd_ps(sxy, dy, acc); + acc = _mm256_fmadd_ps(q, _mm256_mul_ps(dx, dy), acc); } - *s = hsum_float_8(acc); + *s = hsum_float_8(acc) + summs; #else // scalar float sumf = 0.0; diff --git a/ggml-tag-current.txt b/ggml-tag-current.txt index 07bd649..4884d29 100644 --- a/ggml-tag-current.txt +++ b/ggml-tag-current.txt @@ -1 +1 @@ -master-c9e2c26 +master-53c8434 diff --git a/ggml-tag-previous.txt b/ggml-tag-previous.txt index f6cc61e..07bd649 100644 --- a/ggml-tag-previous.txt +++ b/ggml-tag-previous.txt @@ -1 +1 @@ -master-0e018fe +master-c9e2c26