Skip to content

Commit 2c96bd2

Browse files
authored
Merge branch 'ggerganov:master' into master
2 parents daab141 + 46c69e0 commit 2c96bd2

File tree

174 files changed

+6992
-5262
lines changed

Some content is hidden

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

174 files changed

+6992
-5262
lines changed

.clang-format

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: Align
4+
AlignArrayOfStructures: Left
5+
AlignConsecutiveAssignments: AcrossComments
6+
AlignConsecutiveBitFields: AcrossComments
7+
AlignConsecutiveDeclarations: AcrossComments
8+
AlignConsecutiveMacros: AcrossComments
9+
# AlignConsecutiveShortCaseStatements: AcrossComments
10+
AlignEscapedNewlines: Left # LeftWithLastLine
11+
AlignOperands: Align
12+
AlignTrailingComments:
13+
Kind: Always
14+
OverEmptyLines: 1
15+
AllowAllArgumentsOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
# AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
18+
AllowShortBlocksOnASingleLine: Never
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: Inline
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLambdasOnASingleLine: Inline
23+
AllowShortLoopsOnASingleLine: false
24+
AlwaysBreakBeforeMultilineStrings: true
25+
BinPackArguments: true
26+
BinPackParameters: true # OnePerLine
27+
BitFieldColonSpacing: Both
28+
BreakBeforeBraces: Custom # Attach
29+
BraceWrapping:
30+
AfterCaseLabel: true
31+
AfterClass: false
32+
AfterControlStatement: false
33+
AfterEnum: false
34+
AfterFunction: false
35+
AfterNamespace: false
36+
AfterObjCDeclaration: false
37+
AfterStruct: false
38+
AfterUnion: false
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: false
43+
BeforeWhile: false
44+
IndentBraces: false
45+
SplitEmptyFunction: false
46+
SplitEmptyRecord: false
47+
SplitEmptyNamespace: false
48+
# BreakAdjacentStringLiterals: true
49+
BreakAfterAttributes: Never
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeInlineASMColon: OnlyMultiline
52+
BreakBeforeTernaryOperators: false
53+
# BreakBinaryOperations: Never
54+
BreakConstructorInitializers: AfterColon
55+
# BreakFunctionDefinitionParameters: false
56+
BreakInheritanceList: AfterComma
57+
BreakStringLiterals: true
58+
# BreakTemplateDeclarations: Yes
59+
ColumnLimit: 120
60+
CommentPragmas: '^ IWYU pragma:'
61+
CompactNamespaces: false
62+
ConstructorInitializerIndentWidth: 4
63+
ContinuationIndentWidth: 4
64+
Cpp11BracedListStyle: false
65+
DerivePointerAlignment: false
66+
DisableFormat: false
67+
EmptyLineBeforeAccessModifier: Leave
68+
EmptyLineAfterAccessModifier: Never
69+
ExperimentalAutoDetectBinPacking: false
70+
FixNamespaceComments: true
71+
IncludeBlocks: Regroup
72+
IncludeCategories:
73+
- Regex: '^<.*\.h>'
74+
Priority: 1
75+
SortPriority: 0
76+
- Regex: '^<.*'
77+
Priority: 2
78+
SortPriority: 0
79+
- Regex: '.*'
80+
Priority: 3
81+
SortPriority: 0
82+
IncludeIsMainRegex: '([-_](test|unittest))?$'
83+
IncludeIsMainSourceRegex: ''
84+
IndentAccessModifiers: false
85+
IndentCaseBlocks: true
86+
IndentCaseLabels: true
87+
IndentExternBlock: NoIndent
88+
IndentGotoLabels: false
89+
IndentPPDirectives: AfterHash
90+
IndentWidth: 4
91+
IndentWrappedFunctionNames: false
92+
InsertBraces: true # NOTE: may lead to incorrect formatting
93+
InsertNewlineAtEOF: true
94+
JavaScriptQuotes: Leave
95+
JavaScriptWrapImports: true
96+
KeepEmptyLinesAtTheStartOfBlocks: false
97+
LambdaBodyIndentation: Signature
98+
LineEnding: LF
99+
MacroBlockBegin: ''
100+
MacroBlockEnd: ''
101+
MaxEmptyLinesToKeep: 1
102+
NamespaceIndentation: None
103+
ObjCBinPackProtocolList: Auto
104+
ObjCBlockIndentWidth: 4
105+
ObjCSpaceAfterProperty: true
106+
ObjCSpaceBeforeProtocolList: true
107+
PPIndentWidth: -1
108+
PackConstructorInitializers: CurrentLine
109+
PenaltyBreakAssignment: 2
110+
PenaltyBreakBeforeFirstCallParameter: 1
111+
PenaltyBreakComment: 300
112+
PenaltyBreakFirstLessLess: 120
113+
PenaltyBreakString: 1000
114+
PenaltyBreakTemplateDeclaration: 10
115+
PenaltyExcessCharacter: 1000000
116+
PenaltyReturnTypeOnItsOwnLine: 200
117+
PointerAlignment: Middle
118+
QualifierAlignment: Left
119+
#QualifierOrder: ['static', 'inline', 'friend', 'constexpr', 'const', 'volatile', 'type', 'restrict']
120+
RawStringFormats:
121+
- Language: Cpp
122+
Delimiters:
123+
- cc
124+
- CC
125+
- cpp
126+
- Cpp
127+
- CPP
128+
- 'c++'
129+
- 'C++'
130+
CanonicalDelimiter: ''
131+
ReferenceAlignment: Middle
132+
ReflowComments: false # IndentOnly
133+
SeparateDefinitionBlocks: Always
134+
SortIncludes: CaseInsensitive
135+
SortUsingDeclarations: LexicographicNumeric
136+
SpaceAfterCStyleCast: true
137+
SpaceAfterLogicalNot: false
138+
SpaceAfterTemplateKeyword: true
139+
SpaceBeforeAssignmentOperators: true
140+
SpaceBeforeCpp11BracedList: false
141+
SpaceBeforeCtorInitializerColon: true
142+
SpaceBeforeInheritanceColon: true
143+
SpaceBeforeParens: ControlStatements
144+
SpaceBeforeRangeBasedForLoopColon: true
145+
SpaceInEmptyBlock: false
146+
SpaceInEmptyParentheses: false
147+
SpacesBeforeTrailingComments: 2
148+
SpacesInAngles: Never
149+
SpacesInContainerLiterals: true
150+
SpacesInLineCommentPrefix:
151+
Minimum: 1
152+
Maximum: -1
153+
SpacesInParentheses: false
154+
SpacesInSquareBrackets: false
155+
SpaceBeforeSquareBrackets: false
156+
Standard: c++17
157+
TabWidth: 4
158+
UseTab: Never
159+
WhitespaceSensitiveMacros: ['STRINGIZE']
160+
...
161+

.devops/full-musa.Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_V
66

77
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
88

9+
# MUSA architecture to build for (defaults to all supported archs)
10+
ARG MUSA_DOCKER_ARCH=default
11+
912
RUN apt-get update && \
1013
apt-get install -y build-essential cmake python3 python3-pip git libcurl4-openssl-dev libgomp1
1114

@@ -19,7 +22,11 @@ WORKDIR /app
1922

2023
COPY . .
2124

22-
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
25+
# Use the default MUSA archs if not specified
26+
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
27+
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
28+
fi && \
29+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
2330
cmake --build build --config Release -j$(nproc) && \
2431
cp build/bin/* .
2532

.devops/llama-cli-musa.Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU
88

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

11+
# MUSA architecture to build for (defaults to all supported archs)
12+
ARG MUSA_DOCKER_ARCH=default
13+
1114
RUN apt-get update && \
1215
apt-get install -y build-essential git cmake
1316

1417
WORKDIR /app
1518

1619
COPY . .
1720

18-
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
21+
# Use the default MUSA archs if not specified
22+
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
23+
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
24+
fi && \
25+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
1926
cmake --build build --config Release --target llama-cli -j$(nproc) && \
2027
mkdir -p /app/lib && \
2128
find build -name "*.so" -exec cp {} /app/lib \;

.devops/llama-server-musa.Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU
88

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

11+
# MUSA architecture to build for (defaults to all supported archs)
12+
ARG MUSA_DOCKER_ARCH=default
13+
1114
RUN apt-get update && \
1215
apt-get install -y build-essential git cmake libcurl4-openssl-dev
1316

1417
WORKDIR /app
1518

1619
COPY . .
1720

18-
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
21+
# Use the default MUSA archs if not specified
22+
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
23+
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
24+
fi && \
25+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
1926
cmake --build build --config Release --target llama-server -j$(nproc) && \
2027
mkdir -p /app/lib && \
2128
find build -name "*.so" -exec cp {} /app/lib \;

.devops/nix/python-scripts.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let
3434

3535
# server tests
3636
openai
37-
behave
37+
pytest
3838
prometheus-client
3939
];
4040
in

.github/ISSUE_TEMPLATE/01-bug-low.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Bug (compilation)
2+
description: Something goes wrong when trying to compile llama.cpp.
3+
title: "Compile bug: "
4+
labels: ["bug-unconfirmed", "compilation"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
Thanks for taking the time to fill out this bug report!
10+
This issue template is intended for bug reports where the compilation of llama.cpp fails.
11+
Before opening an issue, please confirm that the compilation still fails with `-DGGML_CCACHE=OFF`.
12+
If the compilation succeeds with ccache disabled you should be able to permanently fix the issue
13+
by clearing `~/.cache/ccache` (on Linux).
14+
- type: textarea
15+
id: commit
16+
attributes:
17+
label: Git commit
18+
description: Which commit are you trying to compile?
19+
placeholder: |
20+
$git rev-parse HEAD
21+
84a07a17b1b08cf2b9747c633a2372782848a27f
22+
validations:
23+
required: true
24+
- type: dropdown
25+
id: operating-system
26+
attributes:
27+
label: Operating systems
28+
description: Which operating systems do you know to be affected?
29+
multiple: true
30+
options:
31+
- Linux
32+
- Mac
33+
- Windows
34+
- BSD
35+
- Other? (Please let us know in description)
36+
validations:
37+
required: true
38+
- type: dropdown
39+
id: backends
40+
attributes:
41+
label: GGML backends
42+
description: Which GGML backends do you know to be affected?
43+
options: [AMX, BLAS, CPU, CUDA, HIP, Kompute, Metal, Musa, RPC, SYCL, Vulkan]
44+
multiple: true
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: info
49+
attributes:
50+
label: Problem description & steps to reproduce
51+
description: >
52+
Please give us a summary of the problem and tell us how to reproduce it.
53+
If you can narrow down the bug to specific compile flags, that information would be very much appreciated by us.
54+
placeholder: >
55+
I'm trying to compile llama.cpp with CUDA support on a fresh install of Ubuntu and get error XY.
56+
Here are the exact commands that I used: ...
57+
validations:
58+
required: true
59+
- type: textarea
60+
id: first_bad_commit
61+
attributes:
62+
label: First Bad Commit
63+
description: >
64+
If the bug was not present on an earlier version: when did it start appearing?
65+
If possible, please do a git bisect and identify the exact commit that introduced the bug.
66+
validations:
67+
required: false
68+
- type: textarea
69+
id: logs
70+
attributes:
71+
label: Relevant log output
72+
description: >
73+
Please copy and paste any relevant log output, including the command that you entered and any generated text.
74+
This will be automatically formatted into code, so no need for backticks.
75+
render: shell
76+
validations:
77+
required: true

0 commit comments

Comments
 (0)