llama-cpp: fix blasSupport (#298567)

* llama-cpp: fix blasSupport

* llama-cpp: switch from openblas to blas
This commit is contained in:
Christian Kögler 2024-03-25 18:55:45 +01:00 committed by GitHub
parent d7ee3d3c0d
commit 2af438f836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -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