Skip to content

Commit 802782c

Browse files
committed
Fix a bug.
1 parent 58ab353 commit 802782c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ggml/src/ggml-cpu/tmac/tbl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,11 @@ void qgemm_lut_int8_g4(
837837
for (int32_t k_outer = 0; k_outer < k_outer_max; k_outer++) {
838838
uint8_t * a = ((uint8_t *)A) + k_outer * bm * kfactor / ngroups_per_elem;
839839
tmac_float_type * scales = one_scale ? (tmac_float_type *)Scales :
840-
has_zero_point ? ((tmac_float_type *)Scales) + (k_outer * act_group_size / q_group_size) * m * 2:
841-
((tmac_float_type *)Scales) + (k_outer * act_group_size / q_group_size) * m;
840+
has_zero_point ? ((tmac_float_type *)Scales) + k_outer * m * 2:
841+
((tmac_float_type *)Scales) + k_outer * m;
842842
int8_t * lut = ((int8_t *)LUT) + k_outer * kfactor * int(pow(2, g));
843-
tmac_float_type * lut_scales = ((tmac_float_type *)LUT_Scales) + k_outer; // k_outer * kfactor * g / act_group_size == k_outer
844-
tmac_float_type * lut_biases = ((tmac_float_type *)LUT_Biases) + k_outer; // k_outer * kfactor * g / act_group_size == k_outer
843+
tmac_float_type * lut_scales = ((tmac_float_type *)LUT_Scales) + (k_outer * q_group_size / act_group_size); // k_outer * kfactor * g / act_group_size == k_outer
844+
tmac_float_type * lut_biases = ((tmac_float_type *)LUT_Biases) + (k_outer * q_group_size / act_group_size); // k_outer * kfactor * g / act_group_size == k_outer
845845

846846
if (has_scale && kfactor == 8 && bits == 2 && actk == 8 && has_zero_point && !one_scale) {
847847
tbl_g4_int8_float_update_impl<true, 8, 2, 8, false, true, false>(

0 commit comments

Comments
 (0)