Skip to content

Commit b94a44c

Browse files
Merge branch 'master' into vulkan-ggmlopt-pr
2 parents 34792b3 + 0f2bbe6 commit b94a44c

File tree

150 files changed

+5181
-1675
lines changed

Some content is hidden

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

150 files changed

+5181
-1675
lines changed

.devops/cuda.Dockerfile

+1-1
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

+2-2
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

+2-2
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

+1-1
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

+3-3
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

+1-1
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

.github/ISSUE_TEMPLATE/020-enhancement.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
- type: markdown
77
attributes:
88
value: |
9-
[Please post your idea first in Discussion if there is not yet a consensus for this enhancement request. This will help to keep this issue tracker focused on enhancements that the community has agreed needs to be implemented.](https://github.com/ggerganov/llama.cpp/discussions/categories/ideas)
9+
[Please post your idea first in Discussion if there is not yet a consensus for this enhancement request. This will help to keep this issue tracker focused on enhancements that the community has agreed needs to be implemented.](https://github.com/ggml-org/llama.cpp/discussions/categories/ideas)
1010
1111
- type: checkboxes
1212
id: prerequisites
@@ -16,11 +16,11 @@ body:
1616
options:
1717
- label: I am running the latest code. Mention the version if possible as well.
1818
required: true
19-
- label: I carefully followed the [README.md](https://github.com/ggerganov/llama.cpp/blob/master/README.md).
19+
- label: I carefully followed the [README.md](https://github.com/ggml-org/llama.cpp/blob/master/README.md).
2020
required: true
2121
- label: I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
2222
required: true
23-
- label: I reviewed the [Discussions](https://github.com/ggerganov/llama.cpp/discussions), and have a new and useful enhancement to share.
23+
- label: I reviewed the [Discussions](https://github.com/ggml-org/llama.cpp/discussions), and have a new and useful enhancement to share.
2424
required: true
2525

2626
- type: textarea

.github/ISSUE_TEMPLATE/030-research.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
- type: markdown
77
attributes:
88
value: |
9-
Don't forget to check for any [duplicate research issue tickets](https://github.com/ggerganov/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22research+%F0%9F%94%AC%22)
9+
Don't forget to check for any [duplicate research issue tickets](https://github.com/ggml-org/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22research+%F0%9F%94%AC%22)
1010
1111
- type: checkboxes
1212
id: research-stage

.github/ISSUE_TEMPLATE/040-refactor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ body:
66
- type: markdown
77
attributes:
88
value: |
9-
Don't forget to [check for existing refactor issue tickets](https://github.com/ggerganov/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3Arefactoring) in case it's already covered.
10-
Also you may want to check [Pull request refactor label as well](https://github.com/ggerganov/llama.cpp/pulls?q=is%3Aopen+is%3Apr+label%3Arefactoring) for duplicates too.
9+
Don't forget to [check for existing refactor issue tickets](https://github.com/ggml-org/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3Arefactoring) in case it's already covered.
10+
Also you may want to check [Pull request refactor label as well](https://github.com/ggml-org/llama.cpp/pulls?q=is%3Aopen+is%3Apr+label%3Arefactoring) for duplicates too.
1111
1212
- type: textarea
1313
id: background-description

.github/ISSUE_TEMPLATE/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: Got an idea?
4-
url: https://github.com/ggerganov/llama.cpp/discussions/categories/ideas
4+
url: https://github.com/ggml-org/llama.cpp/discussions/categories/ideas
55
about: Pop it there. It may then become an enhancement ticket.
66
- name: Got a question?
7-
url: https://github.com/ggerganov/llama.cpp/discussions/categories/q-a
7+
url: https://github.com/ggml-org/llama.cpp/discussions/categories/q-a
88
about: Ask a question there!
99
- name: Want to contribute?
10-
url: https://github.com/ggerganov/llama.cpp/wiki/contribute
10+
url: https://github.com/ggml-org/llama.cpp/wiki/contribute
1111
about: Head to the contribution guide page of the wiki for areas you can help with

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*Make sure to read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*
1+
*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

.github/workflows/bench.yml.disabled

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: there have been some issues with the workflow, so disabling for now
2-
# https://github.com/ggerganov/llama.cpp/issues/7893
2+
# https://github.com/ggml-org/llama.cpp/issues/7893
33
#
44
# Benchmark
55
name: Benchmark
@@ -57,17 +57,7 @@ jobs:
5757

5858
if: |
5959
inputs.gpu-series == 'Standard_NC4as_T4_v3'
60-
|| (
61-
github.event_name == 'schedule'
62-
&& github.ref_name == 'master'
63-
&& github.repository_owner == 'ggerganov'
64-
)
6560
|| github.event_name == 'pull_request_target'
66-
|| (
67-
github.event_name == 'push'
68-
&& github.event.ref == 'refs/heads/master'
69-
&& github.repository_owner == 'ggerganov'
70-
)
7161
steps:
7262
- name: Clone
7363
id: checkout

.github/workflows/build.yml

+31-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
run: |
130130
sysctl -a
131131
# Metal is disabled due to intermittent failures with Github runners not having a GPU:
132-
# https://github.com/ggerganov/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
132+
# https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
133133
cmake -B build \
134134
-DCMAKE_BUILD_RPATH="@loader_path" \
135135
-DLLAMA_FATAL_WARNINGS=ON \
@@ -401,7 +401,35 @@ jobs:
401401
run: |
402402
cd build
403403
# This is using llvmpipe and runs slower than other backends
404-
ctest -L main --verbose --timeout 1800
404+
ctest -L main --verbose --timeout 2700
405+
406+
- name: Determine tag name
407+
id: tag
408+
shell: bash
409+
run: |
410+
BUILD_NUMBER="$(git rev-list --count HEAD)"
411+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
412+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
413+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
414+
else
415+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
416+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
417+
fi
418+
419+
- name: Pack artifacts
420+
id: pack_artifacts
421+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
422+
run: |
423+
cp LICENSE ./build/bin/
424+
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
425+
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip ./build/bin/*
426+
427+
- name: Upload artifacts
428+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
429+
uses: actions/upload-artifact@v4
430+
with:
431+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip
432+
name: llama-bin-ubuntu-vulkan-x64.zip
405433

406434
ubuntu-22-cmake-hip:
407435
runs-on: ubuntu-22.04
@@ -443,7 +471,7 @@ jobs:
443471
444472
ubuntu-22-cmake-musa:
445473
runs-on: ubuntu-22.04
446-
container: mthreads/musa:rc3.1.0-devel-ubuntu22.04
474+
container: mthreads/musa:rc3.1.1-devel-ubuntu22.04
447475

448476
steps:
449477
- name: Clone

.github/workflows/docker.yml

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151

5252
- name: Set up QEMU
5353
uses: docker/setup-qemu-action@v3
54+
with:
55+
image: tonistiigi/binfmt:qemu-v7.0.0-28
5456

5557
- name: Set up Docker Buildx
5658
uses: docker/setup-buildx-action@v3

.github/workflows/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313
with:
14-
repository: "ggerganov/llama.cpp"
14+
repository: "ggml-org/llama.cpp"
1515
- uses: actions/labeler@v5
1616
with:
1717
configuration-path: '.github/labeler.yml'

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- Squash-merge PRs
1414
- Use the following format for the squashed commit title: `<module> : <commit title> (#<issue_number>)`. For example: `utils : fix typo in utils.py (#1234)`
15-
- Optionally pick a `<module>` from here: https://github.com/ggerganov/llama.cpp/wiki/Modules
15+
- Optionally pick a `<module>` from here: https://github.com/ggml-org/llama.cpp/wiki/Modules
1616
- Consider adding yourself to [CODEOWNERS](CODEOWNERS)
1717

1818
# Coding guidelines
@@ -40,14 +40,14 @@
4040
- Try to follow the existing patterns in the code (indentation, spaces, etc.). In case of doubt use `clang-format` to format the added code
4141
- For anything not covered in the current guidelines, refer to the [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
4242
- Tensors store data in row-major order. We refer to dimension 0 as columns, 1 as rows, 2 as matrices
43-
- Matrix multiplication is unconventional: [`C = ggml_mul_mat(ctx, A, B)`](https://github.com/ggerganov/llama.cpp/blob/880e352277fc017df4d5794f0c21c44e1eae2b84/ggml.h#L1058-L1064) means $C^T = A B^T \Leftrightarrow C = B A^T.$
43+
- Matrix multiplication is unconventional: [`C = ggml_mul_mat(ctx, A, B)`](https://github.com/ggml-org/llama.cpp/blob/880e352277fc017df4d5794f0c21c44e1eae2b84/ggml.h#L1058-L1064) means $C^T = A B^T \Leftrightarrow C = B A^T.$
4444
4545
![matmul](media/matmul.png)
4646
4747
# Naming guidelines
4848
4949
- Use `snake_case` for function, variable and type names
50-
- Naming usually optimizes for longest common prefix (see https://github.com/ggerganov/ggml/pull/302#discussion_r1243240963)
50+
- Naming usually optimizes for longest common prefix (see https://github.com/ggml-org/ggml/pull/302#discussion_r1243240963)
5151
5252
```cpp
5353
// not OK
@@ -122,4 +122,4 @@
122122
123123
The Github issues, PRs and discussions contain a lot of information that can be useful to get familiar with the codebase. For convenience, some of the more important information is referenced from Github projects:
124124
125-
https://github.com/ggerganov/llama.cpp/projects
125+
https://github.com/ggml-org/llama.cpp/projects

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ifndef LLAMA_MAKEFILE
2-
$(error The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md)
2+
$(error The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md)
33
endif
44

55
# Define the default target now so that it is always the first target
@@ -463,7 +463,7 @@ endif
463463
ifneq '' '$(findstring mingw,$(shell $(CC) -dumpmachine))'
464464
# The stack is only 16-byte aligned on Windows, so don't let gcc emit aligned moves.
465465
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
466-
# https://github.com/ggerganov/llama.cpp/issues/2922
466+
# https://github.com/ggml-org/llama.cpp/issues/2922
467467
MK_CFLAGS += -Xassembler -muse-unaligned-vector-move
468468
MK_CXXFLAGS += -Xassembler -muse-unaligned-vector-move
469469

@@ -1078,8 +1078,8 @@ endif
10781078
ifdef REMOVE_WARNING
10791079
$(info !!! REMOVAL WARNING !!!)
10801080
$(info The following LLAMA_ options have been removed and are no longer supported)
1081-
$(info - LLAMA_DISABLE_LOGS (https://github.com/ggerganov/llama.cpp/pull/9418))
1082-
$(info - LLAMA_SERVER_VERBOSE (https://github.com/ggerganov/llama.cpp/pull/9418))
1081+
$(info - LLAMA_DISABLE_LOGS (https://github.com/ggml-org/llama.cpp/pull/9418))
1082+
$(info - LLAMA_SERVER_VERBOSE (https://github.com/ggml-org/llama.cpp/pull/9418))
10831083
$(info )
10841084
endif
10851085

0 commit comments

Comments
 (0)