Skip to content

Commit

Permalink
ggml : move sgemm sources to llamafile subfolder (ggerganov#8394)
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov authored Jul 10, 2024
1 parent 0f1a39f commit 6b2a849
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ endif # GGML_BLIS

ifndef GGML_NO_LLAMAFILE
MK_CPPFLAGS += -DGGML_USE_LLAMAFILE
OBJ_GGML += ggml/src/sgemm.o
OBJ_GGML += ggml/src/llamafile/sgemm.o
endif

ifdef GGML_RPC
Expand Down Expand Up @@ -983,9 +983,9 @@ ggml/src/ggml-blas.o: \
$(CXX) $(CXXFLAGS) -c $< -o $@

ifndef GGML_NO_LLAMAFILE
ggml/src/sgemm.o: \
ggml/src/sgemm.cpp \
ggml/src/sgemm.h \
ggml/src/llamafile/sgemm.o: \
ggml/src/llamafile/sgemm.cpp \
ggml/src/llamafile/sgemm.h \
ggml/include/ggml.h
$(CXX) $(CXXFLAGS) -c $< -o $@
endif # GGML_NO_LLAMAFILE
Expand Down
2 changes: 1 addition & 1 deletion ggml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ option(GGML_ACCELERATE "ggml: enable Accelerate framework"
option(GGML_BLAS "ggml: use BLAS" ${GGML_BLAS_DEFAULT})
set(GGML_BLAS_VENDOR ${GGML_BLAS_VENDOR_DEFAULT} CACHE STRING
"ggml: BLAS library vendor")
option(GGML_LLAMAFILE "ggml: use ggml SGEMM" OFF)
option(GGML_LLAMAFILE "ggml: use LLAMAFILE" OFF)

option(GGML_CUDA "ggml: use CUDA" OFF)
option(GGML_CUDA_FORCE_DMMV "ggml: use dmmv instead of mmvq CUDA kernels" OFF)
Expand Down
6 changes: 3 additions & 3 deletions ggml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ if (GGML_BLAS)
endif()

if (GGML_LLAMAFILE)
message(STATUS "Using ggml SGEMM")
message(STATUS "Using llamafile")

add_compile_definitions(GGML_USE_LLAMAFILE)

set(GGML_HEADERS_LLAMAFILE sgemm.h)
set(GGML_SOURCES_LLAMAFILE sgemm.cpp)
set(GGML_HEADERS_LLAMAFILE llamafile/sgemm.h)
set(GGML_SOURCES_LLAMAFILE llamafile/sgemm.cpp)
endif()

if (GGML_CUDA)
Expand Down
3 changes: 1 addition & 2 deletions ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "ggml.h"
#include "ggml-aarch64.h"


#if defined(_MSC_VER) || defined(__MINGW32__)
#include <malloc.h> // using malloc.h with MSC/MINGW
#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
Expand Down Expand Up @@ -43,7 +42,7 @@
#endif

#ifdef GGML_USE_LLAMAFILE
#include "sgemm.h"
#include <llamafile/sgemm.h>
#endif

#if defined(_MSC_VER)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6b2a849

Please sign in to comment.