Improve speed of fsum#828
Open
TylerSagendorf wants to merge 1 commit intofastverse:developmentfrom
Open
Conversation
Author
|
Tested on a Macbook with an M4 Max chip (arm64). The use of multiple accumulators in However, after enabling OpenMP (https://mac.r-project.org/openmp/) by updating the global Makevars to include the flags below, performance decreased by ~20-40% relative to the original |
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.
Description
Utilized multiple accumulators in
fsumto enhance instruction throughput. This led to a 2x performance improvement in certain cases.Closes #824. Similar to #826 and #827.
Main Changes
fsumby using multiple accumulatorsChecklist
Additional Context
I tried to modify the integer-based sums and the grouped sums, but their loop bodies were too complex to benefit from this technique, so I reverted my changes. Similarly, there was no improvement in the speed of the weighted sums when
na.rm = TRUE.Benchmarks were performed on an AMD Ryzen 5 7600X CPU (x86_64).
Only showing iterations/second for comparison purposes: