Skip to content

feat(stablediffusion-ggml): build a ROCm variant - #11774

Open
localai-bot wants to merge 1 commit into
masterfrom
feat/rocm-stablediffusion-ggml
Open

feat(stablediffusion-ggml): build a ROCm variant#11774
localai-bot wants to merge 1 commit into
masterfrom
feat/rocm-stablediffusion-ggml

Conversation

@localai-bot

Copy link
Copy Markdown
Collaborator

Description

stablediffusion-ggml had no ROCm build. The Makefile already carried a hipblas branch, but no row in .github/backend-matrix.yml built it and the gallery's amd: mapping was commented out. SystemState.Capability() therefore found no amd key for this backend and fell back to default, so AMD users silently got cpu-stablediffusion-ggml unless they installed the Vulkan variant by hand.

This PR:

  • adds the hipblas row 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-image only works with Dockerfile.llama-cpp, which has the builder-prebuilt target;
  • adds the rocm-stablediffusion-ggml and rocm-stablediffusion-ggml-development gallery entries with their docker.io mirrors, and points amd: at them;
  • drops -DGGML_HIPBLAS=ON from the Makefile. At the pinned sd.cpp commit, SD_HIPBLAS already does set(GGML_HIP ON) internally; GGML_HIPBLAS is the pre-rename ggml name and only produced an unused-variable warning;
  • adds gfx1151 to the Makefile's local AMDGPU_TARGETS default 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 resolves amd -> rocm-stablediffusion-ggml for both the release and development metas.
  • FORCE_ALL=true bun run scripts/changed-backends.js picks 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-cpp takes 126 min and -gpu-nvidia-cuda-13-stablediffusion-ggml takes 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. Trimming AMDGPU_TARGETS for this backend, or moving it to the single-build GGML_CPU_ALL_VARIANTS pattern 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

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

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]
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.

2 participants