Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct ConvolutionImplementationManager : public ImplementationManager {
format::bfzyx,
format::byxf,
format::bzyxf,
format::b_fs_yx_fsv4,
format::b_fs_yx_fsv8,
format::b_fs_zyx_fsv8,
format::b_fs_yx_fsv16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10791,6 +10791,45 @@ TEST(convolution_gpu_onednn, grouped_runtime_weights) {
ASSERT_EQ(output_layout.get_shape(), ov::Shape({1, 256, 25, 25}));
}

TEST(convolution_gpu_onednn, grouped_conv_fsv4) {
auto& engine = get_test_engine();

if (!engine.get_device_info().supports_immad)
return;

tests::random_generator rg(GET_SUITE_NAME);

int64_t input_b = 1, input_f = 4, input_y = 3, input_x = 3;
auto input_size = ov::PartialShape{ input_b, input_f, input_y, input_x };
auto input_data = rg.generate_random_4d<ov::float16>(input_b, input_f, input_y, input_x, -1, 1);
auto input_data_byxf = flatten_4d(format::bfyx, input_data);
auto input_mem = engine.allocate_memory({ input_size, data_types::f16, format::bfyx });
set_values(input_mem, input_data_byxf);

int64_t weights_b = 2, weights_f = 2048, weights_y = 2, weights_x = 1;
auto weights_size = ov::PartialShape{ weights_b, weights_f, weights_y, weights_x };
auto weights_data = rg.generate_random_4d<ov::float16>(weights_b, weights_f, weights_y, weights_x, -1, 1);
auto weights_data_bfyx = flatten_4d(format::bfyx, weights_data);
auto weights_mem = engine.allocate_memory({ weights_size, data_types::f16, format::bfyx });
set_values(weights_mem, weights_data_bfyx);

topology topology(
input_layout("input", input_mem->get_layout()),
reorder("input_fsv", input_info("input"), { input_size, data_types::f16, format::b_fs_yx_fsv4 }),
input_layout("weights", weights_mem->get_layout()),
reshape("reshaped_weights", input_info("weights"), true, { 2, 2048, 2, 1, 1 }, { 2, 2048, 2, 1, 1 }),
convolution("conv", input_info("input_fsv"), "reshaped_weights", no_bias, 2, { 1, 1 }, { 1, 1 }, { 0, 0 }, { 0, 0 }, true),
reorder("reorder", input_info("conv"), { data_types::f32, format::bfyx, { 1, 4096, 3, 3 } }));

ExecutionConfig config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::optimize_data(true));

network network(engine, topology, config);
network.set_input_data("input", input_mem);
network.set_input_data("weights", weights_mem);
network.execute();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you reuse existing case? I think there should be something we can use by parametrization

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no test with parameterization for onednn. In almost test, it uses 'force_implementations()' func to set format to issue node. but the test for this issue needs to check has_impl due to it doesn't call the test_format() in add_required_reorders pass. test_format() occurs this issue.


TEST(convolution_gpu_onednn, dyn_conv4d_reshape6d_pattern) {
tests::random_generator rg(GET_SUITE_NAME);
auto& engine = get_test_engine();
Expand Down
Loading