Skip to content

Commit 3571fa5

Browse files
authored
ggml-cpu: use runtime SVE width in FWHT (#24059)
1 parent f8f0a47 commit 3571fa5

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
@@ -8955,7 +8955,12 @@ static void ggml_compute_forward_flash_attn_ext_f16(
89558955
k->type == v->type &&
89568956
neq1 >= Q_TILE_SZ);
89578957
#ifdef GGML_SIMD
8958-
use_tiled &= (DV % GGML_F32_EPR == 0);
8958+
#if defined(__ARM_FEATURE_SVE)
8959+
const int64_t f32_epr = svcntw();
8960+
#else
8961+
const int64_t f32_epr = GGML_F32_EPR;
8962+
#endif
8963+
use_tiled &= (DV % f32_epr == 0);
89598964
#endif
89608965
int current_chunk = ith;
89618966

@@ -11358,7 +11363,11 @@ static void ggml_compute_forward_fwht_f32(const ggml_compute_params * params, gg
1135811363

1135911364
// Scalar passes
1136011365
#if defined(GGML_SIMD)
11366+
#if defined(__ARM_FEATURE_SVE)
11367+
const int step = svcntw();
11368+
#else
1136111369
const int step = GGML_F32_EPR;
11370+
#endif
1136211371
#else
1136311372
const int step = n;
1136411373
#endif

0 commit comments

Comments
 (0)