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
64c7a437
Commit
64c7a437
authored
May 27, 2019
by
arogowie-intel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'arogowiec/fused_lstm_cell' into arogowiec/fused_rnn_gru_cells
parents
5cd708c2
75c0b4cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
lstm.cpp
src/ngraph/frontend/onnx_import/op/lstm.cpp
+11
-13
gpu_compiled_function.cpp
src/ngraph/runtime/gpu/gpu_compiled_function.cpp
+2
-0
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+2
-0
No files found.
src/ngraph/frontend/onnx_import/op/lstm.cpp
View file @
64c7a437
...
@@ -241,14 +241,14 @@ namespace ngraph
...
@@ -241,14 +241,14 @@ namespace ngraph
const
LSTMAttributes
&
attributes
)
const
LSTMAttributes
&
attributes
)
:
m_X
{
X
}
:
m_X
{
X
}
// Since we have forward LSTM we can squeeze `num_directions` axis from inputs.
// Since we have forward LSTM we can squeeze `num_directions` axis from inputs.
,
m_W
{
reshape
::
squeeze
(
W
)}
,
m_W
(
reshape
::
squeeze
(
W
))
,
m_R
{
reshape
::
squeeze
(
R
)}
,
m_R
(
reshape
::
squeeze
(
R
))
,
m_B
{
reshape
::
squeeze
(
B
)}
,
m_B
(
reshape
::
squeeze
(
B
))
,
m_P
{
reshape
::
squeeze
(
P
)}
,
m_P
(
reshape
::
squeeze
(
P
))
,
m_initial_h
{
reshape
::
squeeze
(
initial_h
)}
,
m_initial_h
(
reshape
::
squeeze
(
initial_h
))
,
m_initial_c
{
reshape
::
squeeze
(
initial_c
)}
,
m_initial_c
(
reshape
::
squeeze
(
initial_c
))
,
m_seq_lengths
{
seq_lengths
}
,
m_seq_lengths
(
seq_lengths
)
,
m_attributes
{
attributes
}
,
m_attributes
(
attributes
)
{
{
}
}
...
@@ -302,7 +302,7 @@ namespace ngraph
...
@@ -302,7 +302,7 @@ namespace ngraph
std
::
int32_t
time_step
{
1
};
std
::
int32_t
time_step
{
1
};
for
(
const
auto
&
in_x
:
in_seqs
)
for
(
const
auto
&
in_x
:
in_seqs
)
{
{
const
std
::
shared_ptr
<
ngraph
::
Node
>&
lstm_cell
=
std
::
shared_ptr
<
ngraph
::
Node
>
lstm_cell
=
std
::
make_shared
<
ngraph
::
op
::
LSTMCell
>
(
std
::
make_shared
<
ngraph
::
op
::
LSTMCell
>
(
in_x
,
in_x
,
m_W
,
m_W
,
...
@@ -318,10 +318,8 @@ namespace ngraph
...
@@ -318,10 +318,8 @@ namespace ngraph
m_attributes
.
m_clip_threshold
,
m_attributes
.
m_clip_threshold
,
m_attributes
.
m_input_forget
);
m_attributes
.
m_input_forget
);
const
std
::
shared_ptr
<
ngraph
::
Node
>&
H
=
std
::
shared_ptr
<
ngraph
::
Node
>
H
=
get_output_element
(
lstm_cell
,
0
);
get_output_element
(
lstm_cell
,
0
);
std
::
shared_ptr
<
ngraph
::
Node
>
C
=
get_output_element
(
lstm_cell
,
1
);
const
std
::
shared_ptr
<
ngraph
::
Node
>&
C
=
get_output_element
(
lstm_cell
,
1
);
// Expand tensors with empty outermost dim, so we can later concatenate
// Expand tensors with empty outermost dim, so we can later concatenate
// them.
// them.
...
...
src/ngraph/runtime/gpu/gpu_compiled_function.cpp
View file @
64c7a437
...
@@ -172,6 +172,8 @@ void runtime::gpu::GPUCompiledFunction::compile()
...
@@ -172,6 +172,8 @@ void runtime::gpu::GPUCompiledFunction::compile()
pass_manager
.
register_pass
<
runtime
::
gpu
::
pass
::
BatchNormCache
>
();
pass_manager
.
register_pass
<
runtime
::
gpu
::
pass
::
BatchNormCache
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
LikeReplacement
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
LikeReplacement
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
();
// Run this pass for the second time since, some fused operators like LSTMCell may use
// other fused operators inside.
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
();
pass_manager
.
register_pass
<
runtime
::
gpu
::
pass
::
GPULayout
>
(
this
);
pass_manager
.
register_pass
<
runtime
::
gpu
::
pass
::
GPULayout
>
(
this
);
pass_manager
.
register_pass
<
ngraph
::
pass
::
AssignLayout
<
descriptor
::
layout
::
DenseTensorLayout
>>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
AssignLayout
<
descriptor
::
layout
::
DenseTensorLayout
>>
();
...
...
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
64c7a437
...
@@ -428,6 +428,8 @@ shared_ptr<runtime::Executable>
...
@@ -428,6 +428,8 @@ shared_ptr<runtime::Executable>
{
{
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
(
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
(
IntelGPUBackend
::
is_supported_impl
);
IntelGPUBackend
::
is_supported_impl
);
// Run this pass for the second time since, some fused operators like LSTMCell may use
// other fused operators inside.
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
(
pass_manager
.
register_pass
<
ngraph
::
pass
::
FusedOpDecomposition
>
(
IntelGPUBackend
::
is_supported_impl
);
IntelGPUBackend
::
is_supported_impl
);
}
}
...
...
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