8000 libfuse3 supported split gguf mounting for in-memory split gguf merging · ggml-org/llama.cpp@a79ad50 · GitHub
[go: up one dir, main page]

Skip to content

Commit a79ad50

Browse files
committed
libfuse3 supported split gguf mounting for in-memory split gguf merging
1 parent 5bbe6a9 commit a79ad50

File tree

2 files changed

+463
-2
lines changed

2 files changed

+463
-2
lines changed

examples/gguf-split/CMakeLists.txt

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(llama-gguf)
3+
4+
# On Linux force non-PIE linking (this flag is applied per target below as well)
5+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
6+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
7+
endif()
8+
9+
find_package(Threads REQUIRED)
10+
find_package(PkgConfig REQUIRED)
11+
pkg_check_modules(FUSE REQUIRED fuse3)
12+
include_directories(${FUSE_INCLUDE_DIRS})
13+
link_directories(${FUSE_LIBRARY_DIRS})
14+
15+
# Original target for gguf-split
116
set(TARGET llama-gguf-split)
217
add_executable(${TARGET} gguf-split.cpp)
318
install(TARGETS ${TARGET} RUNTIME)
4-
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
19+
target_link_options(${TARGET} PRIVATE "-no-pie")
20+
target_link_libraries(${TARGET} PRIVATE
21+
common
22+
llama
23+
${CMAKE_THREAD_LIBS_INIT}
24+
dl
25+
pthread
26+
gcc_s
27+
)
28+
target_compile_features(${TARGET} PRIVATE cxx_std_20)
29+
30+
# FUSE-based merge target
31+
set(MERGE_TARGET llama-gguf-merge)
32+
add_executable(${MERGE_TARGET} gguf-fuse.cpp)
33+
install(TARGETS ${MERGE_TARGET} RUNTIME)
34+
target_include_directories(${MERGE_TARGET} PRIVATE ${FUSE_INCLUDE_DIRS})
35+
target_link_options(${MERGE_TARGET} PRIVATE "-no-pie")
36+
target_link_libraries(${MERGE_TARGET} PRIVATE
37+
common
38+
llama
39+
${CMAKE_THREAD_LIBS_INIT}
40+
dl
41+
pthread
42+
gcc_s
43+
${FUSE_LIBRARIES}
44+
)
45+
target_compile_features(${MERGE_TARGET} PRIVATE cxx_std_20)
46+
47+
# FUSE filesystem target
48+
set(FUSE_TARGET llama-gguf-fuse)
49+
add_executable(${FUSE_TARGET} gguf-fuse.cpp)
50+
install(TARGETS ${FUSE_TARGET} RUNTIME)
51+
target_include_directories(${FUSE_TARGET} PRIVATE ${FUSE_INCLUDE_DIRS})
52+
target_link_options(${FUSE_TARGET} PRIVATE "-no-pie")
53+
target_link_libraries(${FUSE_TARGET} PRIVATE
54+
common
55+
llama
56+
${CMAKE_THREAD_LIBS_INIT}
57+
dl
58+
pthread
59+
gcc_s
60+
${FUSE_LIBRARIES}
61+
)
62+
target_compile_features(${FUSE_TARGET} PRIVATE cxx_std_20)

0 commit comments

Comments
 (0)
0