Skip to content

Commit 751528d

Browse files
authored
Merge branch 'master' into master
2 parents f263ec3 + d709084 commit 751528d

File tree

453 files changed

+67585
-33404
lines changed

Some content is hidden

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

453 files changed

+67585
-33404
lines changed

.devops/cpu.Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@ ARG UBUNTU_VERSION=22.04
22

33
FROM ubuntu:$UBUNTU_VERSION AS build
44

5+
ARG TARGETARCH
6+
7+
ARG GGML_CPU_ARM_ARCH=armv8-a
8+
59
RUN apt-get update && \
610
apt-get install -y build-essential git cmake libcurl4-openssl-dev
711

812
WORKDIR /app
913

1014
COPY . .
1115

12-
RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
16+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
17+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
18+
elif [ "$TARGETARCH" = "arm64" ]; then \
19+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
20+
else \
21+
echo "Unsupported architecture"; \
22+
exit 1; \
23+
fi && \
1324
cmake --build build -j $(nproc)
1425

1526
RUN mkdir -p /app/lib && \

.devops/cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG UBUNTU_VERSION=22.04
22
# This needs to generally match the container host's environment.
3-
ARG CUDA_VERSION=12.6.0
3+
ARG CUDA_VERSION=12.4.0
44
# Target the CUDA build image
55
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
66

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Version: %( date "+%%Y%%m%%d" )
1717
Release: 1%{?dist}
1818
Summary: CPU Inference of LLaMA model in pure C/C++ (no CUDA/OpenCL)
1919
License: MIT
20-
Source0: https://github.com/ggerganov/llama.cpp/archive/refs/heads/master.tar.gz
20+
Source0: https://github.com/ggml-org/llama.cpp/archive/refs/heads/master.tar.gz
2121
BuildRequires: coreutils make gcc-c++ git cuda-toolkit
2222
Requires: cuda-toolkit
23-
URL: https://github.com/ggerganov/llama.cpp
23+
URL: https://github.com/ggml-org/llama.cpp
2424

2525
%define debug_package %{nil}
2626
%define source_date_epoch_from_changelog 0

.devops/llama-cpp.srpm.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Version: %( date "+%%Y%%m%%d" )
1818
Release: 1%{?dist}
1919
Summary: CPU Inference of LLaMA model in pure C/C++ (no CUDA/OpenCL)
2020
License: MIT
21-
Source0: https://github.com/ggerganov/llama.cpp/archive/refs/heads/master.tar.gz
21+
Source0: https://github.com/ggml-org/llama.cpp/archive/refs/heads/master.tar.gz
2222
BuildRequires: coreutils make gcc-c++ git libstdc++-devel
2323
Requires: libstdc++
24-
URL: https://github.com/ggerganov/llama.cpp
24+
URL: https://github.com/ggml-org/llama.cpp
2525

2626
%define debug_package %{nil}
2727
%define source_date_epoch_from_changelog 0

.devops/musa.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG UBUNTU_VERSION=22.04
22
# This needs to generally match the container host's environment.
3-
ARG MUSA_VERSION=rc3.1.0
3+
ARG MUSA_VERSION=rc3.1.1
44
# Target the MUSA build image
55
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
66

.devops/nix/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ effectiveStdenv.mkDerivation (finalAttrs: {
133133
--replace '[bundle pathForResource:@"default" ofType:@"metallib"];' "@\"$out/bin/default.metallib\";"
134134
'';
135135

136-
# With PR#6015 https://github.com/ggerganov/llama.cpp/pull/6015,
136+
# With PR#6015 https://github.com/ggml-org/llama.cpp/pull/6015,
137137
# `default.metallib` may be compiled with Metal compiler from XCode
138138
# and we need to escape sandbox on MacOS to access Metal compiler.
139139
# `xcrun` is used find the path of the Metal compiler, which is varible
140140
# and not on $PATH
141-
# see https://github.com/ggerganov/llama.cpp/pull/6118 for discussion
141+
# see https://github.com/ggml-org/llama.cpp/pull/6118 for discussion
142142
__noChroot = effectiveStdenv.isDarwin && useMetalKit && precompileMetalShaders;
143143

144144
nativeBuildInputs =
@@ -220,7 +220,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
220220
broken = (useMetalKit && !effectiveStdenv.isDarwin);
221221

222222
description = "Inference of LLaMA model in pure C/C++${descriptionSuffix}";
223-
homepage = "https://github.com/ggerganov/llama.cpp/";
223+
homepage = "https://github.com/ggml-org/llama.cpp/";
224224
license = lib.licenses.mit;
225225

226226
# Accommodates `nix run` and `lib.getExe`

.devops/rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-co
1111
FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1212

1313
# Unless otherwise specified, we make a fat build.
14-
# List from https://github.com/ggerganov/llama.cpp/pull/1087#issuecomment-1682807878
14+
# List from https://github.com/ggml-org/llama.cpp/pull/1087#issuecomment-1682807878
1515
# This is mostly tied to rocBLAS supported archs.
1616
# gfx803, gfx900, gfx1032, gfx1101, gfx1102,not officialy supported
1717
# gfx906 is deprecated

.devops/tools.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ elif [[ "$arg1" == '--quantize' || "$arg1" == '-q' ]]; then
1313
exec ./llama-quantize "$@"
1414
elif [[ "$arg1" == '--run' || "$arg1" == '-r' ]]; then
1515
exec ./llama-cli "$@"
16+
elif [[ "$arg1" == '--bench' || "$arg1" == '-b' ]]; then
17+
exec ./llama-bench "$@"
18+
elif [[ "$arg1" == '--perplexity' || "$arg1" == '-p' ]]; then
19+
exec ./llama-perplexity "$@"
1620
elif [[ "$arg1" == '--all-in-one' || "$arg1" == '-a' ]]; then
1721
echo "Converting PTH to GGML..."
18-
for i in `ls $1/$2/ggml-model-f16.bin*`; do
22+
for i in $(ls $1/$2/ggml-model-f16.bin*); do
1923
if [ -f "${i/f16/q4_0}" ]; then
2024
echo "Skip model quantization, it already exists: ${i/f16/q4_0}"
2125
else
@@ -30,6 +34,10 @@ else
3034
echo "Available commands: "
3135
echo " --run (-r): Run a model previously converted into ggml"
3236
echo " ex: -m /models/7B/ggml-model-q4_0.bin -p \"Building a website can be done in 10 simple steps:\" -n 512"
37+
echo " --bench (-b): Benchmark the performance of the inference for various parameters."
38+
echo " ex: -m model.gguf"
39+
echo " --perplexity (-p): Measure the perplexity of a model over a given text."
40+
echo " ex: -m model.gguf -f file.txt"
3341
echo " --convert (-c): Convert a llama model into ggml"
3442
echo " ex: --outtype f16 \"/models/7B/\" "
3543
echo " --quantize (-q): Optimize with quantization process ggml"

.devops/vulkan.Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG UBUNTU_VERSION=jammy
1+
ARG UBUNTU_VERSION=24.04
22

33
FROM ubuntu:$UBUNTU_VERSION AS build
44

@@ -7,7 +7,7 @@ RUN apt update && apt install -y git build-essential cmake wget
77

88
# Install Vulkan SDK and cURL
99
RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add - && \
10-
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list && \
10+
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list https://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list && \
1111
apt update -y && \
1212
apt-get install -y vulkan-sdk libcurl4-openssl-dev curl
1313

@@ -34,7 +34,7 @@ RUN mkdir -p /app/full \
3434
FROM ubuntu:$UBUNTU_VERSION AS base
3535

3636
RUN apt-get update \
37-
&& apt-get install -y libgomp1 curl\
37+
&& apt-get install -y libgomp1 curl libvulkan-dev \
3838
&& apt autoremove -y \
3939
&& apt clean -y \
4040
&& rm -rf /tmp/* /var/tmp/* \
@@ -55,8 +55,9 @@ RUN apt-get update \
5555
git \
5656
python3 \
5757
python3-pip \
58-
&& pip install --upgrade pip setuptools wheel \
59-
&& pip install -r requirements.txt \
58+
python3-wheel \
59+
&& pip install --break-system-packages --upgrade setuptools \
60+
&& pip install --break-system-packages -r requirements.txt \
6061
&& apt autoremove -y \
6162
&& apt clean -y \
6263
&& rm -rf /tmp/* /var/tmp/* \

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ indent_style = tab
4040
[examples/cvector-generator/*.txt]
4141
trim_trailing_whitespace = unset
4242
insert_final_newline = unset
43+
44+
[models/templates/*.jinja]
45+
indent_style = unset
46+
indent_size = unset
47+
end_of_line = unset
48+
charset = unset
49+
trim_trailing_whitespace = unset
50+
insert_final_newline = unset

0 commit comments

Comments
 (0)