compiler: Fix issue #2235#2237
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2237 +/- ##
==========================================
+ Coverage 87.30% 87.31% +0.01%
==========================================
Files 238 238
Lines 46001 46022 +21
Branches 4075 4080 +5
==========================================
+ Hits 40161 40184 +23
+ Misses 5151 5150 -1
+ Partials 689 688 -1 ☔ View full report in Codecov by Sentry. |
| 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.
"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.
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.
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
| 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.
This change seems to be able to unlock this limitation, which is a good thing right?
| # 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.
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
| def zero(self): | ||
| return Interval(self.dim, 0, 0, self.stamp) | ||
|
|
||
| def ceil(self, o): |
There was a problem hiding this comment.
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
| 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.
as per my comment below, probably this should be i.upper ?
| 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.
This comment doesn't sound too clear. I think shorter + tiny example might help?
perhaps this is just me nitpicking...
|
|
||
| # 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.
for v in parts.values():
| "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.
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
| 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.
this implementation doesn't really reflect the method name....
There was a problem hiding this comment.
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.
maybe use sth like "ceil" ?
There was a problem hiding this comment.
To add, should all of these properties be cached? They all build Interval objects, rather than simply returning a private variable
There was a problem hiding this comment.
I do not know, @FabioLuporini , @mloubout ?
There was a problem hiding this comment.
this one in particular isn't a property, it's a method
There was a problem hiding this comment.
So this is resolved I guess
09daaea to
9fcaba7
Compare
9fcaba7 to
16cf29d
Compare
georgebisbas
left a comment
There was a problem hiding this comment.
@FabioLuporini just a gentle reminder for this
| # 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.
question. After this, is it true that intervals[i.dim] == ii ?
There was a problem hiding this comment.
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
georgebisbas
left a comment
There was a problem hiding this comment.
So I know, it may be bit hard to remember where we have been here, but trying to refresh it.
| # 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.
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
| 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.
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... |
1398213 to
fc398b6
Compare
fc398b6 to
d38e59b
Compare
|
From @FabioLuporini
|
|
Also agree with @FabioLuporini that this comment is quite cryptic. I also struggle to understand it |
|
Now in: |
No description provided.