From 0ad5357ce7fe1b5e75e930546d7e2a3c9f3eecc5 Mon Sep 17 00:00:00 2001 From: kswang Date: Tue, 1 Dec 2020 10:09:48 +0800 Subject: [PATCH] add longrunning for runop --- mindspore/ccsrc/backend/session/executor.cc | 1 + mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mindspore/ccsrc/backend/session/executor.cc b/mindspore/ccsrc/backend/session/executor.cc index 570a9dced4..641afc1406 100644 --- a/mindspore/ccsrc/backend/session/executor.cc +++ b/mindspore/ccsrc/backend/session/executor.cc @@ -357,6 +357,7 @@ void Executor::RunOp(const SessionPtr &session, OpRunInfo *op_run_info, const Gr tensor->Wait(); } } + mindspore::ScopedLongRunning long_running; SyncRunTask(task); *outputs = task->outputs_; } diff --git a/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc index f3634f298c..1e741e0196 100644 --- a/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc @@ -16,7 +16,6 @@ #include "runtime/device/gpu/gpu_kernel_runtime.h" #include #include -#include "pybind11/pybind11.h" #include "runtime/device/gpu/gpu_device_address.h" #include "runtime/device/gpu/cuda_driver.h" #include "runtime/device/gpu/gpu_buffer_mgr.h" @@ -45,7 +44,6 @@ namespace mindspore { namespace device { namespace gpu { -namespace py = pybind11; using mindspore::device::memswap::MemSwapInfoSet; using mindspore::device::memswap::MemSwapManager; using mindspore::device::memswap::SwapKind; @@ -362,7 +360,6 @@ bool GPUKernelRuntime::Run(session::KernelGraph *graph, bool is_task_sink) { ret = RunOneStep(graph); } else { - py::gil_scoped_release gil_release; ret = LaunchKernel(graph); } (void)gettimeofday(&end_time, nullptr);