Skip to content

Commit f4df3ff

Browse files
authored
Merge branch 'ggerganov:master' into non-llama-fim-fix
2 parents f75eedf + 42b53d1 commit f4df3ff

File tree

258 files changed

+113531
-50002
lines changed

Some content is hidden

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

258 files changed

+113531
-50002
lines changed

.devops/full-cuda.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FROM ${BASE_CUDA_DEV_CONTAINER} as build
1212
ARG CUDA_DOCKER_ARCH=all
1313

1414
RUN apt-get update && \
15-
apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev
15+
apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev libgomp1
1616

1717
COPY requirements.txt requirements.txt
1818
COPY requirements requirements
@@ -31,6 +31,6 @@ ENV LLAMA_CUDA=1
3131
# Enable cURL
3232
ENV LLAMA_CURL=1
3333

34-
RUN make
34+
RUN make -j$(nproc)
3535

3636
ENTRYPOINT ["/app/.devops/tools.sh"]

.devops/full-rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ ENV LLAMA_CURL=1
4545
RUN apt-get update && \
4646
apt-get install -y libcurl4-openssl-dev
4747

48-
RUN make
48+
RUN make -j$(nproc)
4949

5050
ENTRYPOINT ["/app/.devops/tools.sh"]

.devops/full.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG UBUNTU_VERSION=22.04
33
FROM ubuntu:$UBUNTU_VERSION as build
44

55
RUN apt-get update && \
6-
apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev
6+
apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev libgomp1
77

88
COPY requirements.txt requirements.txt
99
COPY requirements requirements
@@ -18,7 +18,7 @@ COPY . .
1818
ENV LLAMA_CURL=1
1919

2020

21-
RUN make
21+
RUN make -j$(nproc)
2222

2323
ENV LC_ALL=C.utf8
2424

.devops/main-cuda.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
2323
# Enable CUDA
2424
ENV LLAMA_CUDA=1
2525

26-
RUN make
26+
RUN make -j$(nproc) main
2727

2828
FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
2929

30+
RUN apt-get update && \
31+
apt-get install -y libgomp1
32+
3033
COPY --from=build /app/main /main
3134

3235
ENTRYPOINT [ "/main" ]

.devops/main-rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ ENV LLAMA_HIPBLAS=1
4040
ENV CC=/opt/rocm/llvm/bin/clang
4141
ENV CXX=/opt/rocm/llvm/bin/clang++
4242

43-
RUN make
43+
RUN make -j$(nproc) main
4444

4545
ENTRYPOINT [ "/app/main" ]

.devops/main-vulkan.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG UBUNTU_VERSION=jammy
33
FROM ubuntu:$UBUNTU_VERSION as build
44

55
# Install build tools
6-
RUN apt update && apt install -y git build-essential cmake wget
6+
RUN apt update && apt install -y git build-essential cmake wget libgomp1
77

88
# Install Vulkan SDK
99
RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add - && \

.devops/main.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ WORKDIR /app
99

1010
COPY . .
1111

12-
RUN make
12+
RUN make -j$(nproc) main
1313

1414
FROM ubuntu:$UBUNTU_VERSION as runtime
1515

16+
RUN apt-get update && \
17+
apt-get install -y libgomp1
18+
1619
COPY --from=build /app/main /main
1720

1821
ENV LC_ALL=C.utf8

.devops/server-cuda.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ ENV LLAMA_CUDA=1
2525
# Enable cURL
2626
ENV LLAMA_CURL=1
2727

28-
RUN make
28+
RUN make -j$(nproc) server
2929

3030
FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
3131

3232
RUN apt-get update && \
33-
apt-get install -y libcurl4-openssl-dev
33+
apt-get install -y libcurl4-openssl-dev libgomp1
3434

3535
COPY --from=build /app/server /server
3636

.devops/server-rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ ENV LLAMA_CURL=1
4545
RUN apt-get update && \
4646
apt-get install -y libcurl4-openssl-dev
4747

48-
RUN make
48+
RUN make -j$(nproc)
4949

5050
ENTRYPOINT [ "/app/server" ]

.devops/server.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ COPY . .
1111

1212
ENV LLAMA_CURL=1
1313

14-
RUN make
14+
RUN make -j$(nproc) server
1515

1616
FROM ubuntu:$UBUNTU_VERSION as runtime
1717

1818
RUN apt-get update && \
19-
apt-get install -y libcurl4-openssl-dev
19+
apt-get install -y libcurl4-openssl-dev libgomp1
2020

2121
COPY --from=build /app/server /server
2222

.github/workflows/build.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,22 @@ jobs:
294294
295295
- name: Build
296296
id: cmake_build
297+
if: ${{ matrix.sanitizer != 'THREAD' }}
297298
run: |
298299
mkdir build
299300
cd build
300301
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
301302
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
302303
304+
- name: Build (no OpenMP)
305+
id: cmake_build_no_openmp
306+
if: ${{ matrix.sanitizer == 'THREAD' }}
307+
run: |
308+
mkdir build
309+
cd build
310+
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DLLAMA_OPENMP=OFF
311+
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
312+
303313
- name: Test
304314
id: cmake_test
305315
run: |
@@ -678,8 +688,6 @@ jobs:
678688

679689
env:
680690
OPENBLAS_VERSION: 0.3.23
681-
OPENCL_VERSION: 2023.04.17
682-
CLBLAST_VERSION: 1.6.0
683691
SDE_VERSION: 9.33.0-2024-01-07
684692
VULKAN_VERSION: 1.3.261.1
685693

@@ -696,8 +704,6 @@ jobs:
696704
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF -DBUILD_SHARED_LIBS=ON'
697705
- build: 'avx512-x64'
698706
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
699-
- build: 'clblast-x64'
700-
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
701707
- build: 'openblas-x64'
702708
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
703709
- build: 'kompute-x64'
@@ -722,27 +728,6 @@ jobs:
722728
run: |
723729
git submodule update --init kompute
724730
725-
- name: Download OpenCL SDK
726-
id: get_opencl
727-
if: ${{ matrix.build == 'clblast-x64' }}
728-
run: |
729-
curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip"
730-
mkdir $env:RUNNER_TEMP/opencl
731-
tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
732-
733-
- name: Download CLBlast
734-
id: get_clblast
735-
if: ${{ matrix.build == 'clblast-x64' }}
736-
run: |
737-
curl.exe -o $env:RUNNER_TEMP/clblast.7z -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-windows-x64.7z"
738-
curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
739-
7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
740-
rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
741-
foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
742-
$txt = Get-Content -Path $f -Raw
743-
$txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
744-
}
745-
746731
- name: Download OpenBLAS
747732
id: get_openblas
748733
if: ${{ matrix.build == 'openblas-x64' }}
@@ -776,13 +761,6 @@ jobs:
776761
cmake -S . -B build ${{ matrix.defines }}
777762
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
778763
779-
- name: Add clblast.dll
780-
id: add_clblast_dll
781-
if: ${{ matrix.build == 'clblast-x64' }}
782-
run: |
783-
cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
784-
cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt
785-
786764
- name: Add libopenblas.dll
787765
id: add_libopenblas_dll
788766
if: ${{ matrix.build == 'openblas-x64' }}
@@ -806,7 +784,7 @@ jobs:
806784
- name: Test
807785
id: cmake_test
808786
# not all machines have native AVX-512
809-
if: ${{ matrix.build != 'msvc-arm64' && matrix.build != 'llvm-arm64' && matrix.build != 'clblast-x64' && matrix.build != 'kompute-x64' && matrix.build != 'vulkan-x64' && (matrix.build != 'avx512-x64' || env.HAS_AVX512F == '1') }}
787+
if: ${{ matrix.build != 'msvc-arm64' && matrix.build != 'llvm-arm64' && matrix.build != 'kompute-x64' && matrix.build != 'vulkan-x64' && (matrix.build != 'avx512-x64' || env.HAS_AVX512F == '1') }}
810788
run: |
811789
cd build
812790
ctest -L main -C Release --verbose --timeout 900
@@ -1061,7 +1039,7 @@ jobs:
10611039
# hypervisor: 'qemu'
10621040
# run: |
10631041
# sudo pkg update
1064-
# sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
1042+
# sudo pkg install -y gmake automake autoconf pkgconf llvm15 openblas
10651043
# gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
10661044

10671045
release:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ ggml-metal-embed.metal
3434
lcov-report/
3535
gcovr-report/
3636

37+
tags
3738
build*
3839
!build.zig
3940
cmake-build-*
41+
android-ndk-*
4042
out/
4143
tmp/
4244

@@ -105,6 +107,7 @@ examples/jeopardy/results.txt
105107
examples/server/*.html.hpp
106108
examples/server/*.js.hpp
107109
examples/server/*.mjs.hpp
110+
examples/server/*.css.hpp
108111

109112
poetry.lock
110113
poetry.toml

0 commit comments

Comments
 (0)