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
29b7cfdf
Commit
29b7cfdf
authored
Apr 10, 2019
by
dmyershov
Committed by
Scott Cyphers
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IntelGPU backend: Workaround for #2729 issue, regression test was added. (#2735)
parent
a8e45884
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+16
-1
backend_test.in.cpp
test/backend_test.in.cpp
+45
-0
No files found.
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
29b7cfdf
...
...
@@ -1423,7 +1423,22 @@ shared_ptr<runtime::Executable>
arguments_check
(
op
,
5
,
1
);
if
((
get_input_shape
(
op
,
2
).
size
()
!=
4
)
||
// Workaround for #2729 bug.
// Should be removed after fix in clDNN.
// Drop 14.0 of clDNN contains this bug.
bool
proceed_with_custom_kernel
=
false
;
const
string
&
gamma
=
get_input_name
(
op
,
0
);
const
string
&
beta
=
get_input_name
(
op
,
1
);
const
string
&
mean
=
get_input_name
(
op
,
3
);
const
string
&
variance
=
get_input_name
(
op
,
4
);
if
((
gamma
==
beta
)
||
(
gamma
==
mean
)
||
(
gamma
==
variance
)
||
(
beta
==
mean
)
||
(
beta
==
variance
)
||
(
mean
==
variance
))
{
proceed_with_custom_kernel
=
true
;
}
if
(
proceed_with_custom_kernel
||
(
get_input_shape
(
op
,
2
).
size
()
!=
4
)
||
(
get_input_type
(
op
)
!=
ngraph
::
element
::
f32
))
{
do_batch_norm_operation
(
topology
,
...
...
test/backend_test.in.cpp
View file @
29b7cfdf
...
...
@@ -5755,6 +5755,51 @@ NGRAPH_TEST(${BACKEND_NAME}, logical_or)
EXPECT_EQ
((
vector
<
char
>
{
1
,
0
,
1
,
1
,
1
,
1
,
1
,
0
}),
read_vector
<
char
>
(
result
));
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
batch_norm_inference_parameters_duplication
)
{
auto
input_shape
=
Shape
{
2
,
2
,
2
,
1
};
auto
input
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
input_shape
);
auto
mvgb_shape
=
Shape
{
2
};
auto
mvgb
=
make_shared
<
op
::
Parameter
>
(
element
::
f32
,
mvgb_shape
);
double
eps
=
0.001
;
auto
shape_r
=
Shape
{
2
,
2
,
2
,
1
};
auto
bn
=
make_shared
<
op
::
BatchNormInference
>
(
input
,
mvgb
,
mvgb
,
mvgb
,
mvgb
,
eps
);
auto
f
=
make_shared
<
Function
>
(
bn
,
ParameterVector
{
input
,
mvgb
,
mvgb
,
mvgb
,
mvgb
});
auto
backend
=
runtime
::
Backend
::
create
(
"${BACKEND_NAME}"
);
// Create some tensors for input/output
auto
_input
=
backend
->
create_tensor
(
element
::
f32
,
input_shape
);
copy_data
(
_input
,
vector
<
float
>
{
0.54881352
f
,
0.71518934
f
,
0.60276335
f
,
0.54488319
f
,
0.42365479
f
,
0.64589411
f
,
0.4375872
f
,
0.89177299
f
});
auto
_mvgb
=
backend
->
create_tensor
(
element
::
f32
,
mvgb_shape
);
copy_data
(
_mvgb
,
vector
<
float
>
{
1.0
f
,
1.0
f
});
auto
bn_output
=
backend
->
create_tensor
(
element
::
f32
,
shape_r
);
vector
<
float
>
expected_result
{
0.54903894
f
,
0.71533161
f
,
0.60296183
f
,
0.54511058
f
,
0.42394274
f
,
0.64607101
f
,
0.43786817
f
,
0.89182704
f
};
auto
handle
=
backend
->
compile
(
f
);
handle
->
call_with_validate
({
bn_output
},
{
_input
,
_mvgb
,
_mvgb
,
_mvgb
,
_mvgb
});
ASSERT_TRUE
(
ngraph
::
test
::
all_close
(
expected_result
,
read_vector
<
float
>
(
bn_output
),
1e-3
f
,
1e-4
f
));
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
batch_norm_fprop_b1c2h2w2
)
{
auto
input_shape
=
Shape
{
1
,
2
,
2
,
2
};
...
...
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