Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions ggml/src/ggml-cpu/ggml-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ggml-backend.h"
#include "traits.h"
#include "ggml-cpu-impl.h"
#include "ggml-cpu.h"
#include "ggml-impl.h"
#include "quants.h"
#include "ggml-threading.h"
Expand Down Expand Up @@ -1340,7 +1341,9 @@ UseGgmlGemm1:;
const size_t nbw3 = nbw2*ne12;

assert(params->wsize >= ne13*nbw3);
GGML_ASSERT(src1->type == GGML_TYPE_F32 || src1->type == GGML_TYPE_F16);
// F16 src1 converts straight to float, so wdata rows must be floats; a quantized vec_dot_type would overrun the buffer
GGML_ASSERT(src1->type == GGML_TYPE_F32 ||
(src1->type == GGML_TYPE_F16 && vec_dot_type == GGML_TYPE_F32));

#if 0
for (int64_t i13 = 0; i13 < ne13; ++i13) {
Expand All @@ -1366,11 +1369,7 @@ UseGgmlGemm1:;
if (src1->type == GGML_TYPE_F32) {
from_float((const float *) src1_block, dst_block, n_block);
} else {
const ggml_fp16_t * src_f16 = (const ggml_fp16_t *) src1_block;
float * dst_f32 = (float *) dst_block;
for (int64_t i = 0; i < n_block; ++i) {
dst_f32[i] = GGML_CPU_FP16_TO_FP32(src_f16[i]);
}
ggml_cpu_fp16_to_fp32((const ggml_fp16_t *) src1_block, (float *) dst_block, n_block);
}
}
}
Expand Down