Skip to content

Commit fd114fe

Browse files
committed
ggml-cpu: Split ARM backend scores
This allows for ranking backends when they otherwise support the same features.
1 parent 0ef8583 commit fd114fe

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ggml/src/ggml-cpu/arch/arm/cpu-feats.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,33 @@ static int ggml_backend_cpu_aarch64_score() {
6161
int score = 1;
6262
aarch64_features af;
6363

64+
// Bits 2-8 are used to rank backends by architecture or core when they
65+
// otherwise have identical features.
66+
67+
// Bits 9+: Features always trump architecture or core.
6468
#ifdef GGML_USE_DOTPROD
6569
if (!af.has_dotprod) { return 0; }
66-
score += 1<<1;
70+
score += 1<<8;
6771
#endif
6872
#ifdef GGML_USE_FP16_VECTOR_ARITHMETIC
6973
if (!af.has_fp16_va) { return 0; }
70-
score += 1<<2;
74+
score += 1<<9;
7175
#endif
7276
#ifdef GGML_USE_SVE
7377
if (!af.has_sve) { return 0; }
74-
score += 1<<3;
78+
score += 1<<10;
7579
#endif
7680
#ifdef GGML_USE_MATMUL_INT8
7781
if (!af.has_i8mm) { return 0; }
78-
score += 1<<4;
82+
score += 1<<11;
7983
#endif
8084
#ifdef GGML_USE_SVE2
8185
if (!af.has_sve2) { return 0; }
82-
score += 1<<5;
86+
score += 1<<12;
8387
#endif
8488
#ifdef GGML_USE_SME
8589
if (!af.has_sme) { return 0; }
86-
score += 1<<6;
90+
score += 1<<13;
8791
#endif
8892

8993
return score;

0 commit comments

Comments
 (0)