Skip to content
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

Improve SoA with static array extents #653

Merged

Conversation

bernhardmgruber
Copy link
Member

@bernhardmgruber bernhardmgruber commented Dec 9, 2022

This PR improves the SoA by precomputing a compile-time only subarray offset table when the array extents are fully static.

This PR also contains an extension of the vectoradd benchmarks:
* Mix data types in record dimension, so padding and alignment can have an effect
* Make problem size an odd number
* Plot results
* Test all LLAMA versions in a single run
* Test a few variations of the SoA layout
* Simplify alpaka use

@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #653 (1ee97e4) into develop (4271b5a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #653   +/-   ##
========================================
  Coverage    98.75%   98.75%           
========================================
  Files           74       74           
  Lines         6818     6828   +10     
========================================
+ Hits          6733     6743   +10     
  Misses          85       85           

@bernhardmgruber bernhardmgruber force-pushed the soastaticoffsets branch 2 times, most recently from d13540a to ae82cba Compare December 12, 2022 18:13
@bernhardmgruber bernhardmgruber changed the title Precompute subarray offset table when array extents are fully static Improve SoA with static array extents Dec 12, 2022
@bernhardmgruber
Copy link
Member Author

image

Runtime difference is marginal:

layout runtime
"SoA SB aligned" 0.113894
"SoA SB aligned CT size" 0.113254

compile time:
image

runtime:

image

@bernhardmgruber
Copy link
Member Author

image

layout runtime
"SoA SB aligned" 0.160085
"SoA SB aligned CT size" 0.160387

Here, the CT variant is actually a bit slower. But the assembly is better (less instructions).

@bernhardmgruber bernhardmgruber force-pushed the soastaticoffsets branch 4 times, most recently from 97902ee to a4b95c1 Compare December 13, 2022 17:54
@bernhardmgruber bernhardmgruber force-pushed the soastaticoffsets branch 2 times, most recently from aa8902d to 88cc497 Compare December 13, 2022 23:22
@bernhardmgruber bernhardmgruber marked this pull request as ready for review December 13, 2022 23:22
@bernhardmgruber bernhardmgruber force-pushed the soastaticoffsets branch 2 times, most recently from c5d0774 to e3c32eb Compare December 14, 2022 11:11
* Mix data types in record dimension, so padding and alignment can have an effect
* Make problem size an odd number
* Plot results
* Test all LLAMA versions in a single run
* Test a few variations of the SoA layout
* Simplify alpaka use
@bernhardmgruber bernhardmgruber merged commit 38ebb45 into alpaka-group:develop Dec 15, 2022
@bernhardmgruber bernhardmgruber deleted the soastaticoffsets branch December 15, 2022 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant