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

Avoid bounds checking where it is safe to do so #74

Merged
merged 10 commits into from
Nov 18, 2024
Merged

Conversation

efaulhaber
Copy link
Member

@efaulhaber efaulhaber commented Nov 8, 2024

This PR and trixi-framework/TrixiParticles.jl#656 yield a ~3% speedup on a Threadripper 3990X and a ~42% speedup on an Nvidia H100. Interestingly, there is no difference on an Nvidia RTX 3090 with FP64 (probably limited by something else), but it benefits even more from inbounds on FP32 with a 60% speedup.

grafik

Not all bounds checks could be safely removed. See #79 for a completely exception-free kernel. The additional speedup is about 2% and can be neglected.

@efaulhaber efaulhaber changed the title Improve performance by using inbounds access wherever it is safe to do so Avoid bounds checking where it is safe to do so Nov 8, 2024
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.15%. Comparing base (a44f7b3) to head (4fd8741).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/neighborhood_search.jl 66.66% 2 Missing ⚠️
src/util.jl 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   88.13%   88.15%   +0.01%     
==========================================
  Files          15       15              
  Lines         489      498       +9     
==========================================
+ Hits          431      439       +8     
- Misses         58       59       +1     
Flag Coverage Δ
unit 88.15% <87.50%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@efaulhaber efaulhaber marked this pull request as ready for review November 12, 2024 17:48
@efaulhaber efaulhaber requested review from LasNikas and svchb November 12, 2024 17:48
@efaulhaber efaulhaber self-assigned this Nov 14, 2024
src/cell_lists/full_grid.jl Show resolved Hide resolved
src/nhs_grid.jl Show resolved Hide resolved
@efaulhaber efaulhaber enabled auto-merge (squash) November 18, 2024 12:10
@efaulhaber efaulhaber merged commit 8630a8b into main Nov 18, 2024
9 of 10 checks passed
@efaulhaber efaulhaber deleted the ef/inbounds2 branch November 18, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants