From ee588a5c2470e4e95cd0455022f77d16e18eb75f Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Thu, 11 Apr 2024 14:10:47 +0200 Subject: [PATCH] eval-callback: renamed from ggml-debug --- .gitignore | 2 +- Makefile | 4 ++-- docs/HOWTO-add-model.md | 2 +- examples/CMakeLists.txt | 2 +- examples/eval-callback/CMakeLists.txt | 9 +++++++++ examples/{ggml-debug => eval-callback}/README.md | 4 ++-- .../ggml-debug.cpp => eval-callback/eval-callback.cpp} | 0 examples/ggml-debug/CMakeLists.txt | 9 --------- 8 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 examples/eval-callback/CMakeLists.txt rename examples/{ggml-debug => eval-callback}/README.md (98%) rename examples/{ggml-debug/ggml-debug.cpp => eval-callback/eval-callback.cpp} (100%) delete mode 100644 examples/ggml-debug/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 34db925a0..fdc5184a1 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,7 @@ models-mnt /convert-llama2c-to-ggml /embd-input-test /embedding -/ggml-debug +/eval-callback /gguf /gguf-llama-simple /gguf-split diff --git a/Makefile b/Makefile index b5aa34a1b..30cbd7a09 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Define the default target now so that it is always the first target BUILD_TARGETS = \ main quantize quantize-stats perplexity imatrix embedding vdot q8dot train-text-from-scratch convert-llama2c-to-ggml \ - simple batched batched-bench save-load-state server gguf gguf-split ggml-debug llama-bench libllava.a llava-cli baby-llama beam-search \ + simple batched batched-bench save-load-state server gguf gguf-split eval-callback llama-bench libllava.a llava-cli baby-llama beam-search \ retrieval speculative infill tokenize benchmark-matmult parallel finetune export-lora lookahead lookup passkey gritlm tests/test-c.o # Binaries only useful for tests @@ -800,7 +800,7 @@ gguf-split: examples/gguf-split/gguf-split.cpp ggml.o llama.o $(COMMON_DEPS) $(O $(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<) $(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) -ggml-debug: examples/ggml-debug/ggml-debug.cpp ggml.o llama.o $(COMMON_DEPS) $(OBJS) +eval-callback: examples/eval-callback ggml.o llama.o $(COMMON_DEPS) $(OBJS) $(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<) $(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) diff --git a/docs/HOWTO-add-model.md b/docs/HOWTO-add-model.md index e8aa71dc3..a56b78344 100644 --- a/docs/HOWTO-add-model.md +++ b/docs/HOWTO-add-model.md @@ -100,7 +100,7 @@ Have a look to existing implementation like `build_llama`, `build_dbrx` or `buil When implementing a new graph, please note that the underlying `ggml` backends might not support them all, support of missing backend operations can be added in another PR. -Note: to debug the inference graph: you can use [ggml-debug](../examples/ggml-debug). +Note: to debug the inference graph: you can use [eval-callback](../examples/eval-callback). ## GGUF specification diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index df39b6236..f421769cc 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -19,10 +19,10 @@ else() add_subdirectory(benchmark) add_subdirectory(convert-llama2c-to-ggml) add_subdirectory(embedding) + add_subdirectory(eval-callback) add_subdirectory(finetune) add_subdirectory(gritlm) add_subdirectory(gguf-split) - add_subdirectory(ggml-debug) add_subdirectory(infill) add_subdirectory(llama-bench) add_subdirectory(llava) diff --git a/examples/eval-callback/CMakeLists.txt b/examples/eval-callback/CMakeLists.txt new file mode 100644 index 000000000..d53f37422 --- /dev/null +++ b/examples/eval-callback/CMakeLists.txt @@ -0,0 +1,9 @@ +set(TARGET eval-callback) +add_executable(${TARGET} eval-callback.cpp) +install(TARGETS ${TARGET} RUNTIME) +target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) +target_compile_features(${TARGET} PRIVATE cxx_std_11) + +set(TEST_TARGET test-eval-callback) +add_test(NAME ${TEST_TARGET} COMMAND eval-callback --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf --model stories260K.gguf --prompt hello --seed 42) +set_property(TEST ${TEST_TARGET} PROPERTY LABELS eval-callback curl) diff --git a/examples/ggml-debug/README.md b/examples/eval-callback/README.md similarity index 98% rename from examples/ggml-debug/README.md rename to examples/eval-callback/README.md index 4fd9e2408..66a37e878 100644 --- a/examples/ggml-debug/README.md +++ b/examples/eval-callback/README.md @@ -1,4 +1,4 @@ -# llama.cpp/examples/ggml-debug +# llama.cpp/examples/eval-callback A simple example which demonstrates how to use callback during the inference. It simply prints to the console all operations and tensor data. @@ -6,7 +6,7 @@ It simply prints to the console all operations and tensor data. Usage: ```shell -ggml-debug \ +eval-callback \ --hf-repo ggml-org/models \ --hf-file phi-2/ggml-model-q4_0.gguf \ --model phi-2-q4_0.gguf \ diff --git a/examples/ggml-debug/ggml-debug.cpp b/examples/eval-callback/eval-callback.cpp similarity index 100% rename from examples/ggml-debug/ggml-debug.cpp rename to examples/eval-callback/eval-callback.cpp diff --git a/examples/ggml-debug/CMakeLists.txt b/examples/ggml-debug/CMakeLists.txt deleted file mode 100644 index 225ea1a68..000000000 --- a/examples/ggml-debug/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(TARGET ggml-debug) -add_executable(${TARGET} ggml-debug.cpp) -install(TARGETS ${TARGET} RUNTIME) -target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) -target_compile_features(${TARGET} PRIVATE cxx_std_11) - -set(TEST_TARGET test-ggml-debug) -add_test(NAME ${TEST_TARGET} COMMAND ggml-debug --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf --model stories260K.gguf --prompt hello --seed 42) -set_property(TEST ${TEST_TARGET} PROPERTY LABELS ggml-debug curl)