Skip to content

Commit 93fe7b7

Browse files
authored
Merge branch 'master' into spm-infill-support
2 parents 7e42358 + c70d117 commit 93fe7b7

File tree

405 files changed

+32532
-27425
lines changed

Some content is hidden

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

405 files changed

+32532
-27425
lines changed

.devops/full-cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ COPY . .
2727
# Set nvcc architecture
2828
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
2929
# Enable CUDA
30-
ENV LLAMA_CUDA=1
30+
ENV GGML_CUDA=1
3131
# Enable cURL
3232
ENV LLAMA_CURL=1
3333

.devops/full-rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ COPY . .
3636
# Set nvcc architecture
3737
ENV GPU_TARGETS=${ROCM_DOCKER_ARCH}
3838
# Enable ROCm
39-
ENV LLAMA_HIPBLAS=1
39+
ENV GGML_HIPBLAS=1
4040
ENV CC=/opt/rocm/llvm/bin/clang
4141
ENV CXX=/opt/rocm/llvm/bin/clang++
4242

.devops/llama-cli-cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COPY . .
2121
# Set nvcc architecture
2222
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
2323
# Enable CUDA
24-
ENV LLAMA_CUDA=1
24+
ENV GGML_CUDA=1
2525

2626
RUN make -j$(nproc) llama-cli
2727

.devops/llama-cli-intel.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ ARG ONEAPI_VERSION=2024.1.1-devel-ubuntu22.04
22

33
FROM intel/oneapi-basekit:$ONEAPI_VERSION as build
44

5-
ARG LLAMA_SYCL_F16=OFF
5+
ARG GGML_SYCL_F16=OFF
66
RUN apt-get update && \
77
apt-get install -y git
88

99
WORKDIR /app
1010

1111
COPY . .
1212

13-
RUN if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
14-
echo "LLAMA_SYCL_F16 is set" && \
15-
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
13+
RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
14+
echo "GGML_SYCL_F16 is set" && \
15+
export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
1616
fi && \
17-
cmake -B build -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
17+
cmake -B build -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
1818
cmake --build build --config Release --target llama-cli
1919

2020
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime

.devops/llama-cli-rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ COPY . .
3636
# Set nvcc architecture
3737
ENV GPU_TARGETS=${ROCM_DOCKER_ARCH}
3838
# Enable ROCm
39-
ENV LLAMA_HIPBLAS=1
39+
ENV GGML_HIPBLAS=1
4040
ENV CC=/opt/rocm/llvm/bin/clang
4141
ENV CXX=/opt/rocm/llvm/bin/clang++
4242

.devops/llama-cli-vulkan.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key
1414
# Build it
1515
WORKDIR /app
1616
COPY . .
17-
RUN cmake -B build -DLLAMA_VULKAN=1 && \
17+
RUN cmake -B build -DGGML_VULKAN=1 && \
1818
cmake --build build --config Release --target llama-cli
1919

2020
# Clean up

.devops/llama-cpp-clblast.srpm.spec

Lines changed: 0 additions & 84 deletions
This file was deleted.

.devops/llama-cpp-cuda.srpm.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CPU inference for Meta's Lllama2 models using default options.
3232
%setup -n llama.cpp-master
3333

3434
%build
35-
make -j LLAMA_CUDA=1
35+
make -j GGML_CUDA=1
3636

3737
%install
3838
mkdir -p %{buildroot}%{_bindir}/

.devops/llama-server-cuda.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COPY . .
2121
# Set nvcc architecture
2222
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
2323
# Enable CUDA
24-
ENV LLAMA_CUDA=1
24+
ENV GGML_CUDA=1
2525
# Enable cURL
2626
ENV LLAMA_CURL=1
2727

@@ -30,8 +30,10 @@ RUN make -j$(nproc) llama-server
3030
FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
3131

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

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

37+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
38+
3739
ENTRYPOINT [ "/llama-server" ]

.devops/llama-server-intel.Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@ ARG ONEAPI_VERSION=2024.1.1-devel-ubuntu22.04
22

33
FROM intel/oneapi-basekit:$ONEAPI_VERSION as build
44

5-
ARG LLAMA_SYCL_F16=OFF
5+
ARG GGML_SYCL_F16=OFF
66
RUN apt-get update && \
77
apt-get install -y git libcurl4-openssl-dev
88

99
WORKDIR /app
1010

1111
COPY . .
1212

13-
RUN if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
14-
echo "LLAMA_SYCL_F16 is set" && \
15-
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
13+
RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
14+
echo "GGML_SYCL_F16 is set" && \
15+
export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
1616
fi && \
17-
cmake -B build -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
17+
cmake -B build -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
1818
cmake --build build --config Release --target llama-server
1919

2020
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime
2121

2222
RUN apt-get update && \
23-
apt-get install -y libcurl4-openssl-dev
23+
apt-get install -y libcurl4-openssl-dev curl
2424

2525
COPY --from=build /app/build/bin/llama-server /llama-server
2626

2727
ENV LC_ALL=C.utf8
2828

29+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
30+
2931
ENTRYPOINT [ "/llama-server" ]

.devops/llama-server-rocm.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ COPY . .
3636
# Set nvcc architecture
3737
ENV GPU_TARGETS=${ROCM_DOCKER_ARCH}
3838
# Enable ROCm
39-
ENV LLAMA_HIPBLAS=1
39+
ENV GGML_HIPBLAS=1
4040
ENV CC=/opt/rocm/llvm/bin/clang
4141
ENV CXX=/opt/rocm/llvm/bin/clang++
4242

4343
# Enable cURL
4444
ENV LLAMA_CURL=1
4545
RUN apt-get update && \
46-
apt-get install -y libcurl4-openssl-dev
46+
apt-get install -y libcurl4-openssl-dev curl
4747

4848
RUN make -j$(nproc) llama-server
4949

50+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
51+
5052
ENTRYPOINT [ "/app/llama-server" ]

.devops/llama-server-vulkan.Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ FROM ubuntu:$UBUNTU_VERSION as build
55
# Install build tools
66
RUN apt update && apt install -y git build-essential cmake wget
77

8-
# Install Vulkan SDK
8+
# Install Vulkan SDK and cURL
99
RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add - && \
1010
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list && \
1111
apt update -y && \
12-
apt-get install -y vulkan-sdk
13-
14-
# Install cURL
15-
RUN apt-get update && \
16-
apt-get install -y libcurl4-openssl-dev
12+
apt-get install -y vulkan-sdk libcurl4-openssl-dev curl
1713

1814
# Build it
1915
WORKDIR /app
2016
COPY . .
21-
RUN cmake -B build -DLLAMA_VULKAN=1 -DLLAMA_CURL=1 && \
17+
RUN cmake -B build -DGGML_VULKAN=1 -DLLAMA_CURL=1 && \
2218
cmake --build build --config Release --target llama-server
2319

2420
# Clean up
@@ -28,4 +24,6 @@ RUN cp /app/build/bin/llama-server /llama-server && \
2824

2925
ENV LC_ALL=C.utf8
3026

27+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
28+
3129
ENTRYPOINT [ "/llama-server" ]

.devops/llama-server.Dockerfile

Lines changed: 3 additions & 1 deletion
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 git libcurl4-openssl-dev
6+
apt-get install -y build-essential git libcurl4-openssl-dev curl
77

88
WORKDIR /app
99

@@ -22,4 +22,6 @@ COPY --from=build /app/llama-server /llama-server
2222

2323
ENV LC_ALL=C.utf8
2424

25+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
26+
2527
ENTRYPOINT [ "/llama-server" ]

.devops/nix/package.nix

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ effectiveStdenv.mkDerivation (
160160
};
161161

162162
postPatch = ''
163-
substituteInPlace ./ggml-metal.m \
163+
substituteInPlace ./ggml/src/ggml-metal.m \
164164
--replace '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
165-
substituteInPlace ./ggml-metal.m \
165+
substituteInPlace ./ggml/src/ggml-metal.m \
166166
--replace '[bundle pathForResource:@"default" ofType:@"metallib"];' "@\"$out/bin/default.metallib\";"
167167
'';
168168

@@ -205,17 +205,17 @@ effectiveStdenv.mkDerivation (
205205

206206
cmakeFlags =
207207
[
208-
(cmakeBool "LLAMA_NATIVE" false)
209208
(cmakeBool "LLAMA_BUILD_SERVER" true)
210209
(cmakeBool "BUILD_SHARED_LIBS" (!enableStatic))
211210
(cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
212-
(cmakeBool "LLAMA_BLAS" useBlas)
213-
(cmakeBool "LLAMA_CLBLAST" useOpenCL)
214-
(cmakeBool "LLAMA_CUDA" useCuda)
215-
(cmakeBool "LLAMA_HIPBLAS" useRocm)
216-
(cmakeBool "LLAMA_METAL" useMetalKit)
217-
(cmakeBool "LLAMA_VULKAN" useVulkan)
218-
(cmakeBool "LLAMA_STATIC" enableStatic)
211+
(cmakeBool "GGML_NATIVE" false)
212+
(cmakeBool "GGML_BLAS" useBlas)
213+
(cmakeBool "GGML_CLBLAST" useOpenCL)
214+
(cmakeBool "GGML_CUDA" useCuda)
215+
(cmakeBool "GGML_HIPBLAS" useRocm)
216+
(cmakeBool "GGML_METAL" useMetalKit)
217+
(cmakeBool "GGML_VULKAN" useVulkan)
218+
(cmakeBool "GGML_STATIC" enableStatic)
219219
]
220220
++ optionals useCuda [
221221
(
@@ -231,7 +231,7 @@ effectiveStdenv.mkDerivation (
231231
]
232232
++ optionals useMetalKit [
233233
(lib.cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1")
234-
(cmakeBool "LLAMA_METAL_EMBED_LIBRARY" (!precompileMetalShaders))
234+
(cmakeBool "GGML_METAL_EMBED_LIBRARY" (!precompileMetalShaders))
235235
];
236236

237237
# Environment variables needed for ROCm
@@ -244,7 +244,7 @@ effectiveStdenv.mkDerivation (
244244
# if they haven't been added yet.
245245
postInstall = ''
246246
mkdir -p $out/include
247-
cp $src/llama.h $out/include/
247+
cp $src/include/llama.h $out/include/
248248
'';
249249

250250
# Define the shells here, but don't add in the inputsFrom to avoid recursion.

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ indent_size = 2
2828
indent_style = tab
2929

3030
[examples/cvector-generator/*.txt]
31+
trim_trailing_whitespace = unset
3132
insert_final_newline = unset

0 commit comments

Comments
 (0)