!13083 [MD] [GPU] fix pynative get data timeout

From: @liyong126
Reviewed-by: 
Signed-off-by:
This commit is contained in:
mindspore-ci-bot 2021-03-12 17:00:21 +08:00 committed by Gitee
commit 0cabffe945
1 changed files with 5 additions and 1 deletions

View File

@ -1490,7 +1490,11 @@ py::object PynativeExecutor::RunOpInMs(const OpExecInfoPtr &op_exec_info, Pynati
op_exec_info->next_input_index};
#endif
VectorRef outputs;
session->RunOp(&op_run_info, graph_info, &input_tensors, &outputs, tensors_mask);
{
// Release GIL before calling into (potentially long-running) C++ code
py::gil_scoped_release release;
session->RunOp(&op_run_info, graph_info, &input_tensors, &outputs, tensors_mask);
}
if (op_exec_info->is_dynamic_shape) {
op_exec_info->abstract = op_run_info.abstract;
}