Skip to content

Commit 6d78e0f

Browse files
committed
add cpuid check for avx-vnni
1 parent b14b9bf commit 6d78e0f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ggml/src/ggml-backend-reg.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ static ggml_backend_reg_t ggml_backend_load_best(const char * name, bool silent)
505505
}
506506

507507
void ggml_backend_load_all() {
508-
ggml_backend_load_best("amx", true);
509508
ggml_backend_load_best("blas", true);
510509
ggml_backend_load_best("cann", true);
511510
ggml_backend_load_best("cuda", true);

ggml/src/ggml-cpu/cpu-feats-x86.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ struct cpuid_x86 {
7676
bool AVX512_VNNI(void) { return f_7_ecx[11]; }
7777
bool AVX512_FP16(void) { return f_7_edx[23]; }
7878
bool AVX512_BF16(void) { return f_7_1_eax[5]; }
79+
bool AVX_VNNI(void) { return f_7_1_eax[4]; }
7980

8081
bool AMX_TILE(void) { return f_7_edx[24]; }
8182
bool AMX_INT8(void) { return f_7_edx[25]; }
@@ -265,6 +266,7 @@ static int ggml_backend_cpu_x86_score() {
265266
if (ggml_cpu_has_ssse3() && !is.SSSE3()) { return 0; }
266267
if (ggml_cpu_has_sse3() && !is.SSE3()) { return 0; }
267268
if (ggml_cpu_has_avx() && !is.AVX()) { return 0; }
269+
if (ggml_cpu_has_avx_vnni() && !is.AVX_VNNI()) { return 0; }
268270
if (ggml_cpu_has_avx2() && !is.AVX2()) { return 0; }
269271
if (ggml_cpu_has_avx512() && !is.AVX512F()) { return 0; }
270272
if (ggml_cpu_has_avx512_vbmi() && !is.AVX512_VBMI()) { return 0; }
@@ -279,8 +281,8 @@ static int ggml_backend_cpu_x86_score() {
279281
score += ggml_cpu_has_f16c () * 1<<1;
280282
score += ggml_cpu_has_ssse3 () * 1<<2;
281283
score += ggml_cpu_has_sse3 () * 1<<3;
282-
// score += ggml_cpu_has_avx_vnni () * 1<<4; // not used
283284
score += ggml_cpu_has_avx () * 1<<5;
285+
score += ggml_cpu_has_avx_vnni () * 1<<4;
284286
score += ggml_cpu_has_avx2 () * 1<<6;
285287
score += ggml_cpu_has_avx512 () * 1<<7;
286288
// score += ggml_cpu_has_avx512_vbmi() * 1<<8; // not used

0 commit comments

Comments
 (0)