Skip to content

Commit 0aaa7a1

Browse files
committed
fix(ds4): link new ds4_ssd translation unit after upstream bump
The antirez/ds4 bump to c463029c split the SSD expert-cache into its own ds4_ssd.c translation unit (mirroring the earlier ds4_distributed.c split). ds4.c/ds4_cpu.o now reference ds4_ssd_memory_lock_acquire/release, ds4_ssd_cache_experts_for_byte_budget and ds4_ssd_auto_cache_plan, which live in ds4_ssd.o. Without linking it the ds4-worker (and grpc-server) targets fail at link time with undefined references, breaking the cpu-ds4 and cublas backend builds. Build ds4_ssd.o via upstream's Makefile and append it to DS4_OBJS for every GPU mode (it is GPU-agnostic, like ds4_distributed.o). Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code]
1 parent 7400f11 commit 0aaa7a1

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

backend/cpp/ds4/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ elseif(DS4_GPU STREQUAL "cpu")
6060
set(DS4_OBJS "${DS4_DIR}/ds4_cpu.o")
6161
endif()
6262

63-
# ds4.c now references ds4_distributed.c (distributed inference was split into
64-
# its own translation unit upstream). It is a single GPU-agnostic object shared
65-
# by every GPU mode, so link it in regardless of DS4_GPU.
63+
# ds4.c now references ds4_distributed.c (distributed inference) and ds4_ssd.c
64+
# (SSD expert-cache), both split into their own translation units upstream. They
65+
# are single GPU-agnostic objects shared by every GPU mode, so link them in
66+
# regardless of DS4_GPU.
6667
list(APPEND DS4_OBJS "${DS4_DIR}/ds4_distributed.o")
68+
list(APPEND DS4_OBJS "${DS4_DIR}/ds4_ssd.o")
6769

6870
add_executable(${TARGET}
6971
grpc-server.cpp

backend/cpp/ds4/Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@ UNAME_S := $(shell uname -s)
1818

1919
CMAKE_ARGS ?= -DCMAKE_BUILD_TYPE=Release
2020

21-
# ds4_distributed.o is a GPU-agnostic translation unit that ds4.c/ds4_cpu.o now
22-
# reference (upstream split distributed inference into its own .c). The same
23-
# object is shared by every GPU mode, so it is appended unconditionally below.
21+
# ds4_distributed.o and ds4_ssd.o are GPU-agnostic translation units that
22+
# ds4.c/ds4_cpu.o now reference (upstream split distributed inference and the
23+
# SSD expert-cache into their own .c files). The same objects are shared by
24+
# every GPU mode, so they are appended unconditionally below.
2425
ifeq ($(BUILD_TYPE),cublas)
2526
CMAKE_ARGS += -DDS4_GPU=cuda
26-
DS4_OBJ_TARGET := ds4.o ds4_cuda.o ds4_distributed.o
27+
DS4_OBJ_TARGET := ds4.o ds4_cuda.o ds4_distributed.o ds4_ssd.o
2728
else ifeq ($(UNAME_S),Darwin)
2829
CMAKE_ARGS += -DDS4_GPU=metal
29-
DS4_OBJ_TARGET := ds4.o ds4_metal.o ds4_distributed.o
30+
DS4_OBJ_TARGET := ds4.o ds4_metal.o ds4_distributed.o ds4_ssd.o
3031
else
3132
# CPU reference path (Linux only - macOS CPU path is broken by VM bug per ds4 README).
3233
CMAKE_ARGS += -DDS4_GPU=cpu
33-
DS4_OBJ_TARGET := ds4_cpu.o ds4_distributed.o
34+
DS4_OBJ_TARGET := ds4_cpu.o ds4_distributed.o ds4_ssd.o
3435
endif
3536

3637
ifneq ($(NATIVE),true)
@@ -55,11 +56,11 @@ ds4:
5556
# the right per-platform compile flags (Objective-C/Metal on Darwin, nvcc on Linux+CUDA).
5657
ds4/ds4.o: ds4
5758
ifeq ($(BUILD_TYPE),cublas)
58-
+$(MAKE) -C ds4 ds4.o ds4_cuda.o ds4_distributed.o
59+
+$(MAKE) -C ds4 ds4.o ds4_cuda.o ds4_distributed.o ds4_ssd.o
5960
else ifeq ($(UNAME_S),Darwin)
60-
+$(MAKE) -C ds4 ds4.o ds4_metal.o ds4_distributed.o
61+
+$(MAKE) -C ds4 ds4.o ds4_metal.o ds4_distributed.o ds4_ssd.o
6162
else
62-
+$(MAKE) -C ds4 ds4_cpu.o ds4_distributed.o
63+
+$(MAKE) -C ds4 ds4_cpu.o ds4_distributed.o ds4_ssd.o
6364
endif
6465

6566
grpc-server: ds4/ds4.o

0 commit comments

Comments
 (0)