未验证 提交 526be01a 编写于 作者: A Aganlengzi 提交者: GitHub

[CustomDevice]support fast_eager_deletion_mode (#44211)

上级 3ca713ee
...@@ -161,8 +161,14 @@ paddle::framework::GarbageCollector* Tracer::MutableGarbageCollectorIfNotExists( ...@@ -161,8 +161,14 @@ paddle::framework::GarbageCollector* Tracer::MutableGarbageCollectorIfNotExists(
#endif #endif
} else if (platform::is_custom_place(place)) { } else if (platform::is_custom_place(place)) {
#if defined(PADDLE_WITH_CUSTOM_DEVICE) #if defined(PADDLE_WITH_CUSTOM_DEVICE)
gc.reset(new framework::CustomDefaultStreamGarbageCollector(place, 0)); if (framework::IsFastEagerDeletionModeEnabled()) {
VLOG(10) << "Created GarbageCollector at " << place; gc.reset(
new framework::CustomDeviceUnsafeFastGarbageCollector(place, 0));
VLOG(10) << "Created UnsafeFastGarbageCollector at " << place;
} else {
gc.reset(new framework::CustomDefaultStreamGarbageCollector(place, 0));
VLOG(10) << "Created GarbageCollector at " << place;
}
#else #else
PADDLE_THROW(platform::errors::PermissionDenied( PADDLE_THROW(platform::errors::PermissionDenied(
"Paddle can't use CustomDevice since it's not compiled with " "Paddle can't use CustomDevice since it's not compiled with "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册