feat(stablediffusion-ggml): build a ROCm variant - #11774
Open
localai-bot wants to merge 1 commit into
Open
Conversation
The Makefile already had a hipblas branch, but no CI row built it and the gallery's `amd:` mapping stayed commented out. On an AMD host the capability lookup found no `amd` key and fell back to `default`, so these users silently ran the CPU build. Add the hipblas row to the backend matrix and the two gallery entries it publishes, then point `amd:` at them. Drop `-DGGML_HIPBLAS=ON` while here. `SD_HIPBLAS` sets `GGML_HIP` itself, and `GGML_HIPBLAS` is the name ggml used before the rename, so the flag only produced an unused-variable warning. Add gfx1151 to the local target list to match the value the workflows pass in. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude Code:claude-opus-5[1m]
mudler
approved these changes
Aug 29, 2026
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.
Description
stablediffusion-ggmlhad no ROCm build. The Makefile already carried ahipblasbranch, but no row in.github/backend-matrix.ymlbuilt it and the gallery'samd:mapping was commented out.SystemState.Capability()therefore found noamdkey for this backend and fell back todefault, so AMD users silently gotcpu-stablediffusion-ggmlunless they installed the Vulkan variant by hand.This PR:
hipblasrow to the backend matrix (-gpu-rocm-hipblas-stablediffusion-ggml,rocm/dev-ubuntu-24.04:7.2.1,Dockerfile.golang), modelled on the existing whisper ROCm row rather than the llama-cpp one:builder-base-imageonly works withDockerfile.llama-cpp, which has thebuilder-prebuilttarget;rocm-stablediffusion-ggmlandrocm-stablediffusion-ggml-developmentgallery entries with their docker.io mirrors, and pointsamd:at them;-DGGML_HIPBLAS=ONfrom the Makefile. At the pinned sd.cpp commit,SD_HIPBLASalready doesset(GGML_HIP ON)internally;GGML_HIPBLASis the pre-rename ggml name and only produced an unused-variable warning;gfx1151to the Makefile's localAMDGPU_TARGETSdefault so it matches the 11-target list the workflows pass in as a build arg.Notes for Reviewers
Verification run on this branch:
go test ./core/gallery/passes; capability lookup resolvesamd->rocm-stablediffusion-ggmlfor both the release and development metas.FORCE_ALL=true bun run scripts/changed-backends.jspicks the new row up into the single-arch build and merge matrices. Shards land at 78-79 entries, well under the 256-job limit.Not verified: the hipblas compile itself. There is no ROCm toolchain on the machine this was written on, so CI is the first real build.
One thing worth a reviewer's judgement is build time. This backend still compiles four separate CPU variants (avx/avx2/avx512/fallback), each recompiling the full GPU backend. For reference, from recent master runs:
-gpu-rocm-hipblas-llama-cpptakes 126 min and-gpu-nvidia-cuda-13-stablediffusion-ggmltakes 91 min, so this row will probably sit in the 2-3 hour range. That is under the 6-hour job ceiling but makes it the slowest row this backend has. TrimmingAMDGPU_TARGETSfor this backend, or moving it to the single-buildGGML_CPU_ALL_VARIANTSpattern that llama-cpp uses, would both bring it down; I left both out of scope here.No docs change: nothing under
docs/content/enumerates per-vendor backend images, and no API, CLI flag or config key changed. The variant is selected automatically by capability.Signed commits