Spaces:
Sleeping
Sleeping
lixing-star
commited on
Commit
·
0bd2be3
1
Parent(s):
0274100
ggml: fix loongarch quantize_row_q8_1 error (llama/14827)
Browse files
ggml/src/ggml-cpu/arch/loongarch/quants.c
CHANGED
|
@@ -544,7 +544,7 @@ void quantize_row_q8_1(const float * GGML_RESTRICT x, void * GGML_RESTRICT vy, i
|
|
| 544 |
__m128 max4 = __lsx_vfmax_s( lasx_extractf128( max_abs, 1 ), lasx_extractf128( max_abs, 0) );
|
| 545 |
max4 = __lsx_vfmax_s( max4, (__m128)__lsx_vpickod_d((__m128i) max4, (__m128i)max4 ) );
|
| 546 |
__m128 tmp = max4;
|
| 547 |
-
max4 = __lsx_vfmax_s( max4, (__m128)__lsx_vextrins_w((__m128i)tmp, (__m128i)max4,
|
| 548 |
const float max_scalar = ((v4f32)max4)[0];
|
| 549 |
|
| 550 |
// Quantize these floats
|
|
|
|
| 544 |
__m128 max4 = __lsx_vfmax_s( lasx_extractf128( max_abs, 1 ), lasx_extractf128( max_abs, 0) );
|
| 545 |
max4 = __lsx_vfmax_s( max4, (__m128)__lsx_vpickod_d((__m128i) max4, (__m128i)max4 ) );
|
| 546 |
__m128 tmp = max4;
|
| 547 |
+
max4 = __lsx_vfmax_s( max4, (__m128)__lsx_vextrins_w((__m128i)tmp, (__m128i)max4, 0x1 ));
|
| 548 |
const float max_scalar = ((v4f32)max4)[0];
|
| 549 |
|
| 550 |
// Quantize these floats
|