Skip to content

Commit

Permalink
ggml: show ggml_type_traits_t values
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bevenius <[email protected]>
  • Loading branch information
danbev committed Jun 16, 2024
1 parent b2ed29c commit 8cf6ded
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fundamentals/ggml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TARGETS := $(patsubst $(SRCDIR)/%.c, %, $(SOURCES))

all: $(TARGETS)

quants: CFLAGS += -Iggml/src -Iggml/include/ggml
ggml-quants: CFLAGS += -Iggml/src -Iggml/include/ggml

$(TARGETS): % : $(SRCDIR)/%.c | bindir
$(CC) $(CFLAGS) $(LDFLAGS) -o ${BINDIR}/$@ $< \
Expand Down
7 changes: 5 additions & 2 deletions fundamentals/ggml/src/ggml-quants.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdio.h>

#include "ggml.h"
#include "ggml/ggml.h"
#include "ggml-quants.h"
#include "ggml-impl.h"

Expand Down Expand Up @@ -34,7 +34,10 @@ int main(int argc, char **argv) {
printf("data[%d]: %f\n", i, block_q4_0.qs[i] * ggml_compute_fp16_to_fp32(block_q4_0.d));
}

//ggml_type_traits_t q4_0 = type_traits[GGML_TYPE_Q4_0];
ggml_type_traits_t q4_0 = ggml_internal_get_type_traits(GGML_TYPE_Q4_0);
printf("ggml type trait name: %s\n", q4_0.type_name);
printf("ggml type trait block size: %d\n", q4_0.blck_size);
printf("ggml type trait is_quantized: %s\n", q4_0.is_quantized ? "true" : "false");

return 0;
}

0 comments on commit 8cf6ded

Please sign in to comment.