From f0a13e2add8ee1172e54a2ba9e41a727c63164b7 Mon Sep 17 00:00:00 2001 From: Alon Faraj Date: Tue, 29 Aug 2023 16:04:10 +0300 Subject: [PATCH 1/7] build ci: run make test --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10320ad1fc137..be426926100f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,12 @@ jobs: run: | CC=gcc-8 make + - name: Test + id: make_test + run: | + CC=gcc-8 make tests + make test + ubuntu-latest-cmake: runs-on: ubuntu-latest @@ -157,6 +163,12 @@ jobs: run: | make + - name: Test + id: make_test + run: | + CC=gcc-8 make tests + make test + macOS-latest-cmake: runs-on: macos-latest From 89cc7a333871bdfe92df345c653f4304547a76ac Mon Sep 17 00:00:00 2001 From: Alon Faraj Date: Tue, 29 Aug 2023 16:04:29 +0300 Subject: [PATCH 2/7] makefile: - add all - add test --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 02ba3e36d8466..535a76f7bbb32 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,26 @@ TEST_TARGETS = tests/test-llama-grammar tests/test-grammar-parser tests/test-dou default: $(BUILD_TARGETS) +test: + @echo "Running tests..." + @for test_target in $(TEST_TARGETS); do \ + if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \ + # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + continue; \ + elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \ + # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + continue; \ + elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \ + # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + continue; \ + else \ + ./$$test_target; \ + fi; \ + done + @echo "All tests have been run." + +all: $(BUILD_TARGETS) $(TEST_TARGETS) + ifndef UNAME_S UNAME_S := $(shell uname -s) endif From c2fd80a0e854360230ce917682a7e1c41ffc2d02 Mon Sep 17 00:00:00 2001 From: Alon Faraj Date: Tue, 29 Aug 2023 16:09:19 +0300 Subject: [PATCH 3/7] enable tests/test-tokenizer-0-llama --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 535a76f7bbb32..b8d1546fa0485 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,7 @@ test: @echo "Running tests..." @for test_target in $(TEST_TARGETS); do \ if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \ - # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ - continue; \ + ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \ # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ continue; \ From 5cb2b0c1a9e502bfd4a27e5e0bb19d1db1591548 Mon Sep 17 00:00:00 2001 From: Alon Faraj Date: Tue, 29 Aug 2023 16:17:59 +0300 Subject: [PATCH 4/7] fix path to model --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b8d1546fa0485..799983d5a6a32 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,12 @@ test: @echo "Running tests..." @for test_target in $(TEST_TARGETS); do \ if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \ - ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \ - # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + # ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ continue; \ elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \ - # ./$$test_target $(CURDIR)/../models/ggml-vocab-llama.gguf; \ + # ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ continue; \ else \ ./$$test_target; \ From 5cae6ba54af0bd2e30c77b7b3d3f785f0bec5568 Mon Sep 17 00:00:00 2001 From: Alon Faraj Date: Tue, 29 Aug 2023 17:19:19 +0300 Subject: [PATCH 5/7] remove gcc-8 from macos build test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be426926100f3..20fd8c2b58361 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,7 +166,7 @@ jobs: - name: Test id: make_test run: | - CC=gcc-8 make tests + make tests make test macOS-latest-cmake: From 6310887983195534240823376c2bdf7cddb6d7f7 Mon Sep 17 00:00:00 2001 From: alonfaraj Date: Wed, 30 Aug 2023 00:10:15 +0300 Subject: [PATCH 6/7] Update Makefile --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 799983d5a6a32..c82adb83f796f 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,9 @@ test: @for test_target in $(TEST_TARGETS); do \ if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \ ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ - elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \ - # ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ + elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; \ continue; \ elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \ - # ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ continue; \ else \ ./$$test_target; \ From 3b43f94c81df4ff9368cb7516d36cd14de6e10d8 Mon Sep 17 00:00:00 2001 From: alonfaraj Date: Wed, 30 Aug 2023 00:20:40 +0300 Subject: [PATCH 7/7] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c82adb83f796f..4e9ac50e1c775 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ test: @for test_target in $(TEST_TARGETS); do \ if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \ ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \ - elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; \ + elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \ continue; \ elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \ continue; \