Repository navigation
fix: delete 2 unused functions, fixing linking against shared libggml-1.0.0 - #2363
adamjrichter wants to merge 1 commit into
Conversation
…-1.0.0
Delete two unused connected functions from src/core:
ggml_backend_graph_compute_async_range
sd_backend_graph_compute_with_eval_callback
They were causing an undefined reference to ggml_graph_view when linking
stable-diffusion against external shared libggml-1.0.0.
ggml_graph_view is a unexported symbol in libggml-1.0.0. The link error
did not occur with other build configurations because
(a) these functions are ifdef'ed out when using integrated libggml, and
(b) the function hiding facility used by libggml does not currently
have effect for static libraries.
This diff was vibe coded with app.devin.ai, which suggested the idea
of just deleting these two functions.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Delete two unused connected functions from src/core:
ggml_backend_graph_compute_async_range
sd_backend_graph_compute_with_eval_callback
They were causing an undefined reference to ggml_graph_view when linking stable-diffusion against external shared libggml-1.0.0.
ggml_graph_view is an unexported symbol in libggml-1.0.0. The the function hiding facility used by libggml does
not currently have effect for static libraries, so the problem would only have occurred for users linking external
libggml that is also a shared library.
This diff was vibe coded with app.devin.ai, which suggested the idea of just deleting these two functions.
Related Issue / Discussion
Thanks to @wbruna and @leejet for, respectively, creating and merging ggml-1.0.0
support in pull request #2354.
I had tried asking devin.ai to do the upgrade, as
discussed in #2355, but
am not knowledgeable enough to be confident in the ggml function replacement
the AI suggested (which may have come from it training on or finding some text from
@wbruna somewhere on the internet).
By the way, devin.ai thinks the hidden symbol problem goes back ggml-0.27.0.
Additional Information
An argument this diff might not be OK:
that this diff would delete, and that you made your changes this year,
so I encourage you and any other reviewers to stop this diff or change
it to just comment out the functions if those functions are in the source tree
because some user of them is about to be merged in.
Arguments this diff should be OK:
This diff consists only of deletions--no new content.
The names of these two deleted functions no longer are found
anywhere in the source tree, and the C preprocessor '##' operator
appears only in thirdparty/, reducing chances of an unseen use of
the deleted functions hiding in any other build configuration.
app.devin.ai reported success building with both internal ggml and
external shared ggml with this diff.
After I built with this diff, ldd showed sd-cli successfully dynamically
linked against libggml, and sd-cli was able to generate a picture.
I asked gemini.google.com if stable-diffusion itself could have out of
tree consumers of symbols, such as plugins or having the effect functions
made available as a public library it claimed this was not so in this case.
Although this diff consists only of deletions, I hereby release any copyright
interest I may have in it to the public domain.
Checklist
Summary by CodeRabbit