Enable POWER9 fp32 and fp16 SIMD code#366
Closed
fitzsim wants to merge 3 commits intoggml-org:masterfrom
Closed
Conversation
ggerganov
reviewed
Jan 3, 2023
Comment on lines
+544
to
+553
| #define GGML_F32x4_REDUCE(sumf, sum) \ | ||
| sum[0] = vec_add(sum[0], sum[1]); \ | ||
| sum[2] = vec_add(sum[2], sum[3]); \ | ||
| sum[4] = vec_add(sum[4], sum[5]); \ | ||
| sum[6] = vec_add(sum[6], sum[7]); \ | ||
| sum[0] = vec_add(sum[0], sum[2]); \ | ||
| sum[4] = vec_add(sum[4], sum[6]); \ | ||
| sum[0] = vec_add(sum[0], sum[4]); \ | ||
| sumf = vec_extract(sum[0], 0) + vec_extract(sum[0], 1) \ | ||
| + vec_extract(sum[0], 2) + vec_extract(sum[0], 3); |
Member
There was a problem hiding this comment.
Is there a reason to use this version instead of the for-based version?
The advantage of the latter is that it will work for GGML_F32_ARR == 1, 2, 4, 8, 16, while doing it like this it will only work for GGML_F32_ARR == 8
Contributor
Author
|
I'll try reverting that and compare speed. Also, I think I can get rid of the load/store argument changes, but it'll take some more work. And the F32 implementation seems to still use some F16 operations, so I'll investigate that. I'll make a new pull request for all this later. For now I'll close this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the FP32 base model and this patch set, the jfk example takes about 3.2 seconds to transcribe. This is another data point for #300, and it is about one second faster than the current FP16 SIMD code.