-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llama : reorganize source code + improve CMake #8006
Conversation
729c7cc
to
cde2512
Compare
ace2b97
to
8216c4c
Compare
8216c4c
to
5b1490a
Compare
c9a3dc8
to
73d5f90
Compare
The Some CI workflows are still failing - any help with resolving these is appreciated. I'll now focus on updating |
e550e3e
to
7c1c378
Compare
This comment was marked as outdated.
This comment was marked as outdated.
It works with |
I noticed now that This seems to work. My assumption is that However, all of this seems like a hack, we go through the effort to use diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b9b5413..96718d75 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ include(CheckIncludeFileCXX)
set(CMAKE_WARN_UNUSED_CLI YES)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index c6fccc02..02415f2d 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -1,5 +1,7 @@
# common
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
find_package(Threads REQUIRED)
# Build info header
diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txt
index bdbda425..21ef7e4a 100644
--- a/ggml/CMakeLists.txt
+++ b/ggml/CMakeLists.txt
@@ -3,6 +3,7 @@ project("ggml" C CXX)
include(CheckIncludeFileCXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt
index 84bc8e19..b7c79321 100644
--- a/ggml/src/CMakeLists.txt
+++ b/ggml/src/CMakeLists.txt
@@ -825,10 +825,6 @@ endif()
if (WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
-
- if (BUILD_SHARED_LIBS)
- set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
- endif()
endif()
if (GGML_LTO) |
CMakeLists.txt
Outdated
" to set correct LLAMA_BLAS_VENDOR") | ||
# override ggml options | ||
set(GGML_CCACHE ${LLAMA_CCACHE}) | ||
set(GGML_BUILD_SHARED_LIBS ${LLAMA_BUILD_SHARED_LIBS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GGML_BUILD_SHARED_LIBS
and LLAMA_BUILD_SHARED_LIBS
do not exist, BUILD_SHARED_LIBS
is used directly.
if you are reorganizing source codes, I would like to suggest moving some compiled tools from the example folder into a dedicated folder. It's not quite a script, but in my opinion its not examples as well... considering it's more for maintainers internal usage |
@slaren The |
There is now Edit: nvm #8140 |
Update build recipes with ggerganov/llama.cpp#8006 Signed-off-by: Ettore Di Giacinto <[email protected]>
Update build recipes with ggerganov/llama.cpp#8006 Signed-off-by: Ettore Di Giacinto <[email protected]>
Update build recipes with ggerganov/llama.cpp#8006 Signed-off-by: Ettore Di Giacinto <[email protected]>
Update build recipes with ggerganov/llama.cpp#8006 Signed-off-by: Ettore Di Giacinto <[email protected]>
PR ggerganov#8006 changes defaults to build shared libs. However, CI for release builds expects static builds.
PR ggerganov#8006 changes defaults to build shared libs. However, CI for releases expects static builds.
* CI: fix release build (Ubuntu) PR #8006 changes defaults to build shared libs. However, CI for releases expects static builds. * CI: fix release build (Mac) --------- Co-authored-by: loonerin <[email protected]>
* arrow_up: Update ggerganov/llama.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Ettore Di Giacinto <[email protected]> * deps(llama.cpp): update build variables to follow upstream Update build recipes with ggerganov/llama.cpp#8006 Signed-off-by: Ettore Di Giacinto <[email protected]> * Disable shared libs by default in llama.cpp Signed-off-by: Ettore Di Giacinto <[email protected]> * Disable shared libs in llama.cpp Makefile Signed-off-by: Ettore Di Giacinto <[email protected]> * Disable metal embedding for now, until it is tested Signed-off-by: Ettore Di Giacinto <[email protected]> * fix(mac): explicitly enable metal Signed-off-by: Ettore Di Giacinto <[email protected]> * debug Signed-off-by: Ettore Di Giacinto <[email protected]> * fix typo Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Ettore Di Giacinto <[email protected]> Co-authored-by: mudler <[email protected]>
* scripts : update sync [no ci] * files : relocate [no ci] * ci : disable kompute build [no ci] * cmake : fixes [no ci] * server : fix mingw build ggml-ci * cmake : minor [no ci] * cmake : link math library [no ci] * cmake : build normal ggml library (not object library) [no ci] * cmake : fix kompute build ggml-ci * make,cmake : fix LLAMA_CUDA + replace GGML_CDEF_PRIVATE ggml-ci * move public backend headers to the public include directory (ggerganov#8122) * move public backend headers to the public include directory * nix test * spm : fix metal header --------- Co-authored-by: Georgi Gerganov <[email protected]> * scripts : fix sync paths [no ci] * scripts : sync ggml-blas.h [no ci] --------- Co-authored-by: slaren <[email protected]>
* CI: fix release build (Ubuntu) PR ggerganov#8006 changes defaults to build shared libs. However, CI for releases expects static builds. * CI: fix release build (Mac) --------- Co-authored-by: loonerin <[email protected]>
* scripts : update sync [no ci] * files : relocate [no ci] * ci : disable kompute build [no ci] * cmake : fixes [no ci] * server : fix mingw build ggml-ci * cmake : minor [no ci] * cmake : link math library [no ci] * cmake : build normal ggml library (not object library) [no ci] * cmake : fix kompute build ggml-ci * make,cmake : fix LLAMA_CUDA + replace GGML_CDEF_PRIVATE ggml-ci * move public backend headers to the public include directory (ggerganov#8122) * move public backend headers to the public include directory * nix test * spm : fix metal header --------- Co-authored-by: Georgi Gerganov <[email protected]> * scripts : fix sync paths [no ci] * scripts : sync ggml-blas.h [no ci] --------- Co-authored-by: slaren <[email protected]>
* CI: fix release build (Ubuntu) PR ggerganov#8006 changes defaults to build shared libs. However, CI for releases expects static builds. * CI: fix release build (Mac) --------- Co-authored-by: loonerin <[email protected]>
* changes upstream in ggerganov/llama.cpp#8006 - ggerganov/llama.cpp@f3f6542
* changes upstream in ggerganov/llama.cpp#8006 - ggerganov/llama.cpp@f3f6542
ref #7573, #6913
Adopt a new structure of the source code that makes
ggml
source code and build scripts easier to reuse.Note that the build options that are relevant to the
ggml
library are now prefixed withGGML_
. For example,LLAMA_CUDA
andWHISPER_METAL
are nowGGML_CUDA
andGGML_METAL
. However,WHISPER_COREML
andWHISPER_OPENVINO
are still named the same because the CoreML and OpenVINO functionality inwhisper.cpp
is not part of theggml
library.The
Makefiles
inllama.cpp
andwhisper.cpp
have been updated to be more similar with each other.Header files (such as
ggml.h
,llama.h
andwhisper.h
) are now placed ininclude
subfolders, while the source files are placed insrc
.PRs in other projects that will be updated and merged together with this one:
TODOs:
ggml
repowhisper.cpp
repollama.cpp
whisper.cpp
llama.cpp
ggml
whisper.cpp
ggml/cmake
master
?)GGML_
optionsllama.cpp
whisper.cpp
Changes:
LLAMA_XXX
in favor ofGGML_XXX
Resolved PRs:
TODO in follow-up PRs:
tests
toggml/tests
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
and build and link shared libraries properlyggml
folder level