Skip to content

Conversation

s-goto-11
Copy link
Contributor

This PR introduces support for SVE(Scalable Vector Extensions) kernels for the exponential on the Arm architecture.

Verifying Features

This PR contains the SVE implementation of the exponential function used to compute the Activation and Softmax functions.
The values of the NEON and SVE implementations were compared sequentially, and it was confirmed that the values always roughly same.
We also verified that the perplexity matches between the NEON and SVE implementations.

Orginal(NEON) This PR(SVE)
6.6741 +/- 0.04126 6.6732 +/- 0.04125

performance check

Performance was measured with FX700.
Performance is improved as follows. The value is ggml_vec_soft_max_f32's cycles. (ggml_v_expf symbol is striped by optimization.)

batch size Original(NEON) This PR(SVE) Ratio
1 185,895,707 73,095,311 2.54
2 632,556,068 220,198,078 2.87
4 2,150,478,150 716,458,163 3.00
8 8,290,580,604 2,559,182,187 3.24

The command used to measure the performance is

llama-batched --model ${PATH_TO_MODEL} --prompt 'AI is going to' --parallel 8 --predict 128 --seed 0 --threads 12

Add const notation to variable pg
@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Aug 7, 2025
@s-goto-11 s-goto-11 changed the title SVE support for exponential functions ggml : SVE support for exponential functions Aug 13, 2025
@s-goto-11 s-goto-11 changed the title ggml : SVE support for exponential functions ggml: SVE support for exponential functions Aug 13, 2025
@s-goto-11
Copy link
Contributor Author

@ggerganov @slaren
This is my first time PR. what do I need to do to start the approval process? Thanks for your help!

Co-authored-by: Georgi Gerganov <[email protected]>
@s-goto-11 s-goto-11 force-pushed the feature-exp-sve-0806pr branch from 11f6cd7 to dd82a51 Compare August 28, 2025 00:29
@s-goto-11
Copy link
Contributor Author

s-goto-11 commented Aug 28, 2025

@ggerganov @slaren
Thank you for your review.
I accept the modification.

@CISC CISC merged commit 078ce23 into ggml-org:master Sep 1, 2025
48 checks passed
walidbr pushed a commit to walidbr/llama.cpp that referenced this pull request Sep 7, 2025
* SVE support for exponential functions

Add const notation to variable pg

* Update ggml/src/ggml-cpu/vec.cpp

Co-authored-by: Georgi Gerganov <[email protected]>

* Add const

---------

Co-authored-by: Georgi Gerganov <[email protected]>
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants