-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Open gc by default #18836
Open gc by default #18836
Conversation
e9f19a8
to
627e960
Compare
4efff0f
to
3b239df
Compare
3b239df
to
f8e589d
Compare
97bf814
to
10e3d1d
Compare
10e3d1d
to
31a1ba2
Compare
@@ -118,7 +118,7 @@ void GarbageCollector::Add(Container &&objs, Callback &&callback) { | |||
|
|||
GarbageQueue *garbage_queue = nullptr; | |||
{ | |||
std::lock_guard<std::mutex> guard(mutex_); | |||
std::lock_guard<std::mutex> guard(*mutex_); |
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.
Do you mean that if the max_memory_size_
is little 1, there doesn't need a lock?
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.
Exactly.
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
@@ -46,7 +46,7 @@ class GarbageCollector { | |||
|
|||
platform::DeviceContext *dev_ctx_; | |||
std::unique_ptr<GarbageQueue> garbages_; | |||
mutable std::mutex mutex_; | |||
mutable std::unique_ptr<std::mutex> mutex_; |
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.
In fact, this checking is unnecessary.
Enable GC when
PADDLE_ON_INFERENCE
is off.This PR also fixes bug of GC when using conditional_block op.
See CE Debug here.
There are 3 models in CE Debug failed.
I have tried to run CE Debug for the second time. All tasks have passed. Please see here.