feat: dynamic-backends (GGML_BACKEND_DL) — macOS+Linux DL modules#1
Merged
Conversation
…+ cmake DL option)
Expose backend_name() (FFI to parakeet_capi_backend_name) returning the resolved ggml device name, and add a macOS-gated integration test under the dynamic-backends feature proving a dlopen'd Metal backend module is selected for a real model (de-risk for the dynamic-backends path). De-risk surfaced a DL-only crash: parakeet.cpp's backend.cpp calls CPU-backend symbols directly, which under GGML_BACKEND_DL live only in a dlopen'd module. ggml loaded modules RTLD_LOCAL, so those dynamic_lookup references resolved to NULL -> SIGSEGV on first Backend construction (Metal path). Fixed with a repo-tracked ggml patch (patches/ggml/0001-dl-load-global.patch) that loads backend modules RTLD_GLOBAL on Unix; build.rs now applies patches/ggml to the ggml submodule root. parakeet-cpp/build.rs re-emits the sys crate's backends dir as PARAKEET_DL_BACKENDS_DIR so the test can point PARAKEET_BACKENDS_DIR at the modules.
…llow-shlib-undefined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
dynamic-backendsfeature that builds ggml backends as runtime-loadable modules (GGML_BACKEND_DL), loads them via ggml_backend_load_all, and exposes the active device via Model::backend_name(). Validated on macOS (Metal loaded as a module). Includes a vendored parakeet.cpp DL patch + an RTLD_GLOBAL ggml patch (fixes a real DL crash). CI: static + DL legs on macOS/Linux. Windows DL deferred (MSVC symbol-deferral limitation — needs registry-routing patch).