Skip to content

Commit 27d6181

Browse files
committed
Merge branch 'master' of github.com:ggerganov/llama.cpp into grammar-example
* 'master' of github.com:ggerganov/llama.cpp: ggml-cuda : perform cublas mat mul of quantized types as f16 (ggml-org#3412) llama.cpp : add documentation about rope_freq_base and scale values (ggml-org#3401) train : fix KQ_pos allocation (ggml-org#3392) llama : quantize up to 31% faster on Linux and Windows with mmap (ggml-org#3206) readme : update hot topics + model links (ggml-org#3399) readme : add link to grammars app (ggml-org#3388) swift : fix build on xcode 15 (ggml-org#3387) build : enable more non-default compiler warnings (ggml-org#3200) ggml_tensor: update the structure comments. (ggml-org#3283) ggml : release the requested thread pool resource (ggml-org#3292) llama.cpp : split llama_context_params into model and context params (ggml-org#3301) ci : multithreaded builds (ggml-org#3311) train : finetune LORA (ggml-org#2632) gguf : basic type checking in gguf_get_* (ggml-org#3346) gguf : make token scores and types optional (ggml-org#3347) ci : disable freeBSD builds due to lack of VMs (ggml-org#3381) llama : custom attention mask + parallel decoding + no context swaps (ggml-org#3228) docs : mark code as Bash (ggml-org#3375) readme : add Mistral AI release 0.1 (ggml-org#3362) ggml-cuda : perform cublas fp16 matrix multiplication as fp16 (ggml-org#3370)
2 parents 80596fc + f5ef5cf commit 27d6181

Some content is hidden

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

67 files changed

+10849
-3988
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
- name: Build
3939
id: make_build
4040
run: |
41-
CC=gcc-8 make
41+
CC=gcc-8 make -j $(nproc)
4242
4343
- name: Test
4444
id: make_test
4545
run: |
46-
CC=gcc-8 make tests
47-
make test
46+
CC=gcc-8 make tests -j $(nproc)
47+
make test -j $(nproc)
4848
4949
ubuntu-latest-cmake:
5050
runs-on: ubuntu-latest
@@ -66,7 +66,7 @@ jobs:
6666
mkdir build
6767
cd build
6868
cmake ..
69-
cmake --build . --config Release
69+
cmake --build . --config Release -j $(nproc)
7070
7171
- name: Test
7272
id: cmake_test
@@ -101,7 +101,7 @@ jobs:
101101
mkdir build
102102
cd build
103103
cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
104-
cmake --build . --config ${{ matrix.build_type }}
104+
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
105105
106106
- name: Test
107107
id: cmake_test
@@ -135,7 +135,7 @@ jobs:
135135
mkdir build
136136
cd build
137137
cmake -DLLAMA_MPI=ON ..
138-
cmake --build . --config Release
138+
cmake --build . --config Release -j $(nproc)
139139
140140
- name: Test
141141
id: cmake_test
@@ -160,13 +160,13 @@ jobs:
160160
- name: Build
161161
id: make_build
162162
run: |
163-
make
163+
make -j $(sysctl -n hw.logicalcpu)
164164
165165
- name: Test
166166
id: make_test
167167
run: |
168-
make tests
169-
make test
168+
make tests -j $(sysctl -n hw.logicalcpu)
169+
make test -j $(sysctl -n hw.logicalcpu)
170170
171171
macOS-latest-cmake:
172172
runs-on: macos-latest
@@ -189,7 +189,7 @@ jobs:
189189
mkdir build
190190
cd build
191191
cmake -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF ..
192-
cmake --build . --config Release
192+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
193193
194194
- name: Test
195195
id: cmake_test
@@ -223,7 +223,7 @@ jobs:
223223
-DLLAMA_BUILD_SERVER=OFF \
224224
-DCMAKE_SYSTEM_NAME=iOS \
225225
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
226-
cmake --build . --config Release
226+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
227227
228228
macOS-latest-cmake-tvos:
229229
runs-on: macos-latest
@@ -251,7 +251,7 @@ jobs:
251251
-DLLAMA_BUILD_SERVER=OFF \
252252
-DCMAKE_SYSTEM_NAME=tvOS \
253253
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
254-
cmake --build . --config Release
254+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
255255
256256
windows-latest-cmake:
257257
runs-on: windows-latest
@@ -324,7 +324,7 @@ jobs:
324324
mkdir build
325325
cd build
326326
cmake .. ${{ matrix.defines }}
327-
cmake --build . --config Release
327+
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
328328
329329
- name: Add clblast.dll
330330
id: add_clblast_dll
@@ -415,7 +415,7 @@ jobs:
415415
mkdir build
416416
cd build
417417
cmake .. -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
418-
cmake --build . --config Release
418+
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
419419
420420
- name: Determine tag name
421421
id: tag
@@ -457,22 +457,22 @@ jobs:
457457
path: |
458458
cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
459459
460-
freeBSD-latest:
461-
runs-on: macos-12
462-
steps:
463-
- name: Clone
464-
uses: actions/checkout@v3
465-
466-
- name: Build
467-
uses: cross-platform-actions/[email protected]
468-
with:
469-
operating_system: freebsd
470-
version: '13.2'
471-
hypervisor: 'qemu'
472-
run: |
473-
sudo pkg update
474-
sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
475-
gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15
460+
# freeBSD-latest:
461+
# runs-on: macos-12
462+
# steps:
463+
# - name: Clone
464+
# uses: actions/checkout@v3
465+
#
466+
# - name: Build
467+
# uses: cross-platform-actions/[email protected]
468+
# with:
469+
# operating_system: freebsd
470+
# version: '13.2'
471+
# hypervisor: 'qemu'
472+
# run: |
473+
# sudo pkg update
474+
# sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
475+
# gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
476476

477477
release:
478478
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ models-mnt
4545
/main
4646
/metal
4747
/perplexity
48+
/q8dot
4849
/quantize
4950
/quantize-stats
5051
/result
5152
/save-load-state
5253
/server
5354
/simple
55+
/batched
56+
/export-lora
57+
/finetune
5458
/speculative
59+
/parallel
5560
/train-text-from-scratch
5661
/vdot
5762
build-info.h

CMakeLists.txt

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -414,37 +414,38 @@ endif()
414414

415415
if (LLAMA_ALL_WARNINGS)
416416
if (NOT MSVC)
417-
set(c_flags
418-
-Wall
419-
-Wextra
420-
-Wpedantic
421-
-Wcast-qual
422-
-Wdouble-promotion
423-
-Wshadow
424-
-Wstrict-prototypes
425-
-Wpointer-arith
426-
-Wmissing-prototypes
427-
-Werror=implicit-int
428-
-Wno-unused-function
429-
)
430-
set(cxx_flags
431-
-Wall
432-
-Wextra
433-
-Wpedantic
434-
-Wcast-qual
435-
-Wmissing-declarations
436-
-Wno-unused-function
437-
-Wno-multichar
438-
)
439-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
440-
# g++ only
441-
set(cxx_flags ${cxx_flags} -Wno-format-truncation -Wno-array-bounds)
417+
set(warning_flags -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function)
418+
set(c_flags -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int
419+
-Werror=implicit-function-declaration)
420+
set(cxx_flags -Wmissing-declarations -Wmissing-noreturn)
421+
422+
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
423+
set(warning_flags ${warning_flags} -Wunreachable-code-break -Wunreachable-code-return)
424+
set(cxx_flags ${cxx_flags} -Wmissing-prototypes -Wextra-semi)
425+
426+
if (
427+
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8.0) OR
428+
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.3.0)
429+
)
430+
set(c_flags ${c_flags} -Wdouble-promotion)
431+
endif()
432+
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
433+
set(c_flags ${c_flags} -Wdouble-promotion)
434+
set(cxx_flags ${cxx_flags} -Wno-array-bounds)
435+
436+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.1.0)
437+
set(cxx_flags ${cxx_flags} -Wno-format-truncation)
438+
endif()
439+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1.0)
440+
set(cxx_flags ${cxx_flags} -Wextra-semi)
441+
endif()
442442
endif()
443443
else()
444444
# todo : msvc
445445
endif()
446446

447447
add_compile_options(
448+
${warning_flags}
448449
"$<$<COMPILE_LANGUAGE:C>:${c_flags}>"
449450
"$<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>"
450451
)

0 commit comments

Comments
 (0)