ggml : add ggml_mul_mat_set_prec

ggml-ci
This commit is contained in:
Georgi Gerganov 2023-12-18 13:28:10 +02:00
parent a8d2a6f3ef
commit 18c67bdd84
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
4 changed files with 108 additions and 45 deletions

12
ggml.h
View file

@ -343,6 +343,12 @@ extern "C" {
GGML_TYPE_COUNT,
};
// precision
enum ggml_prec {
GGML_PREC_DEFAULT,
GGML_PREC_F32,
};
enum ggml_backend_type {
GGML_BACKEND_CPU = 0,
GGML_BACKEND_GPU = 10,
@ -1057,6 +1063,12 @@ extern "C" {
struct ggml_tensor * a,
struct ggml_tensor * b);
// change the precision of a matrix multiplication
// set to GGML_PREC_F32 for higher precision (useful for phi-2)
GGML_API void ggml_mul_mat_set_prec(
struct ggml_tensor * a,
enum ggml_prec prec);
// indirect matrix multiplication
// ggml_mul_mat_id(ctx, as, ids, id, b) ~= ggml_mul_mat(as[ids[id]], b)
GGML_API struct ggml_tensor * ggml_mul_mat_id(