-
Notifications
You must be signed in to change notification settings - Fork 559
Overlap XLA tensor sync with future XLA tensor work. #478
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
Conversation
ddbe09e to
1f761a6
Compare
|
|
||
| class DeviceLocker { | ||
| public: | ||
| explicit DeviceLocker(Device device) : device_(std::move(device)) {} |
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 doesn't look like device_ is used, why store it?
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 is handy to drop in debug statements on loc/unlock paths.
| cv_.notify_one(); | ||
| } | ||
|
|
||
| void Barrier() { |
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.
Since this is supposed to be per device, it's not much of a barrier. It's much more similar to a monitor / condition variable, I'd call it Wait() instead.
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 is a barrier. Every async operation in flight before the barrier, must complete in order for the operations after the barrier to commence.
third_party/xla_client/cache.h
Outdated
| Equaler>; | ||
|
|
||
| void MaybeLRU(typename ElementList::iterator it) { | ||
| if (it != element_list_.begin()) { |
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.
What is the harm in doing this unconditionally? I wouldn't expect a measurable performance hit from doing it unconditionally, plus you can then drop the Maybe. To be fair, you could drop the Maybe anyway, since it's already LRU on the no-op path.
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.
SG. Renamed DoLRU().
Prepare XRT session so that they do not fall into the dreaded one-more-node-in-graph TF case. Reserve XRT sessions just for allocations (sending data to device).
1f761a6 to
8fb92c8
Compare
No description provided.