Commit 29b7cfdf authored by dmyershov's avatar dmyershov Committed by Scott Cyphers

IntelGPU backend: Workaround for #2729 issue, regression test was added. (#2735)

parent a8e45884
......@@ -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,
......
......@@ -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.54881352f,
0.71518934f,
0.60276335f,
0.54488319f,
0.42365479f,
0.64589411f,
0.4375872f,
0.89177299f});
auto _mvgb = backend->create_tensor(element::f32, mvgb_shape);
copy_data(_mvgb, vector<float>{1.0f, 1.0f});
auto bn_output = backend->create_tensor(element::f32, shape_r);
vector<float> expected_result{0.54903894f,
0.71533161f,
0.60296183f,
0.54511058f,
0.42394274f,
0.64607101f,
0.43786817f,
0.89182704f};
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-3f, 1e-4f));
}
NGRAPH_TEST(${BACKEND_NAME}, batch_norm_fprop_b1c2h2w2)
{
auto input_shape = Shape{1, 2, 2, 2};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment