!29201 Release python GIL when SyncStream

Merge pull request !29201 from caifubi/r1.6-pynative-sync-gil-lock
This commit is contained in:
i-robot 2022-01-18 06:14:48 +00:00 committed by Gitee
commit 033ae49e14
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 3 deletions

View File

@ -3445,11 +3445,11 @@ void PynativeExecutor::GradNet(const prim::GradOperationPtr &grad, const py::obj
}
void PynativeExecutor::Sync() {
auto ms_context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(ms_context);
ExecuteLazyTask();
mindspore::ScopedLongRunning long_running;
auto ms_context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(ms_context);
if (!ms_context->get_param<bool>(MS_CTX_ENABLE_MINDRT)) {
for (auto &item : kSessionBackends) {
MS_EXCEPTION_IF_NULL(item.second);