-
Notifications
You must be signed in to change notification settings - Fork 242
compiler: Fix issue #2235 #2237
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
base: main
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.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. |
devito/ir/clusters/cluster.py
Outdated
| 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
| 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
| 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
| 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
|
|
||
| # 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
| "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
| 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" ?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know, @FabioLuporini , @mloubout ?
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 one in particular isn't a property, it's a method
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 this is resolved I guess
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
| 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... |
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 |
No description provided.