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
ff2bdbaf
Commit
ff2bdbaf
authored
Oct 17, 2018
by
amy.zhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify debug messages.
parent
2d0871f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+14
-10
cpu_memory_optimization.cpp
src/ngraph/runtime/cpu/pass/cpu_memory_optimization.cpp
+9
-9
No files found.
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
ff2bdbaf
...
@@ -1156,8 +1156,20 @@ void runtime::cpu::CPU_ExternalFunction::process_in_place_concat(
...
@@ -1156,8 +1156,20 @@ void runtime::cpu::CPU_ExternalFunction::process_in_place_concat(
auto
in_place_oi_pairs
=
op_annotations
->
get_in_place_oi_pairs
();
auto
in_place_oi_pairs
=
op_annotations
->
get_in_place_oi_pairs
();
if
(
in_place_oi_pairs
.
size
()
>
0
)
if
(
in_place_oi_pairs
.
size
()
>
0
)
{
{
bool
found_last_concat
=
true
;
auto
output_tensor
=
&
concat
->
get_output_tensor
();
auto
offset
=
output_tensor
->
get_pool_offset
();
for
(
auto
arg
:
concat
->
get_arguments
())
{
auto
input_node
=
std
::
dynamic_pointer_cast
<
ngraph
::
op
::
Op
>
(
arg
);
auto
input_tensor
=
&
input_node
->
get_output_tensor
();
auto
old_offset
=
input_tensor
->
get_pool_offset
();
input_tensor
->
set_pool_offset
(
offset
);
NGRAPH_DEBUG
<<
"cpu_external_function: change offset, old offset is "
<<
old_offset
<<
", new offset is "
<<
offset
<<
std
::
endl
;
offset
+=
input_tensor
->
size
();
}
bool
found_last_concat
=
true
;
for
(
auto
user
:
concat
->
get_users
())
for
(
auto
user
:
concat
->
get_users
())
{
{
if
(
dynamic_pointer_cast
<
ngraph
::
op
::
Concat
>
(
user
))
if
(
dynamic_pointer_cast
<
ngraph
::
op
::
Concat
>
(
user
))
...
@@ -1166,19 +1178,11 @@ void runtime::cpu::CPU_ExternalFunction::process_in_place_concat(
...
@@ -1166,19 +1178,11 @@ void runtime::cpu::CPU_ExternalFunction::process_in_place_concat(
break
;
break
;
}
}
}
}
if
(
found_last_concat
)
if
(
found_last_concat
)
{
{
auto
output_tensor
=
&
concat
->
get_output_tensor
();
auto
offset
=
output_tensor
->
get_pool_offset
();
for
(
auto
arg
:
concat
->
get_arguments
())
for
(
auto
arg
:
concat
->
get_arguments
())
{
{
auto
input_node
=
std
::
dynamic_pointer_cast
<
ngraph
::
op
::
Op
>
(
arg
);
auto
input_tensor
=
&
input_node
->
get_output_tensor
();
auto
old_offset
=
input_tensor
->
get_pool_offset
();
input_tensor
->
set_pool_offset
(
offset
);
NGRAPH_DEBUG
<<
"cpu_external_function: change offset, old offset is "
<<
old_offset
<<
", new offset is "
<<
offset
<<
std
::
endl
;
offset
+=
input_tensor
->
size
();
if
(
auto
arg_concat
=
dynamic_pointer_cast
<
ngraph
::
op
::
Concat
>
(
arg
))
if
(
auto
arg_concat
=
dynamic_pointer_cast
<
ngraph
::
op
::
Concat
>
(
arg
))
{
{
NGRAPH_DEBUG
NGRAPH_DEBUG
...
...
src/ngraph/runtime/cpu/pass/cpu_memory_optimization.cpp
View file @
ff2bdbaf
...
@@ -74,7 +74,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -74,7 +74,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
}
}
if
(
product
!=
1
)
if
(
product
!=
1
)
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: The product of Concat's shape "
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: The product of Concat's shape "
"before concat axis is not 1, no in place concat"
;
"before concat axis is not 1, no in place concat"
;
continue
;
continue
;
}
}
...
@@ -97,7 +97,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -97,7 +97,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
if
(
mkldnn_utils
::
is_mkldnn_padded_layout
(
input_md
,
axis_list
))
if
(
mkldnn_utils
::
is_mkldnn_padded_layout
(
input_md
,
axis_list
))
{
{
NGRAPH_DEBUG
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: padded input layout, no in place concat"
;
<<
"cpu_
memory_optimization
: padded input layout, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
}
}
...
@@ -107,7 +107,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -107,7 +107,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
if
(
std
::
dynamic_pointer_cast
<
op
::
Constant
>
(
arg
)
||
if
(
std
::
dynamic_pointer_cast
<
op
::
Constant
>
(
arg
)
||
std
::
dynamic_pointer_cast
<
op
::
Parameter
>
(
arg
))
std
::
dynamic_pointer_cast
<
op
::
Parameter
>
(
arg
))
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: "
<<
arg
->
get_name
()
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: "
<<
arg
->
get_name
()
<<
": constant or parameter, no in place concat"
;
<<
": constant or parameter, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
...
@@ -115,7 +115,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -115,7 +115,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
if
(
arg
->
get_output_size
()
!=
1
)
if
(
arg
->
get_output_size
()
!=
1
)
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: "
<<
arg
->
get_name
()
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: "
<<
arg
->
get_name
()
<<
": multiple outputs, no in place concat"
;
<<
": multiple outputs, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
...
@@ -129,8 +129,8 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -129,8 +129,8 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
if
(
annotation
&&
annotation
->
get_in_place_oi_pairs
().
size
()
>
0
)
if
(
annotation
&&
annotation
->
get_in_place_oi_pairs
().
size
()
>
0
)
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: "
<<
arg
->
get_name
()
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: "
<<
arg
->
get_name
()
<<
": in place non
concat op, no in place concat"
;
<<
": in place non
-
concat op, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
}
}
...
@@ -149,7 +149,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -149,7 +149,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
concat_count
++
;
concat_count
++
;
if
(
concat_count
==
2
)
if
(
concat_count
==
2
)
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: multiple "
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: multiple "
"concat users, no in place concat"
;
"concat users, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
...
@@ -171,7 +171,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -171,7 +171,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
{
{
for
(
auto
oi_pair
:
op_annotations
->
get_in_place_oi_pairs
())
for
(
auto
oi_pair
:
op_annotations
->
get_in_place_oi_pairs
())
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: "
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: "
"in place oi, no in place concat"
;
"in place oi, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
...
@@ -187,7 +187,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
...
@@ -187,7 +187,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
}
}
else
if
(
!
is_post_dominated
(
arg
.
get
(),
n
.
get
()))
else
if
(
!
is_post_dominated
(
arg
.
get
(),
n
.
get
()))
{
{
NGRAPH_DEBUG
<<
"cpu_
post_layout_assignment
: "
NGRAPH_DEBUG
<<
"cpu_
memory_optimization
: "
"not post dominated, no in place concat"
;
"not post dominated, no in place concat"
;
in_place_concat
=
false
;
in_place_concat
=
false
;
break
;
break
;
...
...
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