Skip to content

Commit 2eda81c

Browse files
committed
Remove Xbox-Investigate on a few vectorized routines that were deemed slow (not anymore)
1 parent f649f86 commit 2eda81c

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

ggml.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,6 @@ inline static void ggml_vec_mad_f32_unroll(const int n, const int xs, const int
27942794
#endif
27952795
}
27962796

2797-
#ifdef XBOX_INVESTIGATE // slower than original version
27982797
void ggml_vec_scale_f32(const int64_t n, float * y, const float v) {
27992798
#ifdef GGML_SIMD
28002799
int64_t i = 0;
@@ -2842,40 +2841,6 @@ void ggml_vec_scale_f32(const int64_t n, float * y, const float v) {
28422841
#endif
28432842
}
28442843

2845-
#else // XBOX_INVESTIGATE
2846-
2847-
inline static void ggml_vec_scale_f32(const int n, float * y, const float v) {
2848-
#if defined(GGML_USE_ACCELERATE)
2849-
vDSP_vsmul(y, 1, &v, y, 1, n);
2850-
#elif defined(GGML_SIMD)
2851-
const int np = (n & ~(GGML_F32_STEP - 1));
2852-
2853-
GGML_F32_VEC vx = GGML_F32_VEC_SET1(v);
2854-
2855-
GGML_F32_VEC ay[GGML_F32_ARR];
2856-
2857-
for (int i = 0; i < np; i += GGML_F32_STEP) {
2858-
for (int j = 0; j < GGML_F32_ARR; j++) {
2859-
ay[j] = GGML_F32_VEC_LOAD(y + i + j*GGML_F32_EPR);
2860-
ay[j] = GGML_F32_VEC_MUL(ay[j], vx);
2861-
2862-
GGML_F32_VEC_STORE(y + i + j*GGML_F32_EPR, ay[j]);
2863-
}
2864-
}
2865-
2866-
// leftovers
2867-
for (int i = np; i < n; ++i) {
2868-
y[i] *= v;
2869-
}
2870-
#else
2871-
// scalar
2872-
for (int i = 0; i < n; ++i) {
2873-
y[i] *= v;
2874-
}
2875-
#endif
2876-
}
2877-
#endif // XBOX_INVESTIGATE
2878-
28792844
inline static void ggml_vec_scale_f16(const int n, ggml_fp16_t * y, const float v) {
28802845
#if defined(GGML_SIMD)
28812846
const int np = (n & ~(GGML_F16_STEP - 1));
@@ -3059,8 +3024,6 @@ inline static void ggml_vec_sum_f16_ggf(const int n, float * s, const ggml_fp16_
30593024
*s = sum;
30603025
}
30613026

3062-
#ifdef XBOX_INVESTIGATE // slower than original version
3063-
30643027
void ggml_vec_max_f32(const int64_t n, float * s, const float * x) {
30653028
float max = -INFINITY;
30663029
#ifdef GGML_SIMD
@@ -3114,21 +3077,6 @@ void ggml_vec_max_f32(const int64_t n, float * s, const float * x) {
31143077
*s = max;
31153078
}
31163079

3117-
#else // XBOX_INVESTIGATE
3118-
3119-
inline static void ggml_vec_max_f32(const int n, float * s, const float * x) {
3120-
#ifndef GGML_USE_ACCELERATE
3121-
float max = -INFINITY;
3122-
for (int i = 0; i < n; ++i) {
3123-
max = MAX(max, x[i]);
3124-
}
3125-
*s = max;
3126-
#else
3127-
vDSP_maxv(x, 1, s, n);
3128-
#endif
3129-
}
3130-
#endif // XBOX_INVESTIGATE
3131-
31323080
inline static void ggml_vec_norm_inv_f32(const int n, float * s, const float * x) {
31333081
ggml_vec_norm_f32(n, s, x);
31343082
*s = 1.f/(*s);

0 commit comments

Comments
 (0)