ggml : force F32 precision for ggml_mul_mat

This commit is contained in:
Georgi Gerganov 2023-12-19 16:23:39 +02:00
parent 0ef3ca2ac6
commit 4cc78d3873
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
2 changed files with 57 additions and 17 deletions

6
ggml.c
View file

@ -4077,6 +4077,12 @@ struct ggml_tensor * ggml_mul_mat(
const int64_t ne[4] = { a->ne[1], b->ne[1], b->ne[2], b->ne[3] };
struct ggml_tensor * result = ggml_new_tensor(ctx, GGML_TYPE_F32, 4, ne);
// TMP: force f32 precision
{
const int32_t prec_i32 = GGML_PREC_F32;
ggml_set_op_params_i32(result, 0, prec_i32);
}
result->op = GGML_OP_MUL_MAT;
result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
result->src[0] = a;