Browse Source

[unify runtime]remove HideNopNode after SetKernelInfo

pull/14799/head
lizhenyu 4 years ago
parent
commit
25541f803e
1 changed files with 6 additions and 12 deletions
  1. +6
    -12
      mindspore/ccsrc/runtime/hardware/gpu/gpu_device_context.cc

+ 6
- 12
mindspore/ccsrc/runtime/hardware/gpu/gpu_device_context.cc View File

@@ -179,14 +179,6 @@ void GPUDeviceContext::OptimizeGraphWithoutDeviceInfo(const KernelGraphPtr &grap

// Update Graph Dynamic Shape Attr.
UpdateGraphDynamicShapeAttr(NOT_NULL(graph));

auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
const bool pynative_mode = context_ptr->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode;
// Hide NopOp from execution graph in graph mode
if (!pynative_mode) {
opt::HideNopNode(graph.get());
}
}

void GPUDeviceContext::OptimizeGraphWithDeviceInfo(const KernelGraphPtr &graph) const {
@@ -211,6 +203,9 @@ void GPUDeviceContext::OptimizeGraphWithDeviceInfo(const KernelGraphPtr &graph)
optimizer->AddPassManager(pm);
(void)optimizer->Optimize(graph);
graph->SetExecOrderByDefault();

// Hide NopOp from execution order.
opt::HideNopNode(graph.get());
}

void GPUDeviceContext::FuseOperators(const KernelGraphPtr &graph) const {
@@ -235,11 +230,10 @@ void GPUDeviceContext::FuseOperators(const KernelGraphPtr &graph) const {
graph->SetExecOrderByDefault();

// Graph kernel fusion optimization
if (!context::GraphKernelFlags::GetInstance().IsEnableGraphKernel()) {
return;
if (context::GraphKernelFlags::GetInstance().IsEnableGraphKernel()) {
opt::GraphKernelOptimize(graph);
graph->SetExecOrderByDefault();
}
opt::GraphKernelOptimize(graph);
graph->SetExecOrderByDefault();
}

void GPUDeviceContext::UpdateGraphDynamicShapeAttr(const NotNull<KernelGraphPtr> &graph) const {


Loading…
Cancel
Save