Skip to content

Commit f5d61a4

Browse files
committed
ggml-cpu : minor rvv adjustments
1 parent 15c9bca commit f5d61a4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

ggml/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ option(GGML_LSX "ggml: enable lsx" ON)
131131
option(GGML_RVV "ggml: enable rvv" ON)
132132
option(GGML_RV_ZFH "ggml: enable riscv zfh" ON)
133133
option(GGML_RV_ZVFH "ggml: enable riscv zvfh" ON)
134+
option(GGML_RV_ZICBOP "ggml: enable riscv zicbop" ON)
134135
option(GGML_XTHEADVECTOR "ggml: enable xtheadvector" OFF)
135136
option(GGML_VXE "ggml: enable vxe" ON)
136137
option(GGML_NNPA "ggml: enable nnpa" OFF) # temp disabled by default, see: https://github.com/ggml-org/llama.cpp/issues/14877

ggml/src/ggml-cpu/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,13 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
441441
string(APPEND MARCH_STR "_xtheadvector")
442442
elseif (GGML_RVV)
443443
string(APPEND MARCH_STR "_v")
444-
if (GGML_ZVFH)
444+
if (GGML_RV_ZVFH)
445445
string(APPEND MARCH_STR "_zvfh")
446446
endif()
447447
endif()
448+
if (GGML_RV_ZICBOP)
449+
string(APPEND MARCH_STR "_zicbop")
450+
endif()
448451
list(APPEND ARCH_FLAGS "-march=${MARCH_STR}" -mabi=lp64d)
449452
elseif (GGML_SYSTEM_ARCH STREQUAL "s390x")
450453
message(STATUS "s390x detected")

ggml/src/ggml-cpu/arch/riscv/quants.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,8 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
17691769
case 128:
17701770
for (int i = 0; i < nb; ++i) {
17711771

1772+
__builtin_prefetch(&x[i + 1].d, 0, 1);
1773+
17721774
const float d = GGML_CPU_FP16_TO_FP32(x[i].d) * y[i].d;
17731775

17741776
const uint8_t * restrict q6 = x[i].ql;

0 commit comments

Comments
 (0)