Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
bbf66498
Commit
bbf66498
authored
Oct 26, 2018
by
shssf
Committed by
Scott Cyphers
Oct 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IntelGPU backend: Add graph dump ability (#1925)
parent
4e08d9aa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
0 deletions
+54
-0
CMakeLists.txt
src/ngraph/runtime/intelgpu/CMakeLists.txt
+1
-0
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+17
-0
intelgpu_backend.hpp
src/ngraph/runtime/intelgpu/intelgpu_backend.hpp
+1
-0
visualize_tree.cpp
src/ngraph/runtime/intelgpu/visualize_tree.cpp
+0
-0
visualize_tree.hpp
src/ngraph/runtime/intelgpu/visualize_tree.hpp
+35
-0
No files found.
src/ngraph/runtime/intelgpu/CMakeLists.txt
View file @
bbf66498
...
@@ -25,6 +25,7 @@ set(SRC
...
@@ -25,6 +25,7 @@ set(SRC
intelgpu_op_softmax.cpp
intelgpu_op_softmax.cpp
intelgpu_op_custom_func_call.cpp
intelgpu_op_custom_func_call.cpp
code_writer.cpp
code_writer.cpp
visualize_tree.cpp
)
)
if
(
NGRAPH_INTELGPU_ENABLE
)
if
(
NGRAPH_INTELGPU_ENABLE
)
...
...
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
bbf66498
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
#include "ngraph/runtime/intelgpu/intelgpu_op_custom_kernels.hpp"
#include "ngraph/runtime/intelgpu/intelgpu_op_custom_kernels.hpp"
#include "ngraph/runtime/intelgpu/intelgpu_op_softmax.hpp"
#include "ngraph/runtime/intelgpu/intelgpu_op_softmax.hpp"
#include "ngraph/runtime/intelgpu/intelgpu_tensor_view.hpp"
#include "ngraph/runtime/intelgpu/intelgpu_tensor_view.hpp"
#include "ngraph/runtime/intelgpu/visualize_tree.hpp"
#include "ngraph/function.hpp"
#include "ngraph/function.hpp"
#include "ngraph/node.hpp"
#include "ngraph/node.hpp"
...
@@ -328,6 +329,12 @@ runtime::intelgpu::IntelGPUBackend::IntelGPUBackend()
...
@@ -328,6 +329,12 @@ runtime::intelgpu::IntelGPUBackend::IntelGPUBackend()
m_disable_backend_optimizations
=
true
;
m_disable_backend_optimizations
=
true
;
}
}
// Dumps the input Function into Graphviz format
if
(
getenv
(
"NGRAPH_INTELGPU_DUMP_FUNCTION"
)
!=
nullptr
)
{
m_dump_graph_enable
=
true
;
}
cldnn
::
engine_configuration
cldnn_configuration
(
profiling
);
cldnn
::
engine_configuration
cldnn_configuration
(
profiling
);
ocl_engine
=
make_shared
<
cldnn
::
engine
>
(
cldnn_configuration
);
ocl_engine
=
make_shared
<
cldnn
::
engine
>
(
cldnn_configuration
);
}
}
...
@@ -356,6 +363,11 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
...
@@ -356,6 +363,11 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
cldnn
::
topology
topology
;
cldnn
::
topology
topology
;
if
(
m_dump_graph_enable
)
{
visualize_tree
(
func
,
"intelgpu_"
,
"_orig"
);
}
if
(
!
m_disable_backend_optimizations
)
if
(
!
m_disable_backend_optimizations
)
{
{
ngraph
::
pass
::
Manager
pass_manager
;
ngraph
::
pass
::
Manager
pass_manager
;
...
@@ -369,6 +381,11 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
...
@@ -369,6 +381,11 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
pass_manager
.
register_pass
<
ngraph
::
pass
::
GetOutputElementElimination
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
GetOutputElementElimination
>
();
pass_manager
.
run_passes
(
func
);
pass_manager
.
run_passes
(
func
);
if
(
m_dump_graph_enable
)
{
visualize_tree
(
func
,
"intelgpu_"
,
"_opt"
);
}
}
}
for
(
shared_ptr
<
Node
>
op
:
func
->
get_ops
())
for
(
shared_ptr
<
Node
>
op
:
func
->
get_ops
())
...
...
src/ngraph/runtime/intelgpu/intelgpu_backend.hpp
View file @
bbf66498
...
@@ -82,5 +82,6 @@ private:
...
@@ -82,5 +82,6 @@ private:
bool
m_profile_enable
=
false
;
bool
m_profile_enable
=
false
;
long
m_profile_lines_limit_count
=
10
;
long
m_profile_lines_limit_count
=
10
;
bool
m_dump_graph_enable
=
false
;
std
::
string
delim
=
std
::
string
(
":"
);
std
::
string
delim
=
std
::
string
(
":"
);
};
};
src/ngraph/runtime/intelgpu/visualize_tree.cpp
0 → 100644
View file @
bbf66498
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/intelgpu/visualize_tree.hpp
0 → 100644
View file @
bbf66498
//*****************************************************************************
// Copyright 2017-2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include "ngraph/function.hpp"
namespace
ngraph
{
namespace
runtime
{
namespace
intelgpu
{
// This function writes the input func into file in Graphviz format.
// On large graphs, the "dot" utility requires lot of time to visualize the input.
// Example: dot -Tpdf intelgpu_Function_0_orig.dot -o intelgpu_Function_0_orig.pdf
void
visualize_tree
(
const
std
::
shared_ptr
<
Function
>&
func
,
const
std
::
string
&
file_prefix
,
const
std
::
string
&
file_suffix
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment