Explorar o código

ggml : tiny ggml_vec_dot_q4_K_q8_K AVX2 improvement (#2819)

Ronny Brendel %!s(int64=2) %!d(string=hai) anos
pai
achega
3af6b86301
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      k_quants.c

+ 2 - 2
k_quants.c

@@ -2694,13 +2694,13 @@ void ggml_vec_dot_q4_K_q8_K(const int n, float * restrict s, const void * restri
             const __m256i q8l = _mm256_loadu_si256((const __m256i*)q8); q8 += 32;
             const __m256i q8l = _mm256_loadu_si256((const __m256i*)q8); q8 += 32;
             __m256i p16l = _mm256_maddubs_epi16(q4l, q8l);
             __m256i p16l = _mm256_maddubs_epi16(q4l, q8l);
             p16l = _mm256_madd_epi16(scale_l, p16l);
             p16l = _mm256_madd_epi16(scale_l, p16l);
-            sumi = _mm256_add_epi32(sumi, p16l);
 
 
             const __m256i q8h = _mm256_loadu_si256((const __m256i*)q8); q8 += 32;
             const __m256i q8h = _mm256_loadu_si256((const __m256i*)q8); q8 += 32;
             __m256i p16h = _mm256_maddubs_epi16(q4h, q8h);
             __m256i p16h = _mm256_maddubs_epi16(q4h, q8h);
             p16h = _mm256_madd_epi16(scale_h, p16h);
             p16h = _mm256_madd_epi16(scale_h, p16h);
-            sumi = _mm256_add_epi32(sumi, p16h);
+            const __m256i sumj = _mm256_add_epi32(p16l, p16h);
 
 
+            sumi = _mm256_add_epi32(sumi, sumj);
         }
         }
 
 
         __m256 vd = _mm256_set1_ps(d);
         __m256 vd = _mm256_set1_ps(d);