Add GitHub Actions workflow for compiling CUDA, ROCm, and macOS prebuilts daily and on demand#17
Conversation
…x_by, redist provenance
|
I'm doing a new test run here https://github.com/oobabooga/llama.cpp/actions/runs/26790528456 |
Test has been successful and from my side this looks ready to merge. I wrote the wiring for all the new artifacts these new workflows generate here: unslothai/unsloth#5963 |
|
Nice work!! |
|
Ran the prebuilts on real hardware across the whole fleet. Putting the coverage on record. NVIDIA (CUDA), every one confirmed with real GPU offload plus tool calling:
That is every compute capability from Turing through Blackwell, consumer and data center, running the same bundle. macOS: confirmed on real M2 Pro, M3 Max and M5 Max, plus all GitHub macOS runners (14, 15, 26 on both arm64 and Intel). The arm64 Metal bundle loads on macOS 26 from the 14.0 floor as intended, with correct version when built on this branch. Two things to land:
AMD is unchanged (still sourced from lemonade). |
|
Closing out item 2 (macOS Metal 4) with M5 data. I built two arm64 bundles on the macos-26 SDK and A/B'd them on an M5 Max (Llama-3.1-8B Q4_K_M, best of 3): one at deploy target 14.0 and one at 26.0, which is what actually turns the Metal 4 tensor API on.
Delta is +0.1%, inside run-to-run noise. The tensor API gives no measurable gain for GGUF inference at this llama.cpp version, so a second floor-26 slice is not worth the extra bundle and selection logic. The useful finding is that the M5 Verified on M5 Max, M3 Max, M2 Pro and the macos-14 CI runner: minos 14.0, no compile error, throughput identical to the macos-14-SDK build. |
|
Another real-hardware confirmation, plus a note on the build number. RTX 3090 (sm_86) re-confirmed on a fresh stack, with real GPU offload and tool calling:
The runtime detected libcudart.so.13 and selected the cuda13-portable line, the model loaded onto the card ( Note on |
The arm64 slice was built on the macos-14 runner. On M5/A19 hardware that binary logs 'error compiling source' for the Metal library (it falls back to the standard path and still runs, but the error is alarming). Building on macos-26 (the newest Metal SDK, same runner upstream uses for arm64) compiles cleanly on M5 while the explicit deploy_target=14.0 keeps minos at 14.0, so the bundle still loads on macOS 14+. Verified on M5 Max, M3 Max, M2 Pro and the macos-14 CI runner: minos 14.0, no compile error, identical throughput.
|
Nice work testing this across so much real hardware, that coverage is really reassuring. I've reviewed both PRs (build arm64 macOS on the newer SDK with the deployment target pinned for backward compatibility; guard that cuda12 and cuda13 x64 coverage match so a partial set can't publish) and agree with both. They are now merged. The Doing a final build for testing now. |
|
Windows coverage, on real hardware. Native Windows NVIDIA confirmed on an RTX 5070 Ti (Blackwell, sm_120), Windows 11, driver 591.86 / CUDA 13.1, with real GPU offload and tool calling. Both the pinned Blackwell fallback and the current build offload at full speed:
Windows CUDA is pulled from upstream ggml-org (llama-bin-win-cuda plus the paired cudart zip), the same assets the installer selects, so the unslothai bundles here cover Linux. The Windows CPU fallback (llama-bin-win-cpu) was also confirmed on a GPU-less box, and a GPU-less host correctly auto-selects it. That rounds out platform coverage: Linux (Turing through Blackwell, consumer and data-center), macOS (M2/M3/M5 plus all CI images), and now native Windows including Blackwell, all confirmed with real GPU offload. The only remaining action is the publish side already noted above: republish at latest to restore the cuda12 line and the correct build number. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44e8a37750
ℹ️ 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".
| cmake -S . -B build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DGGML_NATIVE=OFF \ | ||
| -DGGML_BACKEND_DL=ON \ |
There was a problem hiding this comment.
Enable shared libs with backend loading
When the CUDA jobs configure a current llama.cpp checkout, -DGGML_BACKEND_DL=ON is rejected unless BUILD_SHARED_LIBS is also enabled (ggml/src/CMakeLists.txt has a fatal check for this combination). These CUDA configure steps set backend dl but never pass -DBUILD_SHARED_LIBS=ON, so the Linux CUDA matrix will fail during CMake configure before producing any bundles; the Windows CUDA workflow has the same flag combination and needs the same fix.
Useful? React with 👍 / 👎.
| - name: Install CUDA toolkit 13.3 (NVIDIA redist) | ||
| if: matrix.cuda == '13.3' | ||
| run: | | ||
| mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3" |
There was a problem hiding this comment.
Replace Unix mkdir in PowerShell step
In the Windows CUDA 13.3 jobs this step runs under the workflow's default pwsh shell, where mkdir is PowerShell's New-Item alias rather than Unix mkdir, so mkdir -p ... is parsed as a PowerShell parameter and fails before the toolkit is installed. Because the default publish matrix includes the cuda13 Windows profiles, this prevents the full release from being assembled; use New-Item -ItemType Directory -Force -Path ... or a bash/cmd shell here.
Useful? React with 👍 / 👎.
|
Both codex comments are wrong: |
|
Closing the loop on the bundle validation, consolidated in one place. All on real hardware, with generation tok/s shown as the offload proof. Linux CUDA (x86_64): the full Turing-through-Blackwell matrix posted above stays confirmed, re-verified with the corrected detector on B200 (562 tok/s) and on a dual RTX 6000 Ada + RTX 3090 box, real offload with both cards enumerated. Linux CUDA (arm64, Spark / GB10, sm_121): confirmed natively and under WSL2, 145 tok/s, native sm_121 SASS (no PTX-JIT). macOS (arm64 Metal bundle, 14.0 floor):
M3 Max also confirmed. The 14.0 deployment floor loads from macOS 14.5 through 26.x as intended, verified on the M1 at 14.5 (oldest chip, lowest OS) and the M5 at 26.5. Detection note: the confirm scripts now key on device enumeration plus measured generation tok/s. llama.cpp's newer auto-fit flow ("fitting params to device memory") stopped printing the old "offloaded N/N layers to GPU" / "model buffer size" lines, so a log-string check alone under-reports now; the model is on the GPU regardless and the throughput proves it. Windows and AMD exercise the installer's upstream / lemonade selection rather than these bundles, so that coverage is recorded on unslothai/unsloth#5963. |
|
RTX 5090 (Blackwell, sm_120) on the cuda12 portable bundle. The cuda12-portable bundle covers Blackwell. On an RTX 5090 the installer selected app-b9493-linux-x64-cuda12-portable.tar.gz (b9518 ships no cuda12 asset, so the last release that did), whose bundle metadata reads toolkit 12.8 and cuda archs 70;75;80;86;89;90;100;120. It enumerated CUDA0 and ran fully offloaded at 424.9 tok/s on the 1B Q4 test (CUDA 12 runtime via libcudart.so.12, libcuda from the WSL stub).
This also explains the Windows split recorded on unslothai/unsloth#5963: upstream's Windows cuda-12.4 build is toolkit 12.4 (no sm_120), so Windows Blackwell is routed to the b9360 cuda-13.1 pin, while the Linux cuda12 bundle here is toolkit 12.8 and covers sm_120 directly. The b9518 cuda12 gap is why this run used b9493; the republish at latest restores the cuda12 line. |
|
Audited the workflow at the current head against the fleet validation findings. The big items are all in and enforced, not just configured: the macOS matrix builds on macos-26 with deploy_target 14.0 and
The RTX 5090 result recorded on this thread is the concrete payoff of the cuda12 bundle being toolkit 12.8: 424.9 tok/s fully offloaded from app-b9493-linux-x64-cuda12-portable on a card upstream's win-cuda-12.4 build cannot serve. |
|
The two items from the audit note above now have a ready fix in #20, stacked on this branch: the publish guard extended to macOS/ROCm/arm64 presence, and the manifest recording the upstream win-cuda binary digests under their own names (the fork-path Windows hash bug reported on unslothai/unsloth#5963). It is this branch verbatim plus two commits, so it can merge right after this PR does. |
|
Hardware confirmation for the arm64 CUDA profile - tested
Once this publishes to unslothai/llama.cpp releases, the whole DGX Spark / N1X class skips the long source build entirely. |
Publish hardening on top of #17: win-cuda binary hashes in the manifest, full-coverage publish guard
Right now the
app-*-linux-x64-cuda*bundles thatinstall_llama_prebuilt.pydownloads are compiled and uploaded by hand. This replaces that with a GitHub Action that builds and publishes them automatically: CUDA (Linux x64 and arm64, Windows x64), per-gfx-target ROCm (Windows and Linux), and macOS (arm64 and x64). The macOS build is @danielhanchen's from #18 and #19, folded into this pipeline instead of running on its own.The plain CPU and Vulkan bundles (Linux-CPU, Windows-CPU, the Vulkan and CPU-arm64 variants) still come from ggml-org's releases; the action records their checksums but doesn't rebuild them.
How it runs
Daily at 22:13 UTC (the time @danielhanchen's macOS workflow used). It builds the newest ggml-org release that has been public for at least 6 hours. That aging guard (his #19) gives a bad release time to be yanked first; this PR applies it pipeline-wide. The job compiles the 25 bundles (13 CUDA, 10 ROCm, 2 macOS) from that tag and publishes a
b<N>release withllama-prebuilt-manifest.json,llama-prebuilt-sha256.json, and the source tarballs. Already-published tags are skipped.Manually (Actions tab):
tag:latestor a specificb####.only_profile:all, or one CUDA variant for a quick test.min_age_hours: override the 6h window.operating_systems/gfx_target/rocm_version: ROCm knobs.publish:false(default) uploads artifacts only;truepublishes.ccache skips unchanged sources. Publishing is atomic (draft, then flip).
What it produces
cuda{12,13}-{older,newer,portable}), Toolkit 12.8 / 13.3. Jimver has no 13.3, so cuda13 pulls the toolkit from NVIDIA's redist CDN (what ggml-org uses for its own Windows CUDA build); cuda12 uses Jimver.macos-cpurecipe with a pinnedCMAKE_OSX_DEPLOYMENT_TARGET(arm64 14.0, x64 13.3) so the binaries load on macOS < 26. This PR integrates it and fixes two load-gate bugs a real run surfaced: macOS bash 3.2 has nomapfile, andllama-quantize --helpexits 1 by design (so the gate checks output, not exit code).All bundles build from clean ggml-org source at the tag. CUDA bundles ship no CUDA runtime; they use the user's torch runtime, matched via
runtime_line.Next steps
Once merged, the schedule turns on. A matching
unslothai/unslothinstaller PR will follow, teaching it the newlinux-arm64-cuda,windows-cuda,linux-rocm,windows-rocm,macos-arm64, andmacos-x64install kinds.@mmathew23 @danielhanchen @shimmyshimmer