Skip to content

Commit f8d1709

Browse files
authored
Merge branch 'master' into feat-jina-embeddings
2 parents c3f4b1f + a68a1e7 commit f8d1709

File tree

123 files changed

+9938
-2887
lines changed

Some content is hidden

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

123 files changed

+9938
-2887
lines changed

.devops/main-intel.Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ WORKDIR /app
1010

1111
COPY . .
1212

13-
RUN mkdir build && \
14-
cd build && \
15-
if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
13+
RUN if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
1614
echo "LLAMA_SYCL_F16 is set" && \
1715
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
1816
fi && \
19-
cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
20-
cmake --build . --config Release --target main
17+
cmake -B build -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
18+
cmake --build build --config Release --target main
2119

2220
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime
2321

.devops/main-vulkan.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key
1414
# Build it
1515
WORKDIR /app
1616
COPY . .
17-
RUN mkdir build && \
18-
cd build && \
19-
cmake .. -DLLAMA_VULKAN=1 && \
20-
cmake --build . --config Release --target main
17+
RUN cmake -B build -DLLAMA_VULKAN=1 && \
18+
cmake --build build --config Release --target main
2119

2220
# Clean up
2321
WORKDIR /

.devops/server-intel.Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ WORKDIR /app
1010

1111
COPY . .
1212

13-
RUN mkdir build && \
14-
cd build && \
15-
if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
13+
RUN if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
1614
echo "LLAMA_SYCL_F16 is set" && \
1715
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
1816
fi && \
19-
cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
20-
cmake --build . --config Release --target server
17+
cmake -B build -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
18+
cmake --build build --config Release --target server
2119

2220
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime
2321

.devops/server-vulkan.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ RUN apt-get update && \
1818
# Build it
1919
WORKDIR /app
2020
COPY . .
21-
RUN mkdir build && \
22-
cd build && \
23-
cmake .. -DLLAMA_VULKAN=1 -DLLAMA_CURL=1 && \
24-
cmake --build . --config Release --target server
21+
RUN cmake -B build -DLLAMA_VULKAN=1 -DLLAMA_CURL=1 && \
22+
cmake --build build --config Release --target server
2523

2624
# Clean up
2725
WORKDIR /

.github/workflows/bench.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
- cron: '04 2 * * *'
3333

3434
concurrency:
35-
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ github.event.inputs.sha }}
35+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}-${{ github.event.inputs.sha }}
3636
cancel-in-progress: true
3737

3838
jobs:
@@ -96,9 +96,7 @@ jobs:
9696
id: cmake_build
9797
run: |
9898
set -eux
99-
mkdir build
100-
cd build
101-
cmake .. \
99+
cmake -B build \
102100
-DLLAMA_NATIVE=OFF \
103101
-DLLAMA_BUILD_SERVER=ON \
104102
-DLLAMA_CURL=ON \
@@ -109,7 +107,7 @@ jobs:
109107
-DLLAMA_FATAL_WARNINGS=OFF \
110108
-DLLAMA_ALL_WARNINGS=OFF \
111109
-DCMAKE_BUILD_TYPE=Release;
112-
cmake --build . --config Release -j $(nproc) --target server
110+
cmake --build build --config Release -j $(nproc) --target server
113111
114112
- name: Download the dataset
115113
id: download_dataset

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,63 @@ jobs:
593593
run: |
594594
make swift
595595
596+
windows-msys2:
597+
runs-on: windows-latest
598+
599+
strategy:
600+
fail-fast: false
601+
matrix:
602+
include:
603+
- { sys: UCRT64, env: ucrt-x86_64, build: Release }
604+
- { sys: CLANG64, env: clang-x86_64, build: Release }
605+
606+
steps:
607+
- name: Clone
608+
uses: actions/checkout@v4
609+
610+
- name: Setup ${{ matrix.sys }}
611+
uses: msys2/setup-msys2@v2
612+
with:
613+
update: true
614+
msystem: ${{matrix.sys}}
615+
install: >-
616+
base-devel
617+
mingw-w64-${{matrix.env}}-toolchain
618+
mingw-w64-${{matrix.env}}-cmake
619+
mingw-w64-${{matrix.env}}-openblas
620+
621+
- name: Build using make
622+
shell: msys2 {0}
623+
run: |
624+
make -j $(nproc)
625+
626+
- name: Clean after building using make
627+
shell: msys2 {0}
628+
run: |
629+
make clean
630+
631+
- name: Build using make w/ OpenBLAS
632+
shell: msys2 {0}
633+
run: |
634+
make LLAMA_OPENBLAS=1 -j $(nproc)
635+
636+
- name: Build using CMake
637+
shell: msys2 {0}
638+
run: |
639+
cmake -B build
640+
cmake --build build --config ${{ matrix.build }} -j $(nproc)
641+
642+
- name: Clean after building using CMake
643+
shell: msys2 {0}
644+
run: |
645+
rm -rf build
646+
647+
- name: Build using CMake w/ OpenBLAS
648+
shell: msys2 {0}
649+
run: |
650+
cmake -B build -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS
651+
cmake --build build --config ${{ matrix.build }} -j $(nproc)
652+
596653
windows-latest-cmake:
597654
runs-on: windows-latest
598655

.github/workflows/python-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
uses: py-actions/flake8@v2
2222
with:
2323
ignore: "E203,E211,E221,E225,E231,E241,E251,E261,E266,E501,E701,E704,W503"
24-
exclude: "examples/*,examples/*/**,*/**/__init__.py"
24+
exclude: "examples/*,examples/*/**,*/**/__init__.py,convert-hf-to-gguf-update.py"

.github/workflows/server.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
- cron: '2 4 * * *'
2424

2525
concurrency:
26-
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
26+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
2727
cancel-in-progress: true
2828

2929
jobs:
@@ -41,23 +41,16 @@ jobs:
4141
sanitizer: ""
4242
fail-fast: false # While -DLLAMA_SANITIZE_THREAD=ON is broken
4343

44-
container:
45-
image: ubuntu:latest
46-
ports:
47-
- 8888
48-
options: --cpus 4
49-
5044
steps:
5145
- name: Dependencies
5246
id: depends
5347
run: |
54-
apt-get update
55-
apt-get -y install \
48+
sudo apt-get update
49+
sudo apt-get -y install \
5650
build-essential \
5751
xxd \
5852
git \
5953
cmake \
60-
python3-pip \
6154
curl \
6255
wget \
6356
language-pack-en \
@@ -70,6 +63,17 @@ jobs:
7063
fetch-depth: 0
7164
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
7265

66+
- name: Python setup
67+
id: setup_python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.11'
71+
72+
- name: Tests dependencies
73+
id: test_dependencies
74+
run: |
75+
pip install -r examples/server/tests/requirements.txt
76+
7377
- name: Verify server deps
7478
id: verify_server_deps
7579
run: |
@@ -90,20 +94,14 @@ jobs:
9094
- name: Build
9195
id: cmake_build
9296
run: |
93-
mkdir build
94-
cd build
95-
cmake .. \
97+
cmake -B build \
9698
-DLLAMA_NATIVE=OFF \
9799
-DLLAMA_BUILD_SERVER=ON \
98100
-DLLAMA_CURL=ON \
99101
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
100102
-DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ;
101-
cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
103+
cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target server
102104
103-
- name: Tests dependencies
104-
id: test_dependencies
105-
run: |
106-
pip install -r examples/server/tests/requirements.txt
107105
108106
- name: Tests
109107
id: server_integration_tests
@@ -129,6 +127,7 @@ jobs:
129127
uses: actions/checkout@v4
130128
with:
131129
fetch-depth: 0
130+
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
132131

133132
- name: libCURL
134133
id: get_libcurl
@@ -142,10 +141,8 @@ jobs:
142141
- name: Build
143142
id: cmake_build
144143
run: |
145-
mkdir build
146-
cd build
147-
cmake .. -DLLAMA_CURL=ON -DCURL_LIBRARY="$env:RUNNER_TEMP/libcurl/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:RUNNER_TEMP/libcurl/include"
148-
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS} --target server
144+
cmake -B build -DLLAMA_CURL=ON -DCURL_LIBRARY="$env:RUNNER_TEMP/libcurl/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:RUNNER_TEMP/libcurl/include"
145+
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} --target server
149146
150147
- name: Python setup
151148
id: setup_python

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.a
33
*.so
44
*.gguf
5+
*.gguf.json
56
*.bin
67
*.exe
78
*.dll
@@ -108,3 +109,18 @@ examples/server/*.mjs.hpp
108109
poetry.lock
109110
poetry.toml
110111
nppBackup
112+
113+
# Test binaries
114+
/tests/test-grammar-parser
115+
/tests/test-llama-grammar
116+
/tests/test-double-float
117+
/tests/test-grad0
118+
/tests/test-opt
119+
/tests/test-quantize-fns
120+
/tests/test-quantize-perf
121+
/tests/test-sampling
122+
/tests/test-tokenizer-0
123+
/tests/test-tokenizer-1-spm
124+
/tests/test-tokenizer-1-bpe
125+
/tests/test-rope
126+
/tests/test-backend-ops

CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,7 @@ else()
4343
set(LLAMA_METAL_DEFAULT OFF)
4444
endif()
4545

46-
# TODO: fix this for Android CI
47-
# https://github.com/ggerganov/llama.cpp/pull/6716#issuecomment-2061509191
48-
#if (CMAKE_SYSTEM_NAME MATCHES "ANDROID")
49-
# set(LLAMA_LLAMAFILE_DEFAULT OFF)
50-
#else()
51-
# set(LLAMA_LLAMAFILE_DEFAULT ON)
52-
#endif()
53-
54-
# TODO: temporary disable until MoE is fixed
55-
# https://github.com/ggerganov/llama.cpp/pull/6716
56-
set(LLAMA_LLAMAFILE_DEFAULT OFF)
46+
set(LLAMA_LLAMAFILE_DEFAULT ON)
5747

5848
# general
5949
option(BUILD_SHARED_LIBS "build shared libraries" OFF)

0 commit comments

Comments
 (0)