Skip to content

Commit d9965b7

Browse files
l0caldadminlocalai-botmudler
authored
Upstream (#3)
* fix(gpu-libs): bundle hipBLASLt TensileLibrary data so ROCm backends stop falling back (mudler#10660) (mudler#10672) the The ROCm packager copied rocBLAS kernel data (rocblas/library/*.dat) into the bundled lib/ dir and run.sh pointed ROCBLAS_TENSILE_LIBPATH at it, but the parallel hipBLASLt data dir (hipblaslt/library/TensileLibrary_lazy_gfx*.dat) was never packaged and no HIPBLASLT_TENSILE_LIBPATH was set. The bundled libhipblaslt.so therefore resolved its per-arch kernel data relative to itself, found nothing, and silently fell back to slow generic kernels, logging: rocblaslt error: Cannot read "TensileLibrary_lazy_gfx1201.dat": No such file or directory rocblaslt error: Could not load "TensileLibrary_lazy_gfx1201.dat" Fix, mirroring the existing rocBLAS handling: - package-gpu-libs.sh: extract the rocblas data-dir copy into a reusable copy_rocm_data_dir helper and call it for both rocblas and hipblaslt. - llama-cpp/turboquant run.sh: export HIPBLASLT_TENSILE_LIBPATH when the bundled hipblaslt/library dir exists. The helper takes an optional ROCM_BASE_DIRS override so the copy is unit testable without a real ROCm install; add a regression test that runs package_rocm_libs against a fabricated ROCm tree and asserts both data dirs are bundled. Note: this bundles whatever gfx*.dat the build image's ROCm provides. If a given arch's tensile data is absent from the shipped ROCm, that arch still needs a ROCm bump; the packaging gap itself is fixed for every supported arch. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> * chore: ⬆️ Update ggml-org/llama.cpp to `d4cff114c0084f1fbc9b4c62717eca8fb2ae494a` (mudler#10671) :arrow_up: Update ggml-org/llama.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> * chore: :arrow_up: Update CrispStrobe/CrispASR to `f35185b876fc482fcb2053a81a2697936ed5fcc0` (mudler#10670) :arrow_up: Update CrispStrobe/CrispASR Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> * fix(backends): enable ROCm/HIP GPU offload for ggml audio backends (mudler#10666) (mudler#10667) qwen3-tts-cpp, omnivoice-cpp, acestep-cpp and vibevoice-cpp shipped rocm-* variants that silently ran on CPU ([Load] backend: CPU). Two coupled defects: - The Makefiles passed -DGGML_HIPBLAS=ON, but the vendored ggml only understands -DGGML_HIP=ON (GGML_HIPBLAS was removed upstream), so the ggml-hip backend target was never created and no GPU code was built. - The CMake foreach that links the ggml GPU backends into the module listed blas/cuda/metal/vulkan but not hip, so even a built ggml-hip would not have been linked and its static backend registration would never run. CUDA users were unaffected because cublas passes the correct GGML_CUDA=ON and the foreach already links cuda. Mirror the proven llama-cpp hipblas block (ROCm clang CC/CXX + AMDGPU_TARGETS) and add hip to each foreach. Upstream picks the best device via ggml_backend_init_best(), so no runtime flag is needed once HIP is compiled and linked. Assisted-by: Claude:claude-opus-4-8[1m] [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: LocalAI [bot] <139863280+localai-bot@users.noreply.github.com> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
1 parent d787b84 commit d9965b7

14 files changed

Lines changed: 160 additions & 29 deletions

File tree

backend/cpp/llama-cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
LLAMA_VERSION?=fdb1db877c526ec90f668eca1b858da5dba85560
2+
LLAMA_VERSION?=d4cff114c0084f1fbc9b4c62717eca8fb2ae494a
33
LLAMA_REPO?=https://github.com/ggerganov/llama.cpp
44

55
CMAKE_ARGS?=

backend/cpp/llama-cpp/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ else
3636
if [ -d "$CURDIR/lib/rocblas/library" ]; then
3737
export ROCBLAS_TENSILE_LIBPATH="$CURDIR"/lib/rocblas/library
3838
fi
39+
# Same for hipBLASLt (rocblaslt): the bundled libhipblaslt.so resolves its
40+
# TensileLibrary_lazy_gfx*.dat kernel data relative to itself, so point it at
41+
# the bundled data or it falls back to slow generic kernels (issue #10660).
42+
if [ -d "$CURDIR/lib/hipblaslt/library" ]; then
43+
export HIPBLASLT_TENSILE_LIBPATH="$CURDIR"/lib/hipblaslt/library
44+
fi
3945
fi
4046

4147
# If there is a lib/ld.so, use it

backend/cpp/turboquant/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ else
3434
if [ -d "$CURDIR/lib/rocblas/library" ]; then
3535
export ROCBLAS_TENSILE_LIBPATH="$CURDIR"/lib/rocblas/library
3636
fi
37+
# Same for hipBLASLt (rocblaslt): the bundled libhipblaslt.so resolves its
38+
# TensileLibrary_lazy_gfx*.dat kernel data relative to itself, so point it at
39+
# the bundled data or it falls back to slow generic kernels (issue #10660).
40+
if [ -d "$CURDIR/lib/hipblaslt/library" ]; then
41+
export HIPBLASLT_TENSILE_LIBPATH="$CURDIR"/lib/hipblaslt/library
42+
fi
3743
fi
3844

3945
# If there is a lib/ld.so, use it

backend/go/acestep-cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target_include_directories(goacestepcpp PRIVATE ${ACESTEP_DIR}/src ${ACESTEP_DIR
2525
target_include_directories(goacestepcpp SYSTEM PRIVATE ${ACESTEP_DIR}/ggml/include)
2626

2727
# Link GPU backends if available (mirrors link_ggml_backends macro)
28-
foreach(backend blas cuda metal vulkan)
28+
foreach(backend blas cuda hip metal vulkan)
2929
if(TARGET ggml-${backend})
3030
target_link_libraries(goacestepcpp PRIVATE ggml-${backend})
3131
string(TOUPPER ${backend} BACKEND_UPPER)

backend/go/acestep-cpp/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ else ifeq ($(BUILD_TYPE),openblas)
2424
else ifeq ($(BUILD_TYPE),clblas)
2525
CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
2626
else ifeq ($(BUILD_TYPE),hipblas)
27-
CMAKE_ARGS+=-DGGML_HIPBLAS=ON
27+
# This ggml only understands GGML_HIP (GGML_HIPBLAS was removed upstream),
28+
# so passing GGML_HIPBLAS silently produced a CPU-only build (see #10666).
29+
ROCM_HOME ?= /opt/rocm
30+
ROCM_PATH ?= /opt/rocm
31+
export CXX=$(ROCM_HOME)/llvm/bin/clang++
32+
export CC=$(ROCM_HOME)/llvm/bin/clang
33+
AMDGPU_TARGETS ?= gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201
34+
CMAKE_ARGS+=-DGGML_HIP=ON -DAMDGPU_TARGETS=$(AMDGPU_TARGETS)
2835
else ifeq ($(BUILD_TYPE),vulkan)
2936
CMAKE_ARGS+=-DGGML_VULKAN=ON
3037
else ifeq ($(OS),Darwin)

backend/go/crispasr/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1)
88

99
# CrispASR version (release tag)
1010
CRISPASR_REPO?=https://github.com/CrispStrobe/CrispASR
11-
CRISPASR_VERSION?=9a26976a8c8cf5af0afcdd04463cf8ba91e96a54
11+
CRISPASR_VERSION?=f35185b876fc482fcb2053a81a2697936ed5fcc0
1212
SO_TARGET?=libgocrispasr.so
1313

1414
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF

backend/go/omnivoice-cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target_include_directories(gomnivoicecpp PRIVATE ${OMNIVOICE_DIR}/src)
3030
target_include_directories(gomnivoicecpp SYSTEM PRIVATE ${OMNIVOICE_DIR}/ggml/include)
3131

3232
# Link GPU backends if the upstream ggml created them.
33-
foreach(backend blas cuda metal vulkan sycl)
33+
foreach(backend blas cuda hip metal vulkan sycl)
3434
if(TARGET ggml-${backend})
3535
target_link_libraries(gomnivoicecpp PRIVATE ggml-${backend})
3636
if(backend STREQUAL "cuda")

backend/go/omnivoice-cpp/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ else ifeq ($(BUILD_TYPE),openblas)
2424
else ifeq ($(BUILD_TYPE),clblas)
2525
CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
2626
else ifeq ($(BUILD_TYPE),hipblas)
27-
CMAKE_ARGS+=-DGGML_HIPBLAS=ON
27+
# This ggml only understands GGML_HIP (GGML_HIPBLAS was removed upstream),
28+
# so passing GGML_HIPBLAS silently produced a CPU-only build (see #10666).
29+
ROCM_HOME ?= /opt/rocm
30+
ROCM_PATH ?= /opt/rocm
31+
export CXX=$(ROCM_HOME)/llvm/bin/clang++
32+
export CC=$(ROCM_HOME)/llvm/bin/clang
33+
AMDGPU_TARGETS ?= gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201
34+
CMAKE_ARGS+=-DGGML_HIP=ON -DAMDGPU_TARGETS=$(AMDGPU_TARGETS)
2835
else ifeq ($(BUILD_TYPE),vulkan)
2936
CMAKE_ARGS+=-DGGML_VULKAN=ON
3037
else ifeq ($(OS),Darwin)

backend/go/qwen3-tts-cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target_include_directories(goqwen3ttscpp PRIVATE ${QWENTTS_DIR}/src)
3030
target_include_directories(goqwen3ttscpp SYSTEM PRIVATE ${QWENTTS_DIR}/ggml/include)
3131

3232
# Link GPU backends if the upstream ggml created them.
33-
foreach(backend blas cuda metal vulkan sycl)
33+
foreach(backend blas cuda hip metal vulkan sycl)
3434
if(TARGET ggml-${backend})
3535
target_link_libraries(goqwen3ttscpp PRIVATE ggml-${backend})
3636
if(backend STREQUAL "cuda")

backend/go/qwen3-tts-cpp/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ else ifeq ($(BUILD_TYPE),openblas)
2424
else ifeq ($(BUILD_TYPE),clblas)
2525
CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
2626
else ifeq ($(BUILD_TYPE),hipblas)
27-
CMAKE_ARGS+=-DGGML_HIPBLAS=ON
27+
# This ggml only understands GGML_HIP (GGML_HIPBLAS was removed upstream),
28+
# so passing GGML_HIPBLAS silently produced a CPU-only build (see #10666).
29+
ROCM_HOME ?= /opt/rocm
30+
ROCM_PATH ?= /opt/rocm
31+
export CXX=$(ROCM_HOME)/llvm/bin/clang++
32+
export CC=$(ROCM_HOME)/llvm/bin/clang
33+
AMDGPU_TARGETS ?= gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201
34+
CMAKE_ARGS+=-DGGML_HIP=ON -DAMDGPU_TARGETS=$(AMDGPU_TARGETS)
2835
else ifeq ($(BUILD_TYPE),vulkan)
2936
CMAKE_ARGS+=-DGGML_VULKAN=ON
3037
else ifeq ($(OS),Darwin)

0 commit comments

Comments
 (0)