]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : silence UB sanitizer error during iq2_xxs quantization (llama/0)
authorGeorgi Gerganov <redacted>
Thu, 23 May 2024 14:17:43 +0000 (17:17 +0300)
committerGeorgi Gerganov <redacted>
Tue, 28 May 2024 11:41:08 +0000 (14:41 +0300)
src/ggml-quants.c

index 88f58a33973f9c4ba8866f4ff90f6158cc6bb269..bb01ce93cb9693aa81077079f5a905f4071bf841 100644 (file)
@@ -12144,7 +12144,7 @@ static void quantize_row_iq2_xxs_impl(const float * restrict x, void * restrict
                     printf("\n");
                     GGML_ASSERT(false);
                 }
-                q2[2*ib+0] |= (grid_index << 8*k);
+                q2[2*ib+0] |= ((uint32_t) grid_index << 8*k);
                 q2[2*ib+1] |= (block_signs[k] << 7*k);
             }
             GGML_ASSERT(scale >= 0);