-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add missing store overlap checks #1111
Add missing store overlap checks #1111
Conversation
We should modify |
@magnatelee I assume you only want to catch cases when the rhs and lhs Stores are backed by the exact same (sub-)region? If I'm not mistaken, currently two instances of the same slice expression, e.g. |
Isomorphic slices are all mapped to the same sub-region/partition, so they can be coalesced to the same region requirement. That being said, the Python core has a bug that prevents the coalescing, unrelated to the mapping between slices and partitions. This issue has already been fixed in the internal core, so we should handle all kinds of exact overlapping correctly in this PR. |
if ( | ||
view.base.has_storage | ||
and rhs.base.has_storage | ||
and view.base.storage.same_handle(rhs.base.storage) | ||
): | ||
return |
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.
Alternatively this could be rolled into a Store.maybe_equals()
, and/or move this into DeferredArray.copy()
.
If this bug is still present, i.e. the coalescing is not guaranteed to happen, then we cannot safely apply this optimization at the moment. We must be certain that the RegionRequirements we feed to Legion will not overlap, because Legion will not check this on release mode, and this can lead to silent data corruption, as seen in #1110. I suggest we merge this bugfix for now (as well as the accompanying nv-legate/legate#925 which fixes a related bug on the legate.core side) and tackle this optimization in the future, once the core can provide the coalescing guarantee. I opened #1112 to track this. |
Fixes #1110