libs : rename libcommon -> libllama-common#21936
Conversation
I think it would be OK to get the first version out like this, if that keeps things simpler for you, and to improve upon this later. Improvement: the canonical way to do this would be to
You can see this with systemd, for example. $ ldd /usr/bin/journalctl | grep libsystemd-shared
libsystemd-shared-255.so => /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-255.so (0x00007e3a8167f000)
$ readelf -d /usr/bin/journalctl | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [/usr/lib/x86_64-linux-gnu/systemd]Since Debian requires libraries in public paths to have stable ABI, we maintain a downstream-only patch that currently makes all llama.cpp libraries private following the example above (see our libllama0 file list). And at build time, all we do is pass If you intend to implement this improvement, perhaps we can find a general solution that makes our patch obsolete. [We never intended to upstream our patch as it goes too far for you, by hiding |
arthw
left a comment
There was a problem hiding this comment.
I tested for SYCL backend.
It's OK for SYCL backend.
Thank you!
b9c51fc to
c4f5835
Compare
|
A bit related to this, I've been thinking about moving The current PR starts to introduce the naming scheme Re. your concern about not allowing 3rd-party to use the llama.cpp/tools/mtmd/mtmd-helper.cpp Lines 35 to 37 in 8dc530b |
dac63e9 to
64c8c88
Compare
Got it, thanks. We can do that in the next iteration.
I guess to do that we need to automate the ABI stability validation on our end. We basically need to add a workflow to llama.cpp repo that would compare the current ABI with the latest released ABI and raise an error if there is backwards incompatibility. Probably something that we should address soon.
Yes, we need to reorganize the
It's not a problem. The only annoyance is that users will see a |
I had this on my TODO list, actually in both directions
Point 2. would be a common occurence. It's when llama.cpp needs a newer ggml for new symbols/features but doesn't break existing ones. Which means a new ggml minor release is needed. |
Forgot to mention, we're having a discussion in #21674 (especially the comment #21674 (comment)) about the direction of moving CLI to using HTTP instead native "server engine" version. Kindly asking if you can share you POV the discussion when you have time. Thanks in advance! |
Smaller binaries are appealing. Some of the larger backends may not even notice, but Vulkan might.
This is one of the most exciting things I've heard out of llama.cpp development in a while. Llama.cpp interests me as a library more than a client front end or inference web API host, but I've got old code that doesn't work with the newer versions of the library and haven't gotten around to fixing it. It does make me wonder about the balance between the flexibility of exposing new things that newer models use versus abstracting those so that old code can use drop-in replacements of llama.cpp and benefit from newer models without code changes. Like a basic default usage path and a more manual usage path that allows more tinkering. Is an approach like that even compatible with aiming for stability without leaving a graveyard of old public methods? Would you have to create a kind of feature router that people can use to indirectly call a subset of private methods by request until they're stabilized and made public? |
|
@ckastner If you have any suggestions how to implement the workflow let us know. I tried to prototype something that extracts the current ABI, but it boils down to parsing the header file which seems a bit fragile. Maybe the tools that you mentioned would be better suited for that. @ngxson Yes, generally decoupling the communication layer from the logic (both server and client) is a good idea in terms of the implementation. The server-side though is more important IMO atm. @CMay I'm not sure I follow everything, but the bottom line is that when we transition to semantic versioning it should generally be easier for 3rd parties using llama.cpp. We just need an automation for that because it is difficult to keep track of all the changes.
No, this sounds too complicated. We want to expose only functionality that will likely remain stable long term. Experiments can be done in tools/examples in the repo or in forks. |
aefc0d1 to
625c622
Compare
625c622 to
fa86a92
Compare
Overview
libcommon->libllama-commonlibbuild_info->libllama-common-baselibllama-commonto be shared (based onBUILD_SHARED_LIBS)libllamaAdditional information
This change reduces the output binaries size by making all binaries dynamically link to
libllama-common.Ideally,
libllama-commonshould not be installed in the publiclibpath as it is not meant for 3rd-party usage. However, I'm not sure what is the canonical way to do that. For now, installing it the exact way aslibllamausing the same versioning scheme.Requirements