Repository navigation
fix(studio): wire llama's OpenMP runtime into slim whisper installs - #8230
Conversation
The slim wiring mirrors libggml*/ggml*.dll plus libomp*.dll from the paired llama bin dir. The DLL glob was added for llama's clang-built windows-arm64 ggml-base.dll; the ELF side was left out on the assumption that Linux ggml takes libgomp.so.1 from the host. That holds for the gcc-built x64 slice but not for arm64: llama's arm64 libggml-base.so is clang-built and NEEDS libomp.so.5 with RUNPATH $ORIGIN, and that library ships inside the llama bundle rather than on the host. Every slim install on linux arm64 therefore wired a ggml stack whose loader immediately failed with "libomp.so.5: cannot open shared object file", so dictation fell back to Transformers. Add libomp*.so* and libomp*.dylib to the globs, and bump SLIM_RUNTIME_WIRING_VERSION so installs made under the old wiring re-wire instead of reporting themselves current: their marker does not list libomp.so.5, so the missing-library check that would otherwise repair them never fires. whisper.cpp side is unslothai/whisper.cpp#18 (CI wiring) and #19, which adds the library to requires_ggml_sonames. That gate reads the llama bin dir, where libomp.so.5 is a real file, so the new manifests pair correctly with both the old and the new installer. Verified against the real published llama.cpp arm64 and x64 cpu bundles: wiring the arm64 bundle now places libomp.so.5 beside whisper-server and pulls in no llama libraries; every soname the new whisper manifests require exists as a file in the paired llama bin dir on both arches; and an x64 whisper-server wired through link_ggml_runtime starts and returns a real transcription. All 350 whisper/llama/prebuilt-core install tests pass.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fef32267aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SLIM_RUNTIME_WIRING_VERSION = 2 | ||
| # 3: libomp*.so* / libomp*.dylib joined the wiring, so slim installs made | ||
| # under version 2 are missing libomp.so.5 on linux arm64 and must re-wire. | ||
| SLIM_RUNTIME_WIRING_VERSION = 3 |
There was a problem hiding this comment.
Keep the sidecar's ROCm wiring version in sync
For every newly installed slim ROCm runtime, this writes runtime_wiring_version: 3, but slim_runtime_intact() in studio/backend/core/inference/stt_ggml_sidecar.py still requires the version to equal 2. Consequently both Linux and Windows ROCm installs produced by this change are immediately reported as unavailable, and dictation asks users to reinstall even though all linked libraries are present; update the sidecar's accepted version together with this bump.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct and my regression: with the bump to 3 the sidecar's ROCm branch rejected every new install, and the installer treats 3 as current so update never repaired it. Reproduced (v2 intact, v3 rejected with the reinstall warning). Fixed in 816d5b3 by pinning a floor (>= 2, the first wiring that records linked_runtime_directories) instead of one exact version, plus regression tests for v3 accepted and v1 still rejected.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Companion to unslothai/whisper.cpp#18 and unslothai/whisper.cpp#19. Those fix the build and the published contract; this fixes what the installer actually wires, which is what users run.
The bug
SLIM_GGML_LIBRARY_GLOBSmirrorslibggml*/ggml*.dll/libomp*.dllfrom the paired llama bin dir into the whisper bin dir. The DLL glob was added for llama's clang-built windows-arm64ggml-base.dll; the ELF side was skipped on the stated assumption that Linux ggml takeslibgomp.so.1from the host.That holds for the gcc-built x64 slice, but not for arm64. From the published
app-b10327-mix-b1e9972-linux-arm64-cpu.tar.gz:libomp.so.5ships inside the llama bundle and is not a host library. So on linux arm64 every slim install wired a ggml stack the loader could not bring up:whisper-servernever starts and dictation silently falls back to Transformers. The same defect broke the whisper.cpp release CI, which is how it surfaced.Changes
libomp*.so*andlibomp*.dylibjoinSLIM_GGML_LIBRARY_GLOBS. Linux x64 (gcc,libgomp.so.1from the host, exactly as llama's own binaries resolve it) and macOS (Apple clang, no OpenMP) ship no libomp, so the globs match nothing and those platforms are byte-identical.SLIM_RUNTIME_WIRING_VERSION2 -> 3. Without this, an install made under the old wiring reports itself current forever: the missing-library repair check only looks at names in its own marker, and the old marker never listedlibomp.so.5. The bump is what actually repairs the broken arm64 installs already out there.The fail-closed rule is unchanged: OpenMP without any ggml library still raises
PrebuiltFallback, now covered for the ELF case too.On the manifest side
whisper.cpp#19 adds
libomp.so.5torequires_ggml_sonameson linux/arm64 andlibomp140.<arch>.dllon Windows.slim_pairing_for_artifactchecks those names against the llama bin dir, where they are real files, so the new manifests pair correctly with both the old and the new installer. No coordinated rollout is needed; this PR is what makes the wiring match the contract.Verification
Against the real published llama.cpp bundles, not fixtures:
libomp.so.5besidewhisper-server(16 libs) and pulls in nolibllama*.whisper-serverfrom the publishedv1.9.2-unsloth.5slim bundle, wired throughlink_ggml_runtimeand launched with--no-gpu, returns a real transcription ofsamples/jfk.wav.libomp.so.5and excludeslibllama.so, and libomp alone still fails closed.