From 16673d1c981c5f23c74daab6dc0499d13e92bb64 Mon Sep 17 00:00:00 2001 From: mudler <2420543+mudler@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:14:09 +0000 Subject: [PATCH 1/2] :arrow_up: Update antirez/ds4 Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- backend/cpp/ds4/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/cpp/ds4/Makefile b/backend/cpp/ds4/Makefile index b171fa391d76..e3f3de977cd2 100644 --- a/backend/cpp/ds4/Makefile +++ b/backend/cpp/ds4/Makefile @@ -1,10 +1,10 @@ # ds4 backend Makefile. # -# Upstream pin lives below as DS4_VERSION?=8db89fe083ae4d17c9a2428ccd29803d3ae8f577 +# Upstream pin lives below as DS4_VERSION?=110afdd8886586f18fc9b28bc5533152dd10e728 # (.github/bump_deps.sh) can find and update it - matches the # llama-cpp / ik-llama-cpp / turboquant convention. -DS4_VERSION?=8db89fe083ae4d17c9a2428ccd29803d3ae8f577 +DS4_VERSION?=110afdd8886586f18fc9b28bc5533152dd10e728 DS4_REPO?=https://github.com/antirez/ds4 CURRENT_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) From 217b5bf39a6cd17aa6eadc2128202c8eb167710b Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 3 Sep 2026 15:47:34 +0000 Subject: [PATCH 2/2] fix(ds4): link the new upstream image translation unit The ds4 pin bump moves upstream past the commit that split vision preprocessing out of ds4.c into a new ds4_image.c. Upstream added ds4_image.o to CORE_OBJS and CPU_CORE_OBJS for every platform in its own Makefile, but LocalAI keeps a hand-maintained copy of that object list, and it was not updated. Every ds4 backend job then failed at link time with undefined references to ds4_image_decode_file, ds4_image_preprocess_glm53, ds4_deepseek4_image_layout_build, ds4_deepseek4_prefill_chunk and the rest of the image API. ds4.c calls these unconditionally, so the object is required even for a text-only build. Add ds4_image.o to the object list for all three variants LocalAI ships (CUDA/cublas for cuda13 amd64 and l4t arm64, CPU for amd64 and arm64, Metal for darwin arm64) and to the CMake link list that builds grpc-server and ds4-worker. The object list was also duplicated: DS4_OBJ_TARGET held it once, and the ds4/ds4.o recipe repeated it for the Darwin and CPU branches. That second copy is what went stale. Drop it and drive the recipe from DS4_OBJ_TARGET so a future upstream bump only has one place to update. Verified on the CPU variant with the new pin: the pre-fix object list reproduces the exact undefined references, and the fixed list links ds4-worker successfully. Assisted-by: Claude:claude-opus-5 Signed-off-by: Ettore Di Giacinto --- backend/cpp/ds4/CMakeLists.txt | 8 ++++++-- backend/cpp/ds4/Makefile | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/cpp/ds4/CMakeLists.txt b/backend/cpp/ds4/CMakeLists.txt index 0535a8a44708..f8f9d0d3f5d3 100644 --- a/backend/cpp/ds4/CMakeLists.txt +++ b/backend/cpp/ds4/CMakeLists.txt @@ -85,8 +85,12 @@ elseif(DS4_GPU STREQUAL "cpu") endif() # Upstream splits distributed inference, tensor-parallel transport, the SSD -# expert cache, and layer placement into GPU-agnostic translation units. Link -# them regardless of DS4_GPU. +# expert cache, layer placement, and image preprocessing into GPU-agnostic +# translation units. Link them regardless of DS4_GPU. ds4_image.o holds the +# vision preprocessing and DeepSeek4/GLM5.3 image layout helpers that ds4.c +# calls unconditionally, so leaving it out breaks the link even for text-only +# use. Keep this list in sync with DS4_OBJ_TARGET in the Makefile. +list(APPEND DS4_OBJS "${DS4_DIR}/ds4_image.o") list(APPEND DS4_OBJS "${DS4_DIR}/ds4_distributed.o") list(APPEND DS4_OBJS "${DS4_DIR}/ds4_tp.o") list(APPEND DS4_OBJS "${DS4_DIR}/ds4_ssd.o") diff --git a/backend/cpp/ds4/Makefile b/backend/cpp/ds4/Makefile index e3f3de977cd2..1ae692c9186d 100644 --- a/backend/cpp/ds4/Makefile +++ b/backend/cpp/ds4/Makefile @@ -19,20 +19,23 @@ UNAME_S := $(shell uname -s) CMAKE_ARGS ?= -DCMAKE_BUILD_TYPE=Release # Upstream splits distributed inference, tensor-parallel transport, the SSD -# expert cache, and layer placement into GPU-agnostic translation units. They -# are shared by every GPU mode, so append them unconditionally below. +# expert cache, layer placement, and image preprocessing into GPU-agnostic +# translation units. They are shared by every GPU mode, so append them +# unconditionally below. ds4_image.o carries the vision preprocessing and the +# DeepSeek4/GLM5.3 image layout helpers that ds4.c calls, so it must be linked +# even when no image is ever passed to the engine. ifeq ($(BUILD_TYPE),cublas) CMAKE_ARGS += -DDS4_GPU=cuda - DS4_OBJ_TARGET := ds4.o ds4_cuda.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o \ + DS4_OBJ_TARGET := ds4.o ds4_image.o ds4_cuda.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o \ cuda/mmq/ds4_ggml_stubs.o cuda/mmq/ds4_mmq.o cuda/mmq/ds4_mmq_d2r.o \ cuda/mmq/quantize.o cuda/mmq/mmid.o cuda/mmq/mmvq.o cuda/mmq/ds4_repack.o else ifeq ($(UNAME_S),Darwin) CMAKE_ARGS += -DDS4_GPU=metal - DS4_OBJ_TARGET := ds4.o ds4_metal.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o + DS4_OBJ_TARGET := ds4.o ds4_image.o ds4_metal.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o else # CPU reference path (Linux only - macOS CPU path is broken by VM bug per ds4 README). CMAKE_ARGS += -DDS4_GPU=cpu - DS4_OBJ_TARGET := ds4_cpu.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o + DS4_OBJ_TARGET := ds4_cpu.o ds4_image.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o endif ifneq ($(NATIVE),true) @@ -55,14 +58,10 @@ ds4: # Build ds4's engine object files via its own Makefile, which already encodes # the right per-platform compile flags (Objective-C/Metal on Darwin, nvcc on Linux+CUDA). +# DS4_OBJ_TARGET is the single source of truth for the per-variant object list; +# a second hand-kept copy here is what silently went stale on an upstream bump. ds4/ds4.o: ds4 -ifeq ($(BUILD_TYPE),cublas) +$(MAKE) -C ds4 $(DS4_OBJ_TARGET) -else ifeq ($(UNAME_S),Darwin) - +$(MAKE) -C ds4 ds4.o ds4_metal.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o -else - +$(MAKE) -C ds4 ds4_cpu.o ds4_distributed.o ds4_tp.o ds4_ssd.o ds4_layer_pack.o -endif grpc-server: ds4/ds4.o mkdir -p $(BUILD_DIR)