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
d861ba32
Commit
d861ba32
authored
Jun 28, 2018
by
Pruthvi
Committed by
Robert Kimball
Jun 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added workspace for rnn fprop kernel (#1153)
- fixes segfault issue for GNMT model execution through ngraph-mxnet
parent
aa36865c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
cpu_emitter.cpp
src/ngraph/runtime/cpu/cpu_emitter.cpp
+4
-1
mkldnn_emitter.cpp
src/ngraph/runtime/cpu/mkldnn_emitter.cpp
+12
-8
No files found.
src/ngraph/runtime/cpu/cpu_emitter.cpp
View file @
d861ba32
...
...
@@ -564,6 +564,8 @@ namespace ngraph
<<
out
[
0
].
get_name
()
<<
");
\n
"
;
writer
<<
"cpu::mkldnn_utils::set_memory_ptr(ctx, "
<<
to_string
(
deps
[
6
])
<<
", "
<<
out
[
1
].
get_name
()
<<
");
\n
"
;
writer
<<
"cpu::mkldnn_utils::set_memory_ptr(ctx, "
<<
to_string
(
deps
[
7
])
<<
", ctx->mkldnn_workspaces["
<<
deps
[
8
]
<<
"]);
\n
"
;
writer
<<
"cpu::mkldnn_utils::mkldnn_invoke_primitive(ctx, "
<<
to_string
(
lstm_index
)
<<
");
\n
"
;
...
...
@@ -665,7 +667,8 @@ namespace ngraph
<<
out
[
0
].
get_name
()
<<
");
\n
"
;
writer
<<
"cpu::mkldnn_utils::set_memory_ptr(ctx, "
<<
to_string
(
deps
[
6
])
<<
", "
<<
out
[
1
].
get_name
()
<<
");
\n
"
;
writer
<<
"cpu::mkldnn_utils::set_memory_ptr(ctx, "
<<
to_string
(
deps
[
7
])
<<
", ctx->mkldnn_workspaces["
<<
deps
[
8
]
<<
"]);
\n
"
;
writer
<<
"cpu::mkldnn_utils::mkldnn_invoke_primitive(ctx, "
<<
to_string
(
rnn_index
)
<<
");
\n
"
;
}
...
...
src/ngraph/runtime/cpu/mkldnn_emitter.cpp
View file @
d861ba32
...
...
@@ -837,11 +837,8 @@ size_t MKLDNNEmitter::build_rnn_forward(const mkldnn::memory::desc& src_layer_de
size_t
dst_layer_index
=
build_memory_primitive
(
dst_layer_desc
);
size_t
dst_iter_index
=
build_memory_primitive
(
dst_iter_desc
);
//TODO: figure our the role of workspace
auto
null_memory_
=
mkldnn
::
null_memory
(
mkldnn_utils
::
global_cpu_engine
);
mkldnn
::
rnn_cell
::
desc
rnn_cell
(
mkldnn
::
algorithm
::
vanilla_lstm
);
mkldnn
::
rnn_forward
::
desc
rnn_layer_desc
(
mkldnn
::
prop_kind
::
forward_
inference
,
mkldnn
::
rnn_forward
::
desc
rnn_layer_desc
(
mkldnn
::
prop_kind
::
forward_
training
,
rnn_cell
,
mkldnn
::
rnn_direction
::
unidirectional_left2right
,
src_layer_desc
,
...
...
@@ -853,8 +850,13 @@ size_t MKLDNNEmitter::build_rnn_forward(const mkldnn::memory::desc& src_layer_de
dst_iter_desc
);
auto
rnn_layer_prim_desc
=
mkldnn
::
rnn_forward
::
primitive_desc
(
rnn_layer_desc
,
mkldnn_utils
::
global_cpu_engine
);
size_t
rnn_index
=
insert_primitive
(
new
mkldnn
::
rnn_forward
(
rnn_layer_prim_desc
,
auto
workspace_index
=
build_memory_primitive
(
rnn_layer_prim_desc
.
workspace_primitive_desc
().
desc
());
auto
workspace
=
std
::
unique_ptr
<
MKLDNNWorkspace
>
(
new
MKLDNNWorkspace
(
rnn_layer_prim_desc
.
workspace_primitive_desc
().
get_size
()));
auto
workspace_buf_index
=
insert_workspace
(
workspace
);
size_t
rnn_index
=
insert_primitive
(
new
mkldnn
::
rnn_forward
(
rnn_layer_prim_desc
,
mkldnn
::
primitive
::
at
(
*
m_mkldnn_primitives
[
src_layer_index
]),
mkldnn
::
primitive
::
at
(
*
m_mkldnn_primitives
[
src_iter_index
]),
mkldnn
::
primitive
::
at
(
*
m_mkldnn_primitives
[
weights_layer_index
]),
...
...
@@ -862,14 +864,16 @@ size_t MKLDNNEmitter::build_rnn_forward(const mkldnn::memory::desc& src_layer_de
mkldnn
::
primitive
::
at
(
*
m_mkldnn_primitives
[
bias_index
]),
static_cast
<
mkldnn
::
memory
>
(
*
m_mkldnn_primitives
[
dst_layer_index
]),
static_cast
<
mkldnn
::
memory
>
(
*
m_mkldnn_primitives
[
dst_iter_index
]),
static_cast
<
mkldnn
::
memory
>
(
null_memory_
)));
static_cast
<
mkldnn
::
memory
>
(
*
m_mkldnn_primitives
[
workspace_index
]
)));
m_primitive_deps
[
rnn_index
]
=
{
src_layer_index
,
src_iter_index
,
weights_layer_index
,
weights_iter_index
,
bias_index
,
dst_layer_index
,
dst_iter_index
};
dst_iter_index
,
workspace_index
,
workspace_buf_index
};
return
rnn_index
;
}
...
...
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