Skip to content

Commit 3132814

Browse files
committed
ggml : move AMX to the CPU backend
ggml-ci
1 parent 3ad5451 commit 3132814

File tree

60 files changed

+476
-761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+476
-761
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Checks: >
1717
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
1818
performance-*,
1919
portability-*,
20+
-portability-simd-intrinsics,
2021
misc-*,
2122
-misc-const-correctness,
2223
-misc-non-private-member-variables-in-classes,
2324
-misc-no-recursion,
25+
-misc-use-anonymous-namespace,
2426
FormatStyle: none

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ endif
254254
# keep standard at C11 and C++11
255255
MK_CPPFLAGS = -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -DGGML_USE_CPU
256256
MK_CFLAGS = -std=c11 -fPIC
257-
MK_CXXFLAGS = -std=c++11 -fPIC
258-
MK_NVCCFLAGS = -std=c++11
257+
MK_CXXFLAGS = -std=c++17 -fPIC
258+
MK_NVCCFLAGS = -std=c++17
259259

260260
ifdef LLAMA_NO_CCACHE
261261
GGML_NO_CCACHE := 1
@@ -575,7 +575,8 @@ endif
575575

576576
ifndef GGML_NO_AMX
577577
MK_CPPFLAGS += -DGGML_USE_AMX
578-
OBJ_GGML_EXT += ggml/src/ggml-amx/ggml-amx.o ggml/src/ggml-amx/mmq.o
578+
MK_CPPFLAGS += -Iggml/src/ggml-cpu
579+
OBJ_GGML_EXT += ggml/src/ggml-cpu/amx/amx.o ggml/src/ggml-cpu/amx/mmq.o
579580
endif
580581

581582
ifdef GGML_RPC

common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ if (LLAMA_CURL)
8888
endif ()
8989

9090
target_include_directories(${TARGET} PUBLIC .)
91-
target_compile_features (${TARGET} PUBLIC cxx_std_11)
91+
target_compile_features (${TARGET} PUBLIC cxx_std_17)
9292
target_link_libraries (${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama Threads::Threads)

common/common.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,17 @@ bool fs_validate_filename(const std::string & filename) {
652652

653653
std::u32string filename_utf32;
654654
try {
655+
#if defined(__clang__)
656+
// disable C++17 deprecation warning for std::codecvt_utf8
657+
# pragma clang diagnostic push
658+
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
659+
#endif
655660
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
661+
662+
#if defined(__clang__)
663+
# pragma clang diagnostic pop
664+
#endif
665+
656666
filename_utf32 = converter.from_bytes(filename);
657667

658668
// If the reverse conversion mismatches, it means overlong UTF-8 sequences were used,

examples/batched-bench/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-batched-bench)
22
add_executable(${TARGET} batched-bench.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)

examples/batched/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-batched)
22
add_executable(${TARGET} batched.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)

examples/convert-llama2c-to-ggml/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-convert-llama2c-to-ggml)
22
add_executable(${TARGET} convert-llama2c-to-ggml.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)

examples/cvector-generator/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-cvector-generator)
22
add_executable(${TARGET} cvector-generator.cpp pca.hpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)

examples/embedding/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(TARGET llama-embedding)
22
add_executable(${TARGET} embedding.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)

examples/eval-callback/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set(TARGET llama-eval-callback)
22
add_executable(${TARGET} eval-callback.cpp)
33
install(TARGETS ${TARGET} RUNTIME)
44
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
5-
target_compile_features(${TARGET} PRIVATE cxx_std_11)
5+
target_compile_features(${TARGET} PRIVATE cxx_std_17)
66

77
set(TEST_TARGET test-eval-callback)
88
add_test(NAME ${TEST_TARGET}

0 commit comments

Comments
 (0)