Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggml : add AVX support based on AVX2 code #1376

Closed
wants to merge 1 commit into from

Conversation

katsu560
Copy link
Contributor

@katsu560 katsu560 commented May 9, 2023

I reopen new PR w/o unused function.
I added AVX support code from AVX2 code and modified AVX2 code

added AVX support code
static inline __m256i bytes_from_bits_32(const uint8_t * x)
static inline __m256i bytes_from_nibbles_32(const uint8_t * rsi)
static inline __m256 sum_i16_pairs_float(const __m128i xh, const __m128i xl)
static inline __m256 mul_sum_i8_pairs_float(const __m256i x, const __m256i y)
static void quantize_row_q4_1(const float * restrict x, void * restrict vy, int k)
static void dequantize_row_q4_0(const void * restrict vx, float * restrict y, int k)
static void dequantize_row_q4_1(const void * restrict vx, float * restrict y, int k)
static void ggml_vec_dot_q4_1_q8_1(const int n, float * restrict s, const void * restrict vx, const void * restrict vy)
static void ggml_vec_dot_q4_2_q8_0(const int n, float * restrict s, const void * restrict vx, const void * restrict vy)
static void ggml_vec_dot_q5_0_q8_0(const int n, float * restrict s, const void * restrict vx, const void * restrict vy)
static void ggml_vec_dot_q5_1_q8_1(const int n, float * restrict s, const void * restrict vx, const void * restrict vy)
static void ggml_vec_dot_q8_0_q8_0(const int n, float * restrict s, const void * restrict vx, const void * restrict vy)

modified AVX2 code
static void quantize_row_q4_1(const float * restrict x, void * restrict vy, int k)
static void dequantize_row_q4_1(const void * restrict vx, float * restrict y, int k)

ggerganov and sw, please confirm this PR.

@ggerganov
Copy link
Owner

Please rebase on latest master and resolve conflicts

@katsu560
Copy link
Contributor Author

Okay, I pushed new PR #1430. Please confirm it.

@katsu560 katsu560 closed this May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants