-
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: Fix issue #2235 #2237
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2237 +/- ##
=======================================
Coverage 87.28% 87.29%
=======================================
Files 238 238
Lines 45325 45368 +43
Branches 4027 4033 +6
=======================================
+ Hits 39561 39603 +42
Misses 5083 5083
- Partials 681 682 +1 ☔ View full report in Codecov by Sentry. |
devito/ir/clusters/cluster.py
Outdated
@@ -343,6 +343,21 @@ def dspace(self): | |||
intervals = intervals.promote(lambda d: not d.is_Sub) | |||
intervals = intervals.zero(set(intervals.dimensions) - oobs) | |||
|
|||
# Intersect with intervals from buffered dimensions. Unions of | |||
# buffered dimension intervals may result in shrinking time size |
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.
"shrinking" feels odd here, since after all time_M
will get a larger default
by shrinking here probably you mean that perhaps [0,1] becomes [0,0]
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.
The shrinking is introduced line 298, wouldn't it be cleaner to fix it there with slightly more checks
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, not sure, haven't thought about this
part of the exercise, I guess
Also, potentially related, thos tests (and opertor) devito/tests/test_gpu_common.py Line 563 in b6f7308
Should be valid for |
1a5341f
to
b1868d3
Compare
devito/types/dimension.py
Outdated
@@ -340,7 +340,7 @@ def _arg_check(self, args, size, interval): | |||
# Autopadding causes non-integer upper limit | |||
from devito.symbolics import normalize_args | |||
upper = interval.upper.subs(normalize_args(args)) | |||
if args[self.max_name] + upper >= size: | |||
if args[self.max_name] + upper > size: |
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.
This change seems to be able to unlock this limitation, which is a good thing right?
devito/ir/clusters/cluster.py
Outdated
# the higher upper bound available in the involved parts | ||
for f, v in parts.items(): | ||
try: | ||
intervals = intervals.ceil(v[f.time_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.
Any ideas on how to avoid this are welcome
f8900a7
to
1e5101a
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ea38319
to
a0ddb6d
Compare
a0ddb6d
to
01337ef
Compare
devito/ir/support/space.py
Outdated
@@ -259,6 +259,11 @@ def negate(self): | |||
def zero(self): | |||
return Interval(self.dim, 0, 0, self.stamp) | |||
|
|||
def ceil(self, o): |
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 turn the API into ceil(self, v)
where v
is just an integer. It doesn't make much sense to me to "ceil" based on an Interval
devito/ir/clusters/cluster.py
Outdated
for f, v in parts.items(): | ||
for i in v: | ||
if i.dim in oobs: | ||
intervals = intervals.ceil(v[i.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.
as per my comment below, probably this should be i.upper
?
devito/ir/clusters/cluster.py
Outdated
@@ -362,6 +362,13 @@ def dspace(self): | |||
intervals = intervals.promote(lambda d: not d.is_Sub) | |||
intervals = intervals.zero(set(intervals.dimensions) - oobs) | |||
|
|||
# Upper bound of intervals including dimensions classified for |
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.
This comment doesn't sound too clear. I think shorter + tiny example might help?
perhaps this is just me nitpicking...
devito/ir/clusters/cluster.py
Outdated
@@ -362,6 +362,13 @@ def dspace(self): | |||
intervals = intervals.promote(lambda d: not d.is_Sub) | |||
intervals = intervals.zero(set(intervals.dimensions) - oobs) | |||
|
|||
# Upper bound of intervals including dimensions classified for | |||
# shifting should retain the "oobs" upper bound | |||
for f, v in parts.items(): |
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.
for v in parts.values():
examples/userapi/02_apply.ipynb
Outdated
@@ -246,14 +250,14 @@ | |||
"name": "stdout", | |||
"output_type": "stream", | |||
"text": [ | |||
"OOB detected due to time_M=2\n" | |||
"OOB detected due to time_M=3\n" |
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 haven't looked at the example code yet, but is this sane?
IOW -- was there an issue with the prior implementation?
df01a7d
to
2474a68
Compare
@@ -259,6 +259,9 @@ def negate(self): | |||
def zero(self): | |||
return Interval(self.dim, 0, 0, self.stamp) | |||
|
|||
def min_upper(self, v=0): | |||
return Interval(self.dim, self.lower, v, self.stamp) |
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.
this implementation doesn't really reflect the method name....
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.
better?
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.
it looks like a jump in the class API, given that all other methos are more generic, see zero, flip, lift, etc
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 use sth like "ceil" ?
09daaea
to
9fcaba7
Compare
9fcaba7
to
16cf29d
Compare
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.
@FabioLuporini just a gentle reminder for this
devito/ir/clusters/cluster.py
Outdated
# interval reconstruction | ||
if i.dim in oobs and i.dim in f.dimensions: | ||
ii = intervals[i.dim].intersection(v[i.dim]) | ||
intervals = intervals.set_upper(i.dim, ii.upper) |
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.
question. After this, is it true that intervals[i.dim] == ii
?
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.
There are several tests that have different lower bounds that should not be affected.
We only touch the upper bound here!
Such tests are e.g.
TestConditionalDimension::test_sparse_time_function
test_topofusion_w_subdims_conddims
test_fission_for_parallelism
I tried to rebase this, but it failed on a gradient test. WIll check again |
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.
So I know, it may be bit hard to remember where we have been here, but trying to refresh it.
devito/ir/clusters/cluster.py
Outdated
# interval reconstruction | ||
if i.dim in oobs and i.dim in f.dimensions: | ||
ii = intervals[i.dim].intersection(v[i.dim]) | ||
intervals = intervals.set_upper(i.dim, ii.upper) |
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.
There are several tests that have different lower bounds that should not be affected.
We only touch the upper bound here!
Such tests are e.g.
TestConditionalDimension::test_sparse_time_function
test_topofusion_w_subdims_conddims
test_fission_for_parallelism
@@ -259,6 +259,9 @@ def negate(self): | |||
def zero(self): | |||
return Interval(self.dim, 0, 0, self.stamp) | |||
|
|||
def min_upper(self, v=0): | |||
return Interval(self.dim, self.lower, v, self.stamp) |
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 use sth like "ceil" ?
3535de8
to
f5db549
Compare
f5db549
to
53aa1d3
Compare
584757c
to
552c480
Compare
I had honestly forgotten about this, please re-review when available |
I am having a problem rebasing this due to:
where domain should not be relaxed here... |
No description provided.