-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix deadlock and simplify proxy tracking #712
Fix deadlock and simplify proxy tracking #712
Conversation
6e9079d
to
11e36c1
Compare
Codecov Report
@@ Coverage Diff @@
## branch-21.10 #712 +/- ##
================================================
- Coverage 87.63% 86.25% -1.39%
================================================
Files 15 15
Lines 1658 1717 +59
================================================
+ Hits 1453 1481 +28
- Misses 205 236 +31
Continue to review full report at Codecov.
|
In order to address ambiguity when serializing using multiple serializers, we disallow proxies of collections such as list or tuples. Instead, users should wrap each collection item in a proxy.
11e36c1
to
531932f
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.
Overall looks good, great work @madsbk . I have only a few minor comments/suggestions.
for dev_buf, proxies in self.get_dev_buffer_to_proxies().items(): | ||
last_access = max(p._obj_pxy.get("last_access", 0) for p in proxies) | ||
size = sizeof(dev_buf) | ||
dev_buf_access.append((last_access, size, proxies)) | ||
total_dev_mem_usage += 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.
I don't know how expensive this is, but would it make sense to update this information when there's a change instead (i.e., when something is added/removed/accessed)? Also not necessarily in this PR, just an idea for the future.
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.
Good point, I will think of that in a future PR
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.
But notice, this is only executed when we actually have to serialize, which is properly going to dominate the performance anyways.
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.
But what if you have to serialize many small objects? Maybe that can become a bottleneck at some point?
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.
Right, that could be a potential problem.
Co-authored-by: Peter Andreas Entschev <[email protected]>
Thanks @pentschev for the review, I think I have addressed all your suggestions. |
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.
LGTM, thanks @madsbk !
@gpucibot merge |
This PR introduce a
ProxyManager
that replaces the current implementation of proxy tracking:Additionally, this PR fixes a rare deadlock by having all proxies and the
ProxyManager
use the same lock. Finally, this PR will make it much easier to implement spilling to disk: #708.Notice, from the user's perspective, this PR shouldn't change anything.