Skip to content

Commit bde79d0

Browse files
chaxu01fukuro
authored andcommitted
ggml-cpu: use runtime SVE width in FWHT (ggml-org#24059)
1 parent 3464f38 commit bde79d0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

ggml/src/ggml-cpu/ops.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8903,7 +8903,12 @@ static void ggml_compute_forward_flash_attn_ext_f16(
89038903
k->type == v->type &&
89048904
neq1 >= Q_TILE_SZ);
89058905
#ifdef GGML_SIMD
8906-
use_tiled &= (DV % GGML_F32_EPR == 0);
8906+
#if defined(__ARM_FEATURE_SVE)
8907+
const int64_t f32_epr = svcntw();
8908+
#else
8909+
const int64_t f32_epr = GGML_F32_EPR;
8910+
#endif
8911+
use_tiled &= (DV % f32_epr == 0);
89078912
#endif
89088913
int current_chunk = ith;
89098914

@@ -11391,7 +11396,11 @@ static void ggml_compute_forward_fwht_f32(const ggml_compute_params * params, gg
1139111396

1139211397
// Scalar passes
1139311398
#if defined(GGML_SIMD)
11399+
#if defined(__ARM_FEATURE_SVE)
11400+
const int step = svcntw();
11401+
#else
1139411402
const int step = GGML_F32_EPR;
11403+
#endif
1139511404
#else
1139611405
const int step = n;
1139711406
#endif

0 commit comments

Comments
 (0)