compiler: Improve scalar aliases detection and scheduling#2858
compiler: Improve scalar aliases detection and scheduling#2858
Conversation
19254fd to
6af1a6b
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
6af1a6b to
53151e2
Compare
e2045e5 to
b859dc4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2858 +/- ##
==========================================
+ Coverage 78.96% 79.03% +0.06%
==========================================
Files 248 248
Lines 51089 51210 +121
Branches 4422 4426 +4
==========================================
+ Hits 40342 40473 +131
+ Misses 9938 9926 -12
- Partials 809 811 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7fa5e9a to
8c0a82b
Compare
42387e7 to
1a3141e
Compare
devito/passes/clusters/misc.py
Outdated
|
|
||
| lifted.append(c.rebuild(ispace=ispace, properties=properties, guards=guards)) | ||
| _lifted = c.rebuild(ispace=ispace, properties=properties, guards=guards) | ||
| if guards and clusters[max(n-1, 0)].guards != guards and _lifted.is_scalar: |
There was a problem hiding this comment.
this is very convoluted
There was a problem hiding this comment.
if we don't pull outside of a guard (as I just wrote above) extra checks here might not be required after all
devito/passes/clusters/aliases.py
Outdated
| is_cond = any(isinstance(d, (SubsamplingFactor, ConditionalDimension)) | ||
| for d in pivot.free_symbols) | ||
| if meta.guards and is_cond and nclusters > 1: | ||
| # Scalar alias that depends on a guard, unsafe to lift out of the guard |
There was a problem hiding this comment.
this is the wrong place, they shouldn't have been collected in the first place.
Instead, you can drop this thing and rather add new rule here: https://github.com/devitocodes/devito/blob/main/devito/passes/clusters/aliases.py#L299-L300
1a3141e to
903fdab
Compare
aa86f3b to
cb454c8
Compare
e54b7b0 to
3601883
Compare
3601883 to
eb3b4ea
Compare
Quite a few more changes that I would have liked but this avoid being too drastic. This basically make scalar aliases more reobust