-
Notifications
You must be signed in to change notification settings - Fork 12.2k
ggml: aarch64: implement SVE kernels for q2_k_q8_k vector dot #12064
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
Conversation
ggml/src/ggml-cpu/ggml-cpu-quants.c
Outdated
|
||
svint32_t sumi1 = svdup_n_s32(0); | ||
|
||
for (int j = 0; j < QK_K/256; ++j) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These loops seem redundant - are they needed? Can you simplify by knowing that this will always be a single iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This loop always run for one time. The code is simplified considering the for loop will run for 1 time only. I can remove the loop.
…rg#12064) * Added SVE Support for Q2_K Quantized Models * Use 4-space indentation in the switch cases * removed comments lines * Remove the loop Retain the curly bracess for better understanding of code * Remove the comment like added for q3_k_q8_k kernel --------- Co-authored-by: vithulep <[email protected]>
…rg#12064) * Added SVE Support for Q2_K Quantized Models * Use 4-space indentation in the switch cases * removed comments lines * Remove the loop Retain the curly bracess for better understanding of code * Remove the comment like added for q3_k_q8_k kernel --------- Co-authored-by: vithulep <[email protected]>
…rg#12064) * Added SVE Support for Q2_K Quantized Models * Use 4-space indentation in the switch cases * removed comments lines * Remove the loop Retain the curly bracess for better understanding of code * Remove the comment like added for q3_k_q8_k kernel --------- Co-authored-by: vithulep <[email protected]>
This PR introduces support for SVE (Scalable Vector Extensions) kernels for the q2_K_q8_K vector dot on the Arm architecture. A similar proposal for SVE support is made in PR 7433 and 11227.
This PR contains the SVE implementation of the vector dot used to compute the Q2_K quantization.
By running a Q2_K quantized model of mistral-7b-v01, on Graviton 3E (Perf 21 XL), Accuracy and Performance are measured.
Performance
The performance enhancement with this PR (SVE) is ~ x1.03 to x1.09 faster than the NEON implementation.
The command used to measure the performance is
Perplexity
I have ran perplexity with the NEON(Original) and SVE (This PR) Implementation.
And below is the summary.
This correction does not appear to have any impact on accuracy.