-
Notifications
You must be signed in to change notification settings - Fork 229
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: Misc compiler tweaks and improvements #2136
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2136 +/- ##
==========================================
- Coverage 87.17% 87.09% -0.09%
==========================================
Files 222 222
Lines 39383 39523 +140
Branches 5121 5127 +6
==========================================
+ Hits 34334 34424 +90
- Misses 4478 4521 +43
- Partials 571 578 +7
|
9a2c468
to
db68f89
Compare
devito/passes/clusters/buffering.py
Outdated
@@ -371,14 +361,14 @@ def __init__(self, function, d, accessv, options, sregistry): | |||
else: | |||
size = async_degree | |||
|
|||
# Replace `d` with a suitable CustomDimension `bd` | |||
# Create `bd` -- a contraction Dimension for `dim` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid bd
?
Cuz we use the same name in blocking?
We would not like to grep bd and get both contexts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, changing to xd
(cd
is taken too...)
# six slots, used to replace a buffered Function accessed at `d-3`, `d` | ||
# and `d + 2`, will have `offset = 3` | ||
p, offset = offset_from_centre(d, indices) | ||
# The buffer is initialized at `d_m(d_M) - offset`. E.g., a buffer with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not say that this is clear
@@ -1094,6 +1097,36 @@ def test_streaming_split_noleak(self): | |||
assert np.all(u.data[0] == u1.data[0]) | |||
assert np.all(u.data[1] == u1.data[1]) | |||
|
|||
@pytest.mark.skip(reason="Unsupported MPI + .dx when streaming backwards") | |||
@pytest.mark.parallel(mode=4) | |||
@switchconfig(safe_math=True) # Or NVC will crash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not try the condition
logic here from my PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it later on once it's merged (haven't reviewed it in its last form yet)
db68f89
to
1227db9
Compare
devito/passes/clusters/buffering.py
Outdated
continue | ||
|
||
dims = b.function.dimensions | ||
lhs = b.indexed[[b.initmap.get(d, Map(d, d)).b for d in dims]] | ||
rhs = b.function[[b.initmap.get(d, Map(d, d)).f for d in dims]] | ||
lhs = b.indexed[dims].subs(dim, b.initidx.b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_subs
more efficient for single sub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
devito/passes/clusters/buffering.py
Outdated
lhs = b.indexed[[b.lastmap.get(d, Map(d, d)).b for d in dims]] | ||
rhs = b.function[[b.lastmap.get(d, Map(d, d)).f for d in dims]] | ||
lhs = b.indexed[dims].subs(b.dim, b.lastidx.b) | ||
rhs = b.function[dims].subs(b.dim, b.lastidx.f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
devito/passes/clusters/buffering.py
Outdated
|
||
@cached_property | ||
def initmap(self): | ||
def initidx(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe first
to match last
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Merged |
Context: essentially all of this is necessary for new features and bug fixes in PRO
I'd like to start getting reviews ASAP because we gonna need to merge this rapidly