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
621df65a
Unverified
Commit
621df65a
authored
Feb 20, 2018
by
Ashok Emani
Committed by
GitHub
Feb 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into examples
parents
7d160dad
607bcbc4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
40 additions
and
121 deletions
+40
-121
compiler.cpp
src/ngraph/codegen/compiler.cpp
+0
-11
node.cpp
src/ngraph/node.cpp
+4
-37
node.hpp
src/ngraph/node.hpp
+0
-2
cpu_emitter.cpp
src/ngraph/runtime/cpu/cpu_emitter.cpp
+0
-0
cpu_emitter.hpp
src/ngraph/runtime/cpu/cpu_emitter.hpp
+24
-71
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+0
-0
backend_performance.cpp
test/backend_performance.cpp
+12
-0
Sockeye_Seq2Seq_backward.json
test/models/mxnet/Sockeye_Seq2Seq_backward.json
+0
-0
Sockeye_Seq2Seq_forward.json
test/models/mxnet/Sockeye_Seq2Seq_forward.json
+0
-0
No files found.
src/ngraph/codegen/compiler.cpp
View file @
621df65a
...
...
@@ -208,19 +208,8 @@ void codegen::StaticCompiler::initialize()
}
// Enable various target features
// Most of these are for Eigen
auto
&
TO
=
m_compiler
->
getInvocation
().
getTargetOpts
();
TO
.
CPU
=
sys
::
getHostCPUName
();
TO
.
FeaturesAsWritten
.
emplace_back
(
"+sse"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+sse2"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+sse3"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+ssse3"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+sse4.1"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+sse4.2"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+avx"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+avx2"
);
TO
.
FeaturesAsWritten
.
emplace_back
(
"+fma"
);
}
codegen
::
StaticCompiler
::~
StaticCompiler
()
...
...
src/ngraph/node.cpp
View file @
621df65a
...
...
@@ -144,42 +144,6 @@ void Node::set_name(const string& name)
}
}
void
Node
::
assert_argument_list_equivalency
(
const
Nodes
&
b
)
{
bool
arguments_equal
=
true
;
if
(
this
->
m_arguments
.
size
()
==
b
.
size
())
{
for
(
size_t
i
=
0
;
i
<
this
->
m_arguments
.
size
();
i
++
)
{
arguments_equal
=
arguments_equal
&&
this
->
m_arguments
.
at
(
i
)
==
b
.
at
(
i
);
}
}
else
{
arguments_equal
=
false
;
}
if
(
!
arguments_equal
)
{
std
::
cout
<<
"node = "
<<
this
->
get_name
()
<<
std
::
endl
;
std
::
cout
<<
"m_arguments"
<<
std
::
endl
;
for
(
auto
arg
:
this
->
m_arguments
)
{
std
::
cout
<<
"arg = "
<<
arg
->
get_name
()
<<
std
::
endl
;
}
std
::
cout
<<
"results"
<<
std
::
endl
;
for
(
auto
arg
:
b
)
{
std
::
cout
<<
"arg = "
<<
arg
->
get_name
()
<<
std
::
endl
;
}
}
if
(
!
arguments_equal
)
{
throw
"Arguments aren't equal"
;
}
}
std
::
shared_ptr
<
Node
>
Node
::
get_input_op
(
size_t
index
)
{
for
(
auto
arg
:
m_arguments
)
...
...
@@ -201,7 +165,10 @@ Nodes Node::get_input_ops() //const
result
.
push_back
(
i
.
get_output
().
get_node
());
}
}
assert_argument_list_equivalency
(
result
);
if
(
m_arguments
!=
result
)
{
throw
ngraph_error
(
"Arguments aren't equal: different values"
);
}
return
result
;
}
...
...
src/ngraph/node.hpp
View file @
621df65a
...
...
@@ -170,8 +170,6 @@ namespace ngraph
protected
:
void
add_output
(
const
element
::
Type
&
element_type
,
const
Shape
&
shape
);
void
assert_argument_list_equivalency
(
const
Nodes
&
b
);
bool
test_identical
(
const
Node
&
)
const
;
std
::
string
m_node_type
;
std
::
multiset
<
Node
*>
m_users
;
...
...
src/ngraph/runtime/cpu/cpu_emitter.cpp
View file @
621df65a
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/cpu/cpu_emitter.hpp
View file @
621df65a
...
...
@@ -24,12 +24,12 @@
#include "ngraph/runtime/cpu/cpu_external_function.hpp"
#include "ngraph/runtime/cpu/cpu_tensor_view_wrapper.hpp"
#define EMITTER_DECL(
E)
\
E(ngraph::runtime::cpu::CPU_ExternalFunction* external_function,
\
codegen::CodeWriter& writer,
\
const ngraph::Node* node,
\
const std::vector<ngraph::runtime::cpu::TensorViewWrapper>& args,
\
const std::vector<ngraph::runtime::cpu::
TensorViewWrapper>& out)
#define EMITTER_DECL(
op_name)
\
emit<op_name>(CPU_ExternalFunction * external_function,
\
codegen::CodeWriter & writer,
\
const ngraph::Node* node,
\
const std::vector<TensorViewWrapper>& args,
\
const std::vector<
TensorViewWrapper>& out)
namespace
ngraph
{
...
...
@@ -40,72 +40,25 @@ namespace ngraph
class
CPU_Emitter
{
public
:
static
void
EMITTER_DECL
(
EmitNop
);
static
void
EMITTER_DECL
(
EmitAdd
);
#ifdef NGRAPH_DISTRIBUTED
static
void
EMITTER_DECL
(
EmitAllReduce
);
#endif
static
void
EMITTER_DECL
(
EmitDot
);
static
void
EMITTER_DECL
(
EmitMultiply
);
static
void
EMITTER_DECL
(
EmitGetOutputElement
);
static
void
EMITTER_DECL
(
EmitXLAGetTupleElement
);
static
void
EMITTER_DECL
(
EmitTuple
);
static
void
EMITTER_DECL
(
EmitAbs
);
static
void
EMITTER_DECL
(
EmitConcat
);
static
void
EMITTER_DECL
(
EmitDivide
);
static
void
EMITTER_DECL
(
EmitEqual
);
static
void
EMITTER_DECL
(
EmitGreater
);
static
void
EMITTER_DECL
(
EmitGreaterEq
);
static
void
EMITTER_DECL
(
EmitLess
);
static
void
EMITTER_DECL
(
EmitLessEq
);
static
void
EMITTER_DECL
(
EmitLog
);
static
void
EMITTER_DECL
(
EmitMaximum
);
static
void
EMITTER_DECL
(
EmitMinimum
);
static
void
EMITTER_DECL
(
EmitNegative
);
static
void
EMITTER_DECL
(
EmitNotEqual
);
static
void
EMITTER_DECL
(
EmitSelect
);
static
void
EMITTER_DECL
(
EmitSubtract
);
static
void
EMITTER_DECL
(
EmitBroadcast
);
static
void
EMITTER_DECL
(
EmitMatmulBias
);
static
void
EMITTER_DECL
(
EmitConvert
);
static
void
EMITTER_DECL
(
EmitConstant
);
static
void
EMITTER_DECL
(
EmitReshape
);
static
void
EMITTER_DECL
(
EmitFunctionCall
);
static
void
EMITTER_DECL
(
EmitReduce
);
static
void
EMITTER_DECL
(
EmitSign
);
static
void
EMITTER_DECL
(
EmitSlice
);
static
void
EMITTER_DECL
(
EmitSum
);
static
void
EMITTER_DECL
(
EmitExp
);
static
void
EMITTER_DECL
(
EmitSin
);
static
void
EMITTER_DECL
(
EmitSinh
);
static
void
EMITTER_DECL
(
EmitCos
);
static
void
EMITTER_DECL
(
EmitCosh
);
static
void
EMITTER_DECL
(
EmitTan
);
static
void
EMITTER_DECL
(
EmitTanh
);
static
void
EMITTER_DECL
(
EmitAsin
);
static
void
EMITTER_DECL
(
EmitAcos
);
static
void
EMITTER_DECL
(
EmitAtan
);
static
void
EMITTER_DECL
(
EmitPower
);
static
void
EMITTER_DECL
(
EmitReplaceSlice
);
static
void
EMITTER_DECL
(
EmitOneHot
);
static
void
EMITTER_DECL
(
EmitFloor
);
static
void
EMITTER_DECL
(
EmitCeiling
);
static
void
EMITTER_DECL
(
EmitSqrt
);
static
void
EMITTER_DECL
(
EmitConvolution
);
static
void
EMITTER_DECL
(
EmitConvolutionBackpropFilters
);
static
void
EMITTER_DECL
(
EmitConvolutionBackpropData
);
static
void
EMITTER_DECL
(
EmitNot
);
static
void
EMITTER_DECL
(
EmitMaxPool
);
static
void
EMITTER_DECL
(
EmitReverse
);
static
void
EMITTER_DECL
(
EmitReduceWindow
);
static
void
EMITTER_DECL
(
EmitSelectAndScatter
);
static
void
EMITTER_DECL
(
EmitAvgPool
);
static
void
EMITTER_DECL
(
EmitAvgPoolBackprop
);
static
void
EMITTER_DECL
(
EmitPad
);
static
void
EMITTER_DECL
(
EmitBatchNorm
);
static
void
EMITTER_DECL
(
EmitMaxPoolBackprop
);
template
<
typename
OP
>
static
void
emit
(
CPU_ExternalFunction
*
external_function
,
codegen
::
CodeWriter
&
writer
,
const
ngraph
::
Node
*
node
,
const
std
::
vector
<
TensorViewWrapper
>&
args
,
const
std
::
vector
<
TensorViewWrapper
>&
out
)
{
throw
std
::
runtime_error
(
"Unimplemented op in CPU emitter"
);
}
static
void
EmitMKLDNNPreamble
(
codegen
::
CodeWriter
&
writer
);
static
void
nop
(
CPU_ExternalFunction
*
external_function
,
codegen
::
CodeWriter
&
writer
,
const
ngraph
::
Node
*
node
,
const
std
::
vector
<
TensorViewWrapper
>&
args
,
const
std
::
vector
<
TensorViewWrapper
>&
out
)
{
}
static
void
emit_mkldnn_preamble
(
codegen
::
CodeWriter
&
writer
);
private
:
static
std
::
string
emit_vector
(
const
TensorViewWrapper
&
,
...
...
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
621df65a
This diff is collapsed.
Click to expand it.
test/backend_performance.cpp
View file @
621df65a
...
...
@@ -74,6 +74,18 @@ TEST(benchmark, mxnet_seq2seq_backward)
run_benchmark
(
json_path
,
"CPU"
,
10
);
}
TEST
(
benchmark
,
mxnet_sockeye_seq2seq_forward
)
{
const
string
json_path
=
file_util
::
path_join
(
SERIALIZED_ZOO
,
"mxnet/Sockeye_Seq2Seq_forward.json"
);
run_benchmark
(
json_path
,
"CPU"
,
10
);
}
TEST
(
benchmark
,
mxnet_sockeye_seq2seq_backward
)
{
const
string
json_path
=
file_util
::
path_join
(
SERIALIZED_ZOO
,
"mxnet/Sockeye_Seq2Seq_backward.json"
);
run_benchmark
(
json_path
,
"CPU"
,
10
);
}
//
// Benchmarks a graph that concatenates six 32x1x200 arrays along the middle axis.
//
...
...
test/models/mxnet/Sockeye_Seq2Seq_backward.json
0 → 100644
View file @
621df65a
This diff is collapsed.
Click to expand it.
test/models/mxnet/Sockeye_Seq2Seq_forward.json
0 → 100644
View file @
621df65a
This diff is collapsed.
Click to expand it.
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