Skip to content

Publish the OpenMP runtime in requires_ggml_sonames and gate the drift - #19

Merged
danielhanchen merged 1 commit into
masterfrom
fix-slim-soname-contract
Aug 9, 2026
Merged

danielhanchen merged 1 commit into
masterfrom
fix-slim-soname-contract

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #18. That PR made CI wire libomp.so.5 so the arm64 build passes; this one fixes the contract the installer actually reads, and stops the two from drifting again.

The remaining hole

requires_ggml_sonames in the manifest is the list the Studio installer verifies and wires from. The bundle published as v1.9.2-unsloth.6 still declares only:

"requires_ggml_sonames": ["libggml.so.0", "libggml-base.so.0"]

On linux/arm64 the loader also needs libomp.so.5, which ships inside the paired llama bundle and is not a system library. An installer that wires exactly what the manifest asks for therefore still produces a whisper-server that dies with the same rc=127, even though CI is green, because CI wires by glob and the installer wires by list.

Windows has the identical hole. I read the PE import tables of the paired llama bundles: ggml-base.dll imports libomp140.x86_64.dll on x64 and libomp140.aarch64.dll on arm64, so llama's Windows slices are clang-built on both arches, not just arm64. Neither name is in the Windows contract; those jobs pass only because the wiring globs libomp*.dll.

Changes

scripts/package_bundle.py - the soname contract becomes per-arch in the platform strategies via a new openmp_sonames map and sonames_for(arch), so it is derived where the rest of the packaging contract lives instead of being spelled out per job:

os/arch requires_ggml_sonames
linux/x64 libggml.so.0, libggml-base.so.0 (unchanged)
linux/arm64 + libomp.so.5
windows/x64 + libomp140.x86_64.dll
windows/arm64 + libomp140.aarch64.dll
macos/x64, macos/arm64 unchanged

The GGML_SONAMES env override still takes precedence, so the macOS jobs that pass their own per-arch dylib closure are untouched.

scripts/validate_bundle.py - a fifth check on Linux: every library the loader resolves out of the paired llama dir must appear in requires_ggml_sonames. A missing one is a hard failure naming the library and the remedy. A declared name the llama bundle does not provide is only a warning, so a llama-side change can never block a release by itself.

Verification

  • Packaged synthetic linux slim bundles for both arches: arm64 embeds ["libggml.so.0", "libggml-base.so.0", "libomp.so.5"], x64 is byte-for-byte the old list.
  • Full validate_bundle.py --ggml-dir --cpu-only against the published v1.9.2-unsloth.5 x64 bundle and its own paired llama release: wiring, closure, the new contract check, and a real /inference transcription all pass.
  • Fed the gate a deliberately mismatched pair (arm64 manifest, x64 llama dir): it warns about libomp.so.5 and does not fail, as intended.
  • 13-case suite over both real llama linux bundles plus a synthetic ELF chain: the gate fails on an undeclared lib, passes once declared, warns on a stale entry, and wiring stays idempotent.

Note

The docs in .github/workflows/UNSLOTH_PREBUILT_README.md still describe the installer wiring as libggml* only and list the old per-platform sonames. My token has no workflow scope so I cannot touch that path; the wording change wants to say that the wiring is "every libggml* plus the OpenMP runtime shipped beside them", with the per-arch lists above.

Also worth flagging: v1.9.2-unsloth.6 is already published with the old manifest, and a scheduled or repository_dispatch run is a no-op while that tag still pairs with the newest llama. Publishing a corrected manifest needs a workflow_dispatch with the packaging suffix bumped to unsloth.7.

Wiring the OpenMP runtime in CI (#18) fixed the build, but the contract the
Studio installer actually reads did not change: requires_ggml_sonames still
listed only the two ggml sonames, so an installer wiring from that list (or
from a libggml* glob) still lands an arm64 bundle whose whisper-server cannot
load. Windows has the same hole - ggml-base.dll imports libomp140.<arch>.dll
on BOTH arches, verified in the PE import tables of the paired llama bundles -
and only passed CI because the wiring globs libomp*.dll.

Make the soname contract per-arch in the platform strategies rather than
per-job, so the manifest is derived where the rest of the packaging contract
lives: libomp.so.5 on linux/arm64, libomp140.<arch>.dll on both Windows
arches. linux/x64 (gcc, libgomp from the host) and macOS (Apple clang, no
OpenMP) are unchanged, and the existing GGML_SONAMES override still wins, so
the macOS jobs that pass their own per-arch closure are untouched.

Then close the loop in CI: on Linux, validate_bundle.py now asserts that every
library the loader resolves out of the paired llama bundle appears in
requires_ggml_sonames. CI wires by glob and the installer wires from the list,
so without this the two drift and the build goes green while every install is
broken - exactly what happened here. A declared name the llama bundle does not
provide is a warning, not a failure, so a llama-side change cannot block a
release on its own.

Verified by packaging synthetic linux slim bundles for both arches (arm64 gains
libomp.so.5, x64 unchanged), by running the full validation against the
published v1.9.2-unsloth.5 x64 bundle and its paired llama release (contract
OK, real /inference transcription), and by a 13-case suite covering both real
llama bundles plus a synthetic ELF chain that proves the gate fails on an
undeclared lib, passes once declared, and only warns on a stale entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant