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

compiler: prevent reduction clause for perfect-enough outer loops #2226

Merged
merged 6 commits into from
Oct 10, 2023

Conversation

mloubout
Copy link
Contributor

@mloubout mloubout commented Oct 6, 2023

Fixes #2224 . Added MFE as tests to CPU and GPU

This is not a full generalized fix, the dependency analysis still needs some work to detect some patterns than can be optimized such as [noatomic, atomic, noatomic] that should be lowered to parallel, nothing, simd]

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #2226 (daf671c) into master (4e220c3) will decrease coverage by 0.03%.
The diff coverage is 78.87%.

@@            Coverage Diff             @@
##           master    #2226      +/-   ##
==========================================
- Coverage   87.06%   87.04%   -0.03%     
==========================================
  Files         228      228              
  Lines       40859    40919      +60     
  Branches     7482     7490       +8     
==========================================
+ Hits        35573    35616      +43     
- Misses       4676     4692      +16     
- Partials      610      611       +1     
Files Coverage Δ
devito/passes/iet/langbase.py 78.72% <ø> (-0.23%) ⬇️
devito/passes/iet/parpragma.py 88.68% <100.00%> (+0.61%) ⬆️
tests/test_adjoint.py 100.00% <100.00%> (ø)
tests/test_dle.py 95.92% <100.00%> (-0.15%) ⬇️
tests/test_gpu_common.py 1.42% <0.00%> (-0.03%) ⬇️

@mloubout mloubout force-pushed the reduction-atimic branch 4 times, most recently from 9b8ecc8 to d628f54 Compare October 6, 2023 18:20
@@ -318,6 +318,16 @@ def _make_reductions(self, partree):
if not any(i.is_ParallelAtomic for i in partree.collapsed):
return partree

# We bypass the corner case where a reduction might not be optimal, mainly:
# - Only the most inner loop is atomic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innermost

@mloubout mloubout merged commit b575db3 into master Oct 10, 2023
32 checks passed
@mloubout mloubout deleted the reduction-atimic branch October 10, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nvc issue with Inc
3 participants