Skip to content

release: ship CPU backend variants in the CUDA and HIP bundles (#241) - #271

Merged
khosravipasha merged 1 commit into
prismfrom
fix/241-release-cpu-variants
Sep 25, 2026
Merged

khosravipasha merged 1 commit into
prismfrom
fix/241-release-cpu-variants

Conversation

@bri-prism

Copy link
Copy Markdown
Collaborator

Fixes #241.

Problem

release-prism.yml builds the Windows CUDA x64, Linux CUDA and Windows HIP bundles with GGML_NATIVE=OFF but without GGML_BACKEND_DL / GGML_CPU_ALL_VARIANTS. With native detection off and no explicit ISA flags, ggml turns on AVX/AVX2/FMA/F16C by default. Each of those bundles therefore ships a single AVX2-only CPU backend, and on a CPU without AVX2 the process dies at startup with no message. In #241, even llama-server --version exits silently.

This is confirmed in the shipped prism-b10709-9a9394a artifacts:

bundle CPU backend shipped AVX2/FMA code present
win-cpu-x64 15 variants (ggml-cpu-x64 … -zen4) only in the AVX2+ variants
win-vulkan-x64 9 variants (fixed in #198) only in the AVX2+ variants
win-cuda-13.3-x64 one ggml-cpu.dll yes: 11,734 ymm ops, 458 vfmadd, 91 AVX2-only permutes/broadcasts
win-hip-radeon-x64 one ggml-cpu.dll yes: 1,571 vfmadd, 2,004 AVX2-only ops
linux-cuda-*-x64 one libggml-cpu.so (same config gap)

For comparison, ggml-cpu-x64.dll and ggml-cpu-sse42.dll in the CPU zip contain 0 vfmadd and 0 AVX2-only ops.

Fix

Add -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON to those three jobs, as the CPU and Vulkan bundles already do. The arm64 CUDA leg already used BACKEND_DL with GGML_CPU=OFF and is unchanged.

Verification (local, Windows)

I have no CUDA toolkit on this machine, so I verified the CPU side of the Windows CUDA job's configuration with the same flags and the same shared CMAKE_ARGS, minus GGML_CUDA. MSVC 19.44, -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON, on prism @ 842b18804:

  • All nine MSVC CPU variants build: x64, sse42, sandybridge, haswell, alderlake, skylakex, cannonlake, cascadelake, icelake. They also build with LLAMA_FATAL_WARNINGS=ON (/WX), so the non-AVX2 x86 tiers that broke in ggml-cpu : fix PQ2_0 x86 vec_dot build on non-AVX2 CPU variants #263 are clean under MSVC now. With /WX the only failures are pre-existing and unrelated: src/llama.cpp C4297 and an STL C4244. None of these jobs set fatal warnings.
  • The full bundle builds (474/474), and llama-server --version runs.
  • Runtime variant selection works. A CPU-only llama-server on a Core Ultra X7 358H (AVX2 + AVX-VNNI) maps ggml-cpu-alderlake.dll. A CPU without AVX2 takes the same scoring path down to sse42/x64, as the CPU zip already does for the Misc. bug: not start on Windows with CUDA #241 reporter ("only CPU version … work right").

Not verified here: the CUDA and HIP legs themselves (no toolkit on this box), and the Linux CUDA leg's GCC variant build. A CI run of release-prism.yml on this branch is the real check.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Q6ecxozUXFFFLE3N2SMiR

The Windows CUDA x64, Linux CUDA and Windows HIP release jobs build with
GGML_NATIVE=OFF but without GGML_BACKEND_DL/GGML_CPU_ALL_VARIANTS. With
native detection off and no explicit ISA flags, ggml enables AVX/AVX2/FMA/F16C
by default, so each bundle ships a single AVX2-only ggml-cpu library. On a CPU
without AVX2 the process dies at startup with no message: even
`llama-server --version` exits silently (#241). The CPU and Vulkan bundles
already build every variant and pick one at runtime (Vulkan since #198).

Build those three bundles with GGML_BACKEND_DL=ON and GGML_CPU_ALL_VARIANTS=ON
as well. The arm64 CUDA leg already used BACKEND_DL with GGML_CPU=OFF and is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q6ecxozUXFFFLE3N2SMiR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The functional changes are consistent with existing release jobs; only a minor comment-format issue remains.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds runtime-selected CPU backend variants to CUDA and HIP release bundles, preventing startup failures on non-AVX2 CPUs.

Changes:

  • Enables dynamic CPU backend loading and all CPU variants for Linux CUDA, Windows CUDA x64, and Windows HIP.
  • Preserves the Windows CUDA ARM64 GPU-only behavior.
File Description
.github/​workflows/​release-prism.yml Enables compatible CPU variants in GPU release bundles.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release-prism.yml Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: not start on Windows with CUDA

3 participants