Skip to content

Commit

Permalink
[GPU] Fix ConvolutionKernel_b_fs_yx_fsv16_1x1 to support input0 featu…
Browse files Browse the repository at this point in the history
…re dynamic case (openvinotoolkit#28156)

### Details:
- Fix ConvolutionKernel_b_fs_yx_fsv16_1x1 to support input0 feature
dynamic case

### Tickets:
 - 146681
  • Loading branch information
wilson-seok authored Dec 24, 2024
1 parent ae1fbbe commit 92edc91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ KERNEL(convolution_b_fs_yx_fsv16_1x1)(
{
#endif // SLM_DIV_FACTOR > 1
vec_t src = 0;
#if INPUT_LEFTOVERS
if ((k + 1) * FEATURE_SLICE_SIZE >= INPUT0_FEATURE_NUM)

if (INPUT_LEFTOVERS && ((k + 1) * FEATURE_SLICE_SIZE >= INPUT0_FEATURE_NUM))
{
if (k * FEATURE_SLICE_SIZE + sglid < INPUT0_FEATURE_NUM)
{
Expand All @@ -143,7 +143,6 @@ KERNEL(convolution_b_fs_yx_fsv16_1x1)(
}
}
else
#endif // INPUT_LEFTOVERS
{
#if PADDED_INPUT
#if X_BLOCK_SIZE > 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ JitConstants ConvolutionKernel_b_fs_yx_fsv16_1x1::GetJitConstants(const convolut
}
if (params.inputs[0].Feature().v % tuning_data.feature_block_size != 0) {
jit.AddConstant(MakeJitConstant("INPUT_LEFTOVERS", 1));
} else {
jit.AddConstant(MakeJitConstant("INPUT_LEFTOVERS", 0));
}
} else {
DimensionAccessHelperJit input0_dims(params.inputs[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10820,7 +10820,14 @@ TEST_P(conv_dyn_test, convolution_gpu_fsv16_1x1_no_bias) {
return outputs_ref.at("conv").get_memory();
};

auto in_layout = layout{ov::PartialShape{ov::Dimension(), ov::Dimension(p.in_shape[1]), ov::Dimension(), ov::Dimension()}, data_types::f16, format::b_fs_yx_fsv16};
cldnn::layout in_layout;
if (p.in_shape[2] % 2 == 0) {
// input feature is static
in_layout = layout{ov::PartialShape{ov::Dimension(), ov::Dimension(p.in_shape[1]), ov::Dimension(), ov::Dimension()}, data_types::f16, format::b_fs_yx_fsv16};
} else {
// input feature is dynamic
in_layout = layout{ov::PartialShape{ov::Dimension(), ov::Dimension(), ov::Dimension(), ov::Dimension()}, data_types::f16, format::b_fs_yx_fsv16};
}
auto input = engine.allocate_memory({ p.in_shape, data_types::f16, format::b_fs_yx_fsv16 });
auto weights = engine.allocate_memory({p.wei_shape, data_types::f16, is_grouped ? format::bfzyx : format::bfyx});

Expand Down

0 comments on commit 92edc91

Please sign in to comment.