use hwy/simd for RMSNorm(f, bf, f) calculation#78
Merged
copybara-service[bot] merged 2 commits intogoogle:devfrom Mar 10, 2024
Merged
use hwy/simd for RMSNorm(f, bf, f) calculation#78copybara-service[bot] merged 2 commits intogoogle:devfrom
copybara-service[bot] merged 2 commits intogoogle:devfrom
Conversation
jan-wassenberg
requested changes
Mar 5, 2024
Member
jan-wassenberg
left a comment
There was a problem hiding this comment.
Very nice, thanks for implementing! One style suggestion:
ops.h
Outdated
| for (size_t j = 0; j < size; j++) { | ||
| // Note 1.0f centering here | ||
| out[j] = (1.0f + hwy::F32FromBF16(weight[j])) * (ss * x[j]); | ||
| constexpr size_t unroll_size = 2; |
Member
There was a problem hiding this comment.
For constexpr please use kUnrollSize naming :)
Contributor
Author
There was a problem hiding this comment.
I 've set up Clang-Tidy to enforce the kCamelCase style for constexpr variables in the codebase, aiming for automated style checking and corrections.
Maybe in future it can be applied to fix all constexpr styles
jan-wassenberg
approved these changes
Mar 6, 2024
Member
jan-wassenberg
left a comment
There was a problem hiding this comment.
Nice, great that you have updated the lint to check for this :)
Contributor
Author
|
It seems copybara has faced an issue, maybe the rerun can solve it :)) |
Member
|
Yes indeed, still have an issue with copybara transforms. Looking into it :) |
Member
|
Issue resolved 👍 One more internal review, then it will be merged. |
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.
use highway/simd for RMSNorm(f, bf, f) calculation for performance purpose.