Skip to content
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

ggml : unified CMake build #6913

Open
ggerganov opened this issue Apr 25, 2024 · 3 comments
Open

ggml : unified CMake build #6913

ggerganov opened this issue Apr 25, 2024 · 3 comments
Labels
build Compilation issues enhancement New feature or request refactoring Refactoring

Comments

@ggerganov
Copy link
Owner

Currently the ggml, llama.cpp and whisper.cpp projects share the same source of the ggml library, but have different CMake scripts. The scripts are adapted to the specifics of the projects and are quite similar with each other - all of them build ggml. Still, there are differences due to manually rewriting them and applying changes from one repo to another

The goal in this task is to unify, deduplicate and streamline the build process of ggml with proper CMake scripts that are shared across the projects. This will simplify changes in the future and will also help other 3rd party projects that depend on ggml

More on this topic has been discussed in:

To achieve that, the ggml-related sources in llama.cpp and whisper.cpp would likely have to be reorganized in a subfolder to emulate a submodule. We avoid usage of actual git submodules since I consider that it has some disadvantages. Instead, we do manual synchronization with sync scripts across the 3 repos. In any case, after we complete this task it would be much simpler to switch to a ggml submodule if we decide to do so in the future

Regarding the existing Makefiles in llama.cpp and whisper.cpp - we should keep those as an alternative build system. It does not have to support all possible backends and configurations as the primary CMake build would do so. Makefile maintenance will be low priority

After the build system is improved, we can consider extending it with build-time generated configuration (e.g. config.h) for increased compatibility as suggested in #5890. But for now this remains low priority

@ggerganov ggerganov added enhancement New feature or request build Compilation issues refactoring Refactoring labels Apr 25, 2024
@ggerganov ggerganov moved this to Todo in ggml : roadmap Apr 25, 2024
@github-actions github-actions bot added the stale label May 26, 2024
Copy link
Contributor

github-actions bot commented Jun 9, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Jun 9, 2024
@ggerganov ggerganov removed the stale label Jun 9, 2024
@ggerganov ggerganov reopened this Jun 9, 2024
@github-actions github-actions bot added the stale label Jul 10, 2024
@ggerganov ggerganov removed the stale label Jul 11, 2024
@ggerganov ggerganov moved this from Todo to In Progress in ggml : roadmap Jul 24, 2024
@github-actions github-actions bot added the stale label Aug 11, 2024
@ggerganov ggerganov removed the stale label Aug 18, 2024
@github-actions github-actions bot added the stale label Sep 18, 2024
@ggerganov ggerganov removed the stale label Sep 28, 2024
@github-actions github-actions bot added the stale label Oct 29, 2024
@ggerganov ggerganov removed the stale label Nov 5, 2024
@ggerganov
Copy link
Owner Author

I think a big part of this issue has been completed since the ggml sub-tree has a CMake build system that appears to work seamlessly across the 3 projects ggml, whisper.cpp and llama.cpp.

Regarding the build-time generated configurations that were discussed, I'm not sure how to spec and implement this, so maybe we can do this within another issue.

@slaren Do you have any advise how to improve the CMake build system even further or if there is anything lacking atm?

@slaren
Copy link
Collaborator

slaren commented Nov 5, 2024

I am starting to work now on a significant change to the build system to allow building the backends as shared libraries. To do so, we need to split the ggml build into a small common library that backends can link to statically, and a bundle library that also includes the backends linked into the build. I am thinking that it may make sense to move each backend to a different directory with its own CMakeLists.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Compilation issues enhancement New feature or request refactoring Refactoring
Projects
Status: In Progress
Development

No branches or pull requests

2 participants