Skip to content

Commit 5cd59b8

Browse files
[GPU] Support fs_b_yx_fsv32 and int8 case for pooling (openvinotoolkit#27371)
### Details: - *Support fs_b_yx_fsv32 and int8 case for pooling* ### Tickets: - *157507*
1 parent b2a2270 commit 5cd59b8

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

src/plugins/intel_gpu/src/kernel_selector/cl_kernels/pooling_gpu_int8_ref.cl

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ KERNEL(pooling_gpu_int8_ref)(
7474
const uint f = bf / INPUT0_BATCH_NUM;
7575
const uint b = bf % INPUT0_BATCH_NUM;
7676
const uint z = 0;
77-
#elif OUTPUT_LAYOUT_B_FS_YX_FSV16 || OUTPUT_LAYOUT_BS_FS_YX_BSV32_FSV32 || OUTPUT_LAYOUT_BS_FS_YX_BSV16_FSV32
77+
#elif OUTPUT_LAYOUT_B_FS_YX_FSV16 || OUTPUT_LAYOUT_BS_FS_YX_BSV32_FSV32 || OUTPUT_LAYOUT_BS_FS_YX_BSV16_FSV32 || OUTPUT_LAYOUT_FS_B_YX_FSV32
7878
const uint x = get_global_id(1);
7979
const uint y = get_global_id(2);
8080
const uint bf = (uint)get_global_id(0);

src/plugins/intel_gpu/src/kernel_selector/kernels/pooling/pooling_kernel_gpu_int8_ref.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ParamsKey PoolingKernelGPUInt8Ref::GetSupportedKey() const {
1818
k.EnableInputLayout(DataLayout::bfzyx);
1919
k.EnableInputLayout(DataLayout::yxfb);
2020
k.EnableInputLayout(DataLayout::byxf);
21+
k.EnableInputLayout(DataLayout::fs_b_yx_fsv32);
2122
k.EnableInputLayout(DataLayout::b_fs_yx_fsv4);
2223
k.EnableInputLayout(DataLayout::b_fs_yx_fsv32);
2324
k.EnableInputLayout(DataLayout::b_fs_zyx_fsv32);
@@ -30,6 +31,7 @@ ParamsKey PoolingKernelGPUInt8Ref::GetSupportedKey() const {
3031
k.EnableOutputLayout(DataLayout::bfzyx);
3132
k.EnableOutputLayout(DataLayout::yxfb);
3233
k.EnableOutputLayout(DataLayout::byxf);
34+
k.EnableOutputLayout(DataLayout::fs_b_yx_fsv32);
3335
k.EnableOutputLayout(DataLayout::b_fs_yx_fsv4);
3436
k.EnableOutputLayout(DataLayout::b_fs_yx_fsv32);
3537
k.EnableOutputLayout(DataLayout::b_fs_zyx_fsv32);

src/plugins/intel_gpu/tests/unit/test_cases/pooling_gpu_test.cpp

+34
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,40 @@ class pooling_scale_random_test_base : public pooling_random_test_base<InputT, M
22762276
VF<output_t> _shift;
22772277
};
22782278

2279+
using pooling_random_test_int8_uint8 = pooling_random_test;
2280+
2281+
TEST_P(pooling_random_test_int8_uint8, avg_int8) {
2282+
auto test_case = pooling_random_test_base<int8_t, pooling_mode::average>();
2283+
ASSERT_NO_FATAL_FAILURE(test_case.run_random(GetParam(), false));
2284+
}
2285+
2286+
TEST_P(pooling_random_test_int8_uint8, max_int8) {
2287+
auto test_case = pooling_random_test_base<int8_t, pooling_mode::max>();
2288+
ASSERT_NO_FATAL_FAILURE(test_case.run_random(GetParam(), false));
2289+
}
2290+
2291+
TEST_P(pooling_random_test_int8_uint8, avg_uint8) {
2292+
auto test_case = pooling_random_test_base<uint8_t, pooling_mode::average>();
2293+
ASSERT_NO_FATAL_FAILURE(test_case.run_random(GetParam(), false));
2294+
}
2295+
2296+
TEST_P(pooling_random_test_int8_uint8, max_uint8) {
2297+
auto test_case = pooling_random_test_base<uint8_t, pooling_mode::max>();
2298+
ASSERT_NO_FATAL_FAILURE(test_case.run_random(GetParam(), false));
2299+
}
2300+
2301+
INSTANTIATE_TEST_SUITE_P(
2302+
smoke_low_precision,
2303+
pooling_random_test_int8_uint8,
2304+
testing::Combine(testing::Values(1, 2),
2305+
testing::Values(3, 8),
2306+
testing::Values(std::tuple<size_t, size_t, size_t>(12, 12, 1)),
2307+
testing::Values(std::tuple<size_t, size_t, size_t>(4, 4, 1)),
2308+
testing::Values(std::tuple<int, int, int>(2, 2, 1)),
2309+
testing::Values(std::tuple<int, int, int>(0, 0, 0)),
2310+
testing::Values(format::fs_b_yx_fsv32)),
2311+
testing::internal::DefaultParamName<pooling_random_test_params>);
2312+
22792313
using pooling_random_test_fp16_fp32 = pooling_random_test;
22802314

22812315
TEST_P(pooling_random_test_fp16_fp32, avg_fp16) {

0 commit comments

Comments
 (0)