Skip to content

Commit 0aa04a2

Browse files
committed
Merge commit '469c9addef75893e6be12edda852d12e840bf064' into nomic-vulkan
2 parents 8973fa7 + 469c9ad commit 0aa04a2

File tree

102 files changed

+19036
-8547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+19036
-8547
lines changed

.github/ISSUE_TEMPLATE/custom.md renamed to .github/ISSUE_TEMPLATE/bug.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
2-
name: Issue and enhancement template
3-
about: Used to report issues and request enhancements for llama.cpp
4-
title: "[User] Insert summary of your issue or enhancement.."
5-
labels: ''
2+
name: Bug template
3+
about: Used to report bugs in llama.cpp
4+
labels: ["bug"]
65
assignees: ''
76

87
---
@@ -46,7 +45,7 @@ $ g++ --version
4645

4746
# Failure Information (for bugs)
4847

49-
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
48+
Please help provide information about the failure / bug.
5049

5150
# Steps to Reproduce
5251

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Enhancement template
3+
about: Used to request enhancements for llama.cpp
4+
labels: ["enhancement"]
5+
assignees: ''
6+
7+
---
8+
9+
# Prerequisites
10+
11+
Please answer the following questions for yourself before submitting an issue.
12+
13+
- [ ] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
14+
- [ ] I carefully followed the [README.md](https://github.com/ggerganov/llama.cpp/blob/master/README.md).
15+
- [ ] I [searched using keywords relevant to my issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) to make sure that I am creating a new issue that is not already open (or closed).
16+
- [ ] I reviewed the [Discussions](https://github.com/ggerganov/llama.cpp/discussions), and have a new bug or useful enhancement to share.
17+
18+
# Feature Description
19+
20+
Please provide a detailed written description of what you were trying to do, and what you expected `llama.cpp` to do as an enhancement.
21+
22+
# Motivation
23+
24+
Please provide a detailed written description of reasons why this feature is necessary and how it is useful to `llama.cpp` users.
25+
26+
# Possible Implementation
27+
28+
If you have an idea as to how it can be implemented, please write a detailed description. Feel free to give links to external sources or share visuals that might be helpful to understand the details better.

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ jobs:
276276
run: |
277277
xcodebuild -scheme llama -destination "${{ matrix.destination }}"
278278
279+
- name: Build Swift Example
280+
id: make_build_swift_example
281+
run: |
282+
make swift
283+
279284
windows-latest-cmake:
280285
runs-on: windows-latest
281286

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*.gcno
1111
*.gcda
1212
*.dot
13+
*.bat
1314
*.metallib
1415
.DS_Store
1516
.build/
@@ -44,6 +45,7 @@ models-mnt
4445
/infill
4546
/libllama.so
4647
/llama-bench
48+
/llava
4749
/main
4850
/metal
4951
/perplexity
@@ -55,6 +57,7 @@ models-mnt
5557
/server
5658
/simple
5759
/batched
60+
/batched-bench
5861
/export-lora
5962
/finetune
6063
/speculative

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,7 @@ endif()
559559
if (LLAMA_ALL_WARNINGS)
560560
if (NOT MSVC)
561561
set(warning_flags -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function)
562-
set(c_flags -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int
563-
-Werror=implicit-function-declaration)
562+
set(c_flags -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration)
564563
set(cxx_flags -Wmissing-declarations -Wmissing-noreturn)
565564
set(host_cxx_flags "")
566565
@@ -592,7 +591,8 @@ if (LLAMA_ALL_WARNINGS)
592591
set(c_flags ${c_flags} ${warning_flags})
593592
set(cxx_flags ${cxx_flags} ${warning_flags})
594593
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${c_flags}>"
595-
"$<$<COMPILE_LANGUAGE:CXX>:${cxx_flags} ${host_cxx_flags}>")
594+
"$<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>"
595+
"$<$<COMPILE_LANGUAGE:CXX>:${host_cxx_flags}>")
596596
597597
endif()
598598

Makefile

Lines changed: 74 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Define the default target now so that it is always the first target
2-
BUILD_TARGETS = main quantize quantize-stats perplexity embedding vdot q8dot train-text-from-scratch convert-llama2c-to-ggml simple batched save-load-state server embd-input-test gguf llama-bench baby-llama beam-search speculative infill benchmark-matmult parallel finetune export-lora tests/test-c.o
2+
BUILD_TARGETS = \
3+
main quantize quantize-stats perplexity embedding vdot q8dot train-text-from-scratch convert-llama2c-to-ggml \
4+
simple batched batched-bench save-load-state server gguf llama-bench llava baby-llama beam-search \
5+
speculative infill benchmark-matmult parallel finetune export-lora tests/test-c.o
36

47
# Binaries only useful for tests
5-
TEST_TARGETS = tests/test-llama-grammar tests/test-grammar-parser tests/test-double-float tests/test-grad0 tests/test-opt tests/test-quantize-fns tests/test-quantize-perf tests/test-sampling tests/test-tokenizer-0-llama tests/test-tokenizer-0-falcon tests/test-tokenizer-1-llama tests/test-tokenizer-1-bpe
8+
TEST_TARGETS = \
9+
tests/test-llama-grammar tests/test-grammar-parser tests/test-double-float tests/test-grad0 tests/test-opt \
10+
tests/test-quantize-fns tests/test-quantize-perf tests/test-sampling tests/test-tokenizer-0-llama \
11+
tests/test-tokenizer-0-falcon tests/test-tokenizer-1-llama tests/test-tokenizer-1-bpe
612

713
# Code coverage output files
814
COV_TARGETS = *.gcno tests/*.gcno *.gcda tests/*.gcda *.gcov tests/*.gcov lcov-report gcovr-report
@@ -172,6 +178,24 @@ else
172178
MK_CPPFLAGS += -DNDEBUG
173179
endif
174180

181+
ifdef LLAMA_SANITIZE_THREAD
182+
MK_CFLAGS += -fsanitize=thread -g
183+
MK_CXXFLAGS += -fsanitize=thread -g
184+
MK_LDFLAGS += -fsanitize=thread -g
185+
endif
186+
187+
ifdef LLAMA_SANITIZE_ADDRESS
188+
MK_CFLAGS += -fsanitize=address -fno-omit-frame-pointer -g
189+
MK_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer -g
190+
MK_LDFLAGS += -fsanitize=address -fno-omit-frame-pointer -g
191+
endif
192+
193+
ifdef LLAMA_SANITIZE_UNDEFINED
194+
MK_CFLAGS += -fsanitize=undefined -g
195+
MK_CXXFLAGS += -fsanitize=undefined -g
196+
MK_LDFLAGS += -fsanitize=undefined -g
197+
endif
198+
175199
ifdef LLAMA_SERVER_VERBOSE
176200
MK_CPPFLAGS += -DSERVER_VERBOSE=$(LLAMA_SERVER_VERBOSE)
177201
endif
@@ -520,7 +544,13 @@ OBJS += ggml-alloc.o ggml-backend.o
520544
llama.o: llama.cpp ggml.h ggml-alloc.h ggml-backend.h ggml-cuda.h ggml-metal.h llama.h
521545
$(CXX) $(CXXFLAGS) -c $< -o $@
522546

523-
common.o: common/common.cpp common/common.h build-info.h common/log.h
547+
COMMON_H_DEPS = common/common.h common/sampling.h build-info.h common/log.h
548+
COMMON_DEPS = $(COMMON_H_DEPS) common.o sampling.o grammar-parser.o
549+
550+
common.o: common/common.cpp $(COMMON_H_DEPS)
551+
$(CXX) $(CXXFLAGS) -c $< -o $@
552+
553+
sampling.o: common/sampling.cpp $(COMMON_H_DEPS)
524554
$(CXX) $(CXXFLAGS) -c $< -o $@
525555

526556
console.o: common/console.cpp common/console.h
@@ -542,19 +572,22 @@ clean:
542572
# Examples
543573
#
544574

545-
main: examples/main/main.cpp build-info.h ggml.o llama.o common.o console.o grammar-parser.o $(OBJS)
575+
main: examples/main/main.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) console.o grammar-parser.o $(OBJS)
546576
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
547577
@echo
548578
@echo '==== Run ./main -h for help. ===='
549579
@echo
550580

551-
infill: examples/infill/infill.cpp build-info.h ggml.o llama.o common.o console.o grammar-parser.o $(OBJS)
581+
infill: examples/infill/infill.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) console.o grammar-parser.o $(OBJS)
552582
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
553583

554-
simple: examples/simple/simple.cpp build-info.h ggml.o llama.o common.o $(OBJS)
584+
simple: examples/simple/simple.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
555585
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
556586

557-
batched: examples/batched/batched.cpp build-info.h ggml.o llama.o common.o $(OBJS)
587+
batched: examples/batched/batched.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
588+
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
589+
590+
batched-bench: examples/batched-bench/batched-bench.cpp build-info.h ggml.o llama.o common.o $(OBJS)
558591
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
559592

560593
quantize: examples/quantize/quantize.cpp build-info.h ggml.o llama.o $(OBJS)
@@ -563,60 +596,61 @@ quantize: examples/quantize/quantize.cpp build-info.h ggml.
563596
quantize-stats: examples/quantize-stats/quantize-stats.cpp build-info.h ggml.o llama.o $(OBJS)
564597
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
565598

566-
perplexity: examples/perplexity/perplexity.cpp build-info.h ggml.o llama.o common.o $(OBJS)
599+
perplexity: examples/perplexity/perplexity.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
567600
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
568601

569-
embedding: examples/embedding/embedding.cpp build-info.h ggml.o llama.o common.o $(OBJS)
602+
embedding: examples/embedding/embedding.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
570603
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
571604

572-
save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o llama.o common.o $(OBJS)
605+
save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
573606
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
574607

575-
server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp examples/server/index.html.hpp examples/server/index.js.hpp examples/server/completion.js.hpp build-info.h ggml.o llama.o common.o grammar-parser.o $(OBJS)
576-
$(CXX) $(CXXFLAGS) -Iexamples/server $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS) $(LWINSOCK2)
577-
578-
$(LIB_PRE)embdinput$(DSO_EXT): examples/embd-input/embd-input.h examples/embd-input/embd-input-lib.cpp build-info.h ggml.o llama.o common.o $(OBJS)
579-
$(CXX) --shared $(CXXFLAGS) $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS)
580-
581-
582-
embd-input-test: $(LIB_PRE)embdinput$(DSO_EXT) examples/embd-input/embd-input-test.cpp build-info.h ggml.o llama.o common.o $(OBJS)
583-
$(CXX) $(CXXFLAGS) $(filter-out %$(DSO_EXT),$(filter-out %.h,$(filter-out %.hpp,$^))) -o $@ $(LDFLAGS) -L. -lembdinput
608+
server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp examples/server/index.html.hpp examples/server/index.js.hpp examples/server/completion.js.hpp examples/llava/clip.cpp examples/llava/clip.h common/stb_image.h build-info.h ggml.o llama.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
609+
$(CXX) $(CXXFLAGS) -Iexamples/server $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS) $(LWINSOCK2) -Wno-cast-qual
584610

585611
gguf: examples/gguf/gguf.cpp ggml.o llama.o $(OBJS)
586612
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
587613

588-
train-text-from-scratch: examples/train-text-from-scratch/train-text-from-scratch.cpp ggml.o llama.o common.o train.o $(OBJS)
614+
train-text-from-scratch: examples/train-text-from-scratch/train-text-from-scratch.cpp ggml.o llama.o $(COMMON_DEPS) train.o $(OBJS)
589615
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
590616

591617
convert-llama2c-to-ggml: examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp ggml.o llama.o $(OBJS)
592618
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
593619

594-
llama-bench: examples/llama-bench/llama-bench.cpp build-info.h ggml.o llama.o common.o $(OBJS)
620+
llama-bench: examples/llama-bench/llama-bench.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
595621
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
596622

597-
baby-llama: examples/baby-llama/baby-llama.cpp ggml.o llama.o common.o train.o $(OBJS)
623+
llava: examples/llava/llava.cpp examples/llava/llava-utils.h examples/llava/clip.cpp examples/llava/clip.h common/stb_image.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
624+
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) -Wno-cast-qual
625+
626+
baby-llama: examples/baby-llama/baby-llama.cpp ggml.o llama.o $(COMMON_DEPS) train.o $(OBJS)
598627
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
599628

600-
beam-search: examples/beam-search/beam-search.cpp build-info.h ggml.o llama.o common.o $(OBJS)
629+
beam-search: examples/beam-search/beam-search.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
601630
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
602631

603-
finetune: examples/finetune/finetune.cpp build-info.h ggml.o llama.o common.o train.o $(OBJS)
632+
finetune: examples/finetune/finetune.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) train.o $(OBJS)
604633
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
605634

606-
export-lora: examples/export-lora/export-lora.cpp build-info.h ggml.o llama.o common.o $(OBJS)
635+
export-lora: examples/export-lora/export-lora.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
607636
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
608637

609-
speculative: examples/speculative/speculative.cpp build-info.h ggml.o llama.o common.o grammar-parser.o $(OBJS)
638+
speculative: examples/speculative/speculative.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
610639
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
611640

612-
parallel: examples/parallel/parallel.cpp build-info.h ggml.o llama.o common.o $(OBJS)
641+
parallel: examples/parallel/parallel.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
613642
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
614643

615644
ifdef LLAMA_METAL
616645
metal: examples/metal/metal.cpp ggml.o $(OBJS)
617646
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
618647
endif
619648

649+
ifeq ($(UNAME_S),Darwin)
650+
swift: examples/batched.swift
651+
(cd examples/batched.swift; make build)
652+
endif
653+
620654
build-info.h: $(wildcard .git/index) scripts/build-info.sh
621655
@sh scripts/build-info.sh $(CC) > $@.tmp
622656
@if ! cmp -s $@.tmp $@; then \
@@ -637,48 +671,48 @@ benchmark-matmult: examples/benchmark/benchmark-matmult.cpp build-info.h ggml.o
637671
run-benchmark-matmult: benchmark-matmult
638672
./$@
639673

640-
.PHONY: run-benchmark-matmult
674+
.PHONY: run-benchmark-matmult swift
641675

642676
vdot: pocs/vdot/vdot.cpp ggml.o $(OBJS)
643677
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
644678

645679
q8dot: pocs/vdot/q8dot.cpp ggml.o $(OBJS)
646680
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
647681

648-
tests/test-llama-grammar: tests/test-llama-grammar.cpp build-info.h ggml.o common.o grammar-parser.o $(OBJS)
682+
tests/test-llama-grammar: tests/test-llama-grammar.cpp build-info.h ggml.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
649683
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
650684

651-
tests/test-grammar-parser: tests/test-grammar-parser.cpp build-info.h ggml.o llama.o common.o grammar-parser.o $(OBJS)
685+
tests/test-grammar-parser: tests/test-grammar-parser.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
652686
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
653687

654-
tests/test-double-float: tests/test-double-float.cpp build-info.h ggml.o llama.o common.o $(OBJS)
688+
tests/test-double-float: tests/test-double-float.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
655689
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
656690

657-
tests/test-grad0: tests/test-grad0.cpp build-info.h ggml.o llama.o common.o $(OBJS)
691+
tests/test-grad0: tests/test-grad0.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
658692
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
659693

660-
tests/test-opt: tests/test-opt.cpp build-info.h ggml.o llama.o common.o $(OBJS)
694+
tests/test-opt: tests/test-opt.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
661695
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
662696

663-
tests/test-quantize-fns: tests/test-quantize-fns.cpp build-info.h ggml.o llama.o common.o $(OBJS)
697+
tests/test-quantize-fns: tests/test-quantize-fns.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
664698
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
665699

666-
tests/test-quantize-perf: tests/test-quantize-perf.cpp build-info.h ggml.o llama.o common.o $(OBJS)
700+
tests/test-quantize-perf: tests/test-quantize-perf.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
667701
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
668702

669-
tests/test-sampling: tests/test-sampling.cpp build-info.h ggml.o llama.o common.o $(OBJS)
703+
tests/test-sampling: tests/test-sampling.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
670704
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
671705

672-
tests/test-tokenizer-0-falcon: tests/test-tokenizer-0-falcon.cpp build-info.h ggml.o llama.o common.o $(OBJS)
706+
tests/test-tokenizer-0-falcon: tests/test-tokenizer-0-falcon.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
673707
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
674708

675-
tests/test-tokenizer-0-llama: tests/test-tokenizer-0-llama.cpp build-info.h ggml.o llama.o common.o $(OBJS)
709+
tests/test-tokenizer-0-llama: tests/test-tokenizer-0-llama.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
676710
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
677711

678-
tests/test-tokenizer-1-bpe: tests/test-tokenizer-1-bpe.cpp build-info.h ggml.o llama.o common.o $(OBJS)
712+
tests/test-tokenizer-1-bpe: tests/test-tokenizer-1-bpe.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
679713
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
680714

681-
tests/test-tokenizer-1-llama: tests/test-tokenizer-1-llama.cpp build-info.h ggml.o llama.o common.o $(OBJS)
715+
tests/test-tokenizer-1-llama: tests/test-tokenizer-1-llama.cpp build-info.h ggml.o llama.o $(COMMON_DEPS) $(OBJS)
682716
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
683717

684718
tests/test-c.o: tests/test-c.c llama.h

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:5.5
22

33
import PackageDescription
44

55
#if arch(arm) || arch(arm64)
66
let platforms: [SupportedPlatform]? = [
7-
.macOS(.v11),
7+
.macOS(.v12),
88
.iOS(.v14),
99
.watchOS(.v4),
1010
.tvOS(.v14)
@@ -41,12 +41,13 @@ let package = Package(
4141
"ggml.c",
4242
"llama.cpp",
4343
"ggml-alloc.c",
44+
"ggml-backend.c",
4445
"k_quants.c",
4546
] + additionalSources,
4647
resources: resources,
4748
publicHeadersPath: "spm-headers",
4849
cSettings: [
49-
.unsafeFlags(["-Wno-shorten-64-to-32"]),
50+
.unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]),
5051
.define("GGML_USE_K_QUANTS"),
5152
.define("GGML_USE_ACCELERATE")
5253
// NOTE: NEW_LAPACK will required iOS version 16.4+

0 commit comments

Comments
 (0)