From 27835694949fd059cd03eacca99cdfa8170f1165 Mon Sep 17 00:00:00 2001 From: p3lusa Date: Thu, 15 Oct 2026 02:13:30 +0200 Subject: [PATCH] setup: pin -DSTRATA_Q6K_EXPERTS=ON in the CUDA engine build A build folder configured while the option's default was OFF keeps STRATA_Q6K_EXPERTS=OFF in its CMakeCache.txt even after the default flipped to ON (465cd61d): CMake does not rewrite an option already in the cache, and source_hash() fingerprints the source files but not the CMake option values, so setup recompiles the engine with the Q6_K gate/up expert kernels still disabled. A model whose routed experts are Q4_K/Q6_K (Unsloth UD-Q4_K_XL) then fails to load with: strata-q36: blk.34.experts are Q4_K/Q6_K, which the native expert kernels do not take (build with -DSTRATA_Q6K_EXPERTS=ON for Q6_K) Passing -DSTRATA_Q6K_EXPERTS=ON explicitly overrides the stale cache entry, so the engine always has the kernels its default build promises. Same pin in the Dockerfile build for consistency. Not hardware-specific: it is a CMake cache-staleness issue, independent of GPU/platform. --- Dockerfile | 2 +- setup.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1f002e9..7358a352 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,7 +79,7 @@ arch = os.environ.get("CUDA_ARCHITECTURES", "75;80;86;89;120").strip().strip('"' vision = "gpu" if os.environ.get("BUILD_VISION", "1") == "1" else "none" setup.cmake_build(setup.ROOT, setup.ROOT / "build", "strata", - ["-DSTRATA_ENABLE_CUDA=ON", "-DSTRATA_BUILD_TESTS=OFF", + ["-DSTRATA_ENABLE_CUDA=ON", "-DSTRATA_Q6K_EXPERTS=ON", "-DSTRATA_BUILD_TESTS=OFF", f"-DCMAKE_CUDA_ARCHITECTURES={arch}", f"-DCMAKE_CUDA_COMPILER={nvcc}", f"-DSTRATA_GGML_DIR={llama}"], None, "build-strata.bat") if vision != "none": diff --git a/setup.py b/setup.py index 88914464..bb5d3e74 100644 --- a/setup.py +++ b/setup.py @@ -4002,7 +4002,8 @@ def build_engine(gpu, vision, yes, llama, toolkit=None) -> Path: " The engine's source changed: compiling it again (only what changed, a few minutes) ..." if local and (eng / EXE).exists() else " Compiling the Strata engine for your GPU (10-20 minutes, once) ...") cmake_build(ROOT, bdir, "strata", - ["-DSTRATA_ENABLE_CUDA=ON", "-DSTRATA_BUILD_TESTS=OFF", f"-DCMAKE_CUDA_ARCHITECTURES={cuda_archs}", + ["-DSTRATA_ENABLE_CUDA=ON", "-DSTRATA_BUILD_TESTS=OFF", "-DSTRATA_Q6K_EXPERTS=ON", + f"-DCMAKE_CUDA_ARCHITECTURES={cuda_archs}", f"-DCMAKE_CUDA_COMPILER={nvcc}", *toolkit_root_defs(nvcc), f"-DSTRATA_GGML_DIR={llama}", *host_compiler_defs(True), *engine_defs(archs, toolkit), *isa_floor_defs(floor, bdir, meta)],