From 2af438f836f5a6a5b2c240a72fa07140f4ab4fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Mon, 25 Mar 2024 18:55:45 +0100 Subject: [PATCH] llama-cpp: fix blasSupport (#298567) * llama-cpp: fix blasSupport * llama-cpp: switch from openblas to blas --- pkgs/by-name/ll/llama-cpp/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix index 43ff55742ca1..ca2f4d5149d6 100644 --- a/pkgs/by-name/ll/llama-cpp/package.nix +++ b/pkgs/by-name/ll/llama-cpp/package.nix @@ -16,6 +16,8 @@ , clblast , blasSupport ? builtins.all (x: !x) [ cudaSupport metalSupport openclSupport rocmSupport vulkanSupport ] +, blas + , pkg-config , metalSupport ? stdenv.isDarwin && stdenv.isAarch64 && !openclSupport , vulkanSupport ? false @@ -91,9 +93,10 @@ effectiveStdenv.mkDerivation (finalAttrs: { buildInputs = optionals effectiveStdenv.isDarwin darwinBuildInputs ++ optionals cudaSupport cudaBuildInputs - ++ optionals mpiSupport mpi + ++ optionals mpiSupport [ mpi ] ++ optionals openclSupport [ clblast ] ++ optionals rocmSupport rocmBuildInputs + ++ optionals blasSupport [ blas ] ++ optionals vulkanSupport vulkanBuildInputs; cmakeFlags = [ @@ -128,8 +131,7 @@ effectiveStdenv.mkDerivation (finalAttrs: { # Should likely use `rocmPackages.clr.gpuTargets`. "-DAMDGPU_TARGETS=gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102" ] - ++ optionals metalSupport [ (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") ] - ++ optionals blasSupport [ (cmakeFeature "LLAMA_BLAS_VENDOR" "OpenBLAS") ]; + ++ optionals metalSupport [ (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") ]; # upstream plans on adding targets at the cmakelevel, remove those # additional steps after that