@@ -69,7 +69,7 @@ set(LLAMA_SCHED_MAX_COPIES "1" CACHE STRING "llama: max input copies for pipeli
6969option (LLAMA_CUDA_ENABLE_UNIFIED_MEMORY "llama: enable to avoid OOM in Full Offload" OFF )
7070
7171option (GGML_IQK_MUL_MAT "ggml: use optimized iqk matrix multiplications" OFF )
72- option (GGML_USE_LLAMA_CPP_MAINLINE "ggml: use Llama CPP mainline MatMul " ON )
72+ option (GGML_USE_LLAMA_CPP_MAINLINE "ggml: use Llama CPP mainline MatMul " OFF )
7373
7474#
7575# Compile flags
@@ -85,7 +85,7 @@ find_package(Threads REQUIRED)
8585add_compile_definitions (LOG_DISABLE_LOGS)
8686
8787file (GLOB GGML_SOURCES_CUDA "ggml/src/ggml-cuda/*.cu" )
88- list (APPEND GGML_SOURCES_CUDA "ggml/src/ggml-cuda.cu" )
88+ list (APPEND GGML_SOURCES_CUDA "ggml/src/ggml-cuda/ggml-cuda .cu" )
8989file (GLOB SRCS "ggml/src/ggml-cuda/template-instances/fattn-wmma*.cu" )
9090list (APPEND GGML_SOURCES_CUDA ${SRCS} )
9191set (GGML_V3_CUDA_SOURCES otherarch/ggml_v3-cuda.cu otherarch/ggml_v3-cuda.h)
@@ -329,7 +329,7 @@ if (LLAMA_HIPBLAS)
329329 if (${hipblas_FOUND} AND ${hip_FOUND} )
330330 message (STATUS "HIP and hipBLAS found" )
331331 file (GLOB GGML_SOURCES_ROCM "ggml/src/ggml-cuda/*.cu" )
332- list (APPEND GGML_SOURCES_ROCM "ggml/src/ggml-cuda.cu" )
332+ list (APPEND GGML_SOURCES_ROCM "ggml/src/ggml-cuda/ggml-cuda .cu" )
333333 file (GLOB SRCS "ggml/src/ggml-cuda/template-instances/fattn-wmma*.cu" )
334334 list (APPEND GGML_SOURCES_ROCM ${SRCS} )
335335 file (GLOB SRCS "ggml/src/ggml-cuda/template-instances/mmq*.cu" )
@@ -686,65 +686,65 @@ if (GGML_IQK_MUL_MAT)
686686 set_target_properties (ggml PROPERTIES POSITION_INDEPENDENT_CODE ON )
687687 add_compile_definitions (GGML_USE_IQK_MULMAT)
688688elseif (GGML_USE_LLAMA_CPP_MAINLINE)
689- add_library (ggml
690- ggml/src/ggml.c
691- ggml/include /ggml.h
692- ggml/src/ggml-cpu.c
693- ggml/include /ggml-cpu.h
694- ggml/src/ggml-alloc.c
695- ggml/include /ggml-alloc.h
696- ggml/src/ggml-backend.cpp
697- ggml/src/ggml-backend-impl.h
698- ggml/include /ggml-backend.h
699- ggml/include /ggml-cpp.h
700- ggml/src/ggml-quants.c
701- ggml/src/ggml-quants.h
702- ggml/src/llamafile/sgemm.cpp
703- ggml/src/llamafile/sgemm.h
704- ggml/src/ggml-aarch64.c
705- ggml/src/ggml-aarch64.h
706- ${GGML_SOURCES_CUDA} )
707- target_include_directories (ggml PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
708- target_compile_features (ggml PUBLIC c_std_11) # don't bump
709- target_link_libraries (ggml PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
710- set_target_properties (ggml PROPERTIES POSITION_INDEPENDENT_CODE ON )
689+ # add_library(ggml
690+ # ggml/src/ggml.c
691+ # ggml/include/ggml.h
692+ # ggml/src/ggml-cpu.c
693+ # ggml/include/ggml-cpu.h
694+ # ggml/src/ggml-alloc.c
695+ # ggml/include/ggml-alloc.h
696+ # ggml/src/ggml-backend.cpp
697+ # ggml/src/ggml-backend-impl.h
698+ # ggml/include/ggml-backend.h
699+ # ggml/include/ggml-cpp.h
700+ # ggml/src/ggml-quants.c
701+ # ggml/src/ggml-quants.h
702+ # ggml/src/llamafile/sgemm.cpp
703+ # ggml/src/llamafile/sgemm.h
704+ # ggml/src/ggml-aarch64.c
705+ # ggml/src/ggml-aarch64.h
706+ # ${GGML_SOURCES_CUDA})
707+ # target_include_directories(ggml PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
708+ # target_compile_features(ggml PUBLIC c_std_11) # don't bump
709+ # target_link_libraries(ggml PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS})
710+ # set_target_properties(ggml PROPERTIES POSITION_INDEPENDENT_CODE ON)
711711 add_compile_definitions (GGML_USE_LLAMA_CPP_MAINLINE)
712712else ()
713- add_library (ggml
714- ggml/src/ggml.c
715- ggml/include /ggml.h
716- ggml/src/ggml-cpu/ggml-cpu.c
717- ggml/include /ggml-cpu.h
718- ggml/src/ggml-alloc.c
719- ggml/include /ggml-alloc.h
720- ggml/src/ggml-backend.cpp
721- ggml/src/ggml-backend-impl.h
722- ggml/include /ggml-backend.h
723- ggml/include /ggml-cpp.h
724- ggml/src/ggml-quants.c
725- ggml/src/ggml-quants.h
726- ggml/src/ggml-cpu/llamafile/sgemm.cpp
727- ggml/src/ggml-cpu/llamafile/sgemm.h
728- ggml/src/ggml-aarch64.c
729- ggml/src/ggml-aarch64.h
730- ggml/src/ggml-threading.cpp
731- ggml/src/ggml-cpu/ggml-cpu.cpp
732- ggml/src/ggml-cpu/ggml-cpu-aarch64.c
733- ggml/src/ggml-cpu/ggml-cpu-aarch64.h
734- ggml/src/ggml-cpu/ggml-cpu-quants.c
735- ggml/src/ggml-cpu/ggml-cpu-quants.h
736- ggml/src/ggml-backend-reg.cpp
737- ${GGML_SOURCES_CUDA} )
738- target_include_directories (ggml PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
739- target_compile_features (ggml PUBLIC c_std_11) # don't bump
740- target_link_libraries (ggml PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
741- set_target_properties (ggml PROPERTIES POSITION_INDEPENDENT_CODE ON )
713+ add_library (ggml
714+ ggml/src/ggml.c
715+ ggml/include /ggml.h
716+ ggml/src/ggml-cpu/ggml-cpu.c
717+ ggml/include /ggml-cpu.h
718+ ggml/src/ggml-alloc.c
719+ ggml/include /ggml-alloc.h
720+ ggml/src/ggml-backend.cpp
721+ ggml/src/ggml-backend-impl.h
722+ ggml/include /ggml-backend.h
723+ ggml/include /ggml-cpp.h
724+ ggml/src/ggml-quants.c
725+ ggml/src/ggml-quants.h
726+ ggml/src/ggml-cpu/llamafile/sgemm.cpp
727+ ggml/src/ggml-cpu/llamafile/sgemm.h
728+ ggml/src/ggml-aarch64.c
729+ ggml/src/ggml-aarch64.h
730+ ggml/src/ggml-threading.cpp
731+ ggml/src/ggml-cpu/ggml-cpu.cpp
732+ ggml/src/ggml-cpu/ggml-cpu-aarch64.c
733+ ggml/src/ggml-cpu/ggml-cpu-aarch64.h
734+ ggml/src/ggml-cpu/ggml-cpu-quants.c
735+ ggml/src/ggml-cpu/ggml-cpu-quants.h
736+ ggml/src/ggml-backend-reg.cpp
737+ ${GGML_SOURCES_CUDA} )
738+ target_include_directories (ggml PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools)
739+ target_compile_features (ggml PUBLIC c_std_11) # don't bump
740+ target_link_libraries (ggml PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
741+ set_target_properties (ggml PROPERTIES POSITION_INDEPENDENT_CODE ON )
742742endif ()
743743
744744add_library (ggml_v1
745745 otherarch/ggml_v1.c
746746 otherarch/ggml_v1.h)
747- target_include_directories (ggml_v1 PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
747+ target_include_directories (ggml_v1 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools)
748748target_compile_features (ggml_v1 PUBLIC c_std_11) # don't bump
749749target_link_libraries (ggml_v1 PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
750750set_target_properties (ggml_v1 PROPERTIES POSITION_INDEPENDENT_CODE ON )
@@ -754,7 +754,7 @@ add_library(ggml_v2
754754 otherarch/ggml_v2.h
755755 ${GGML_V2_CUDA_SOURCES}
756756 ${GGML_V2_LEGACY_CUDA_SOURCES} )
757- target_include_directories (ggml_v2 PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
757+ target_include_directories (ggml_v2 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools)
758758target_compile_features (ggml_v2 PUBLIC c_std_11) # don't bump
759759target_link_libraries (ggml_v2 PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
760760set_target_properties (ggml_v2 PROPERTIES POSITION_INDEPENDENT_CODE ON )
@@ -763,7 +763,7 @@ add_library(ggml_v3
763763 otherarch/ggml_v3.c
764764 otherarch/ggml_v3.h
765765 ${GGML_V3_CUDA_SOURCES} )
766- target_include_directories (ggml_v3 PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools)
766+ target_include_directories (ggml_v3 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools)
767767target_compile_features (ggml_v3 PUBLIC c_std_11) # don't bump
768768target_link_libraries (ggml_v3 PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS} )
769769set_target_properties (ggml_v3 PROPERTIES POSITION_INDEPENDENT_CODE ON )
@@ -780,36 +780,36 @@ add_library(common2
780780 src/unicode.h
781781 src/unicode.cpp
782782 src/unicode-data.cpp)
783- target_include_directories (common2 PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
783+ target_include_directories (common2 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
784784target_compile_features (common2 PUBLIC cxx_std_11) # don't bump
785785target_link_libraries (common2 PRIVATE ggml ${LLAMA_EXTRA_LIBS} )
786786set_target_properties (common2 PROPERTIES POSITION_INDEPENDENT_CODE ON )
787787
788788add_library (sdtype_adapter
789789 otherarch/sdcpp/sdtype_adapter.cpp)
790- target_include_directories (sdtype_adapter PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
790+ target_include_directories (sdtype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
791791target_compile_features (sdtype_adapter PUBLIC cxx_std_11) # don't bump
792792target_link_libraries (sdtype_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS} )
793793set_target_properties (sdtype_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON )
794794
795795add_library (whisper_adapter
796796 otherarch/whispercpp/whisper_adapter.cpp)
797- target_include_directories (whisper_adapter PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/whispercpp ./examples ./common)
797+ target_include_directories (whisper_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/whispercpp ./examples ./common)
798798target_compile_features (whisper_adapter PUBLIC cxx_std_11) # don't bump
799799target_link_libraries (whisper_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS} )
800800set_target_properties (whisper_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON )
801801
802802add_library (gpttype_adapter
803803 gpttype_adapter.cpp)
804- target_include_directories (gpttype_adapter PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
804+ target_include_directories (gpttype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
805805target_compile_features (gpttype_adapter PUBLIC cxx_std_11) # don't bump
806806target_link_libraries (gpttype_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS} )
807807set_target_properties (gpttype_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON )
808808
809809if (LLAMA_CUBLAS)
810810 set (TARGET koboldcpp_cublas)
811811 add_library (${TARGET} SHARED expose.cpp expose.h)
812- target_include_directories (${TARGET} PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
812+ target_include_directories (${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
813813 target_compile_features (${TARGET} PUBLIC cxx_std_11) # don't bump
814814 set_target_properties (${TARGET} PROPERTIES PREFIX "" )
815815 set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp_cublas" )
@@ -821,7 +821,7 @@ endif()
821821if (LLAMA_HIPBLAS)
822822 set (TARGET koboldcpp_hipblas)
823823 add_library (${TARGET} SHARED expose.cpp expose.h)
824- target_include_directories (${TARGET} PUBLIC . ./ggml/include ./ggml/src ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
824+ target_include_directories (${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./ include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
825825 target_compile_features (${TARGET} PUBLIC cxx_std_11) # don't bump
826826 set_target_properties (${TARGET} PROPERTIES PREFIX "" )
827827 set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp_hipblas" )
0 commit comments