From 9c4ffd107719c36597cd378a206b1fc6b62cb1b0 Mon Sep 17 00:00:00 2001 From: "River.Li" Date: Sun, 16 Jun 2024 14:24:50 +0800 Subject: [PATCH] Fix bug --- .../cl_kernels/fully_connected_gpu_bf_tiled.cl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/fully_connected_gpu_bf_tiled.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/fully_connected_gpu_bf_tiled.cl index e2986ceb6d8310..4eb7cdd9527a9d 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/fully_connected_gpu_bf_tiled.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/fully_connected_gpu_bf_tiled.cl @@ -172,10 +172,12 @@ inline void FUNC(fc_bf_tiled_kernel_default)( uint batch_mega_block = gid / (DISPATCH_FSV * DISPATCH_BSV * CEIL_DIV(TILE_OUT_F_NUM, TILE_OFM * SIMD) / DISPATCH_FSV); uint left_batch = TILE_B; - uint last_batch_mega_block = (get_num_groups(0) - 1) / (DISPATCH_FSV * DISPATCH_BSV * CEIL_DIV(TILE_OUT_F_NUM, TILE_OFM * SIMD) / DISPATCH_FSV); - uint last_batch_mini_block = (get_num_groups(0) - 1) / DISPATCH_FSV % DISPATCH_BSV; - if (batch_mega_block == last_batch_mega_block && batch_mini_block == last_batch_mini_block){ - left_batch = INPUT0_BATCH_NUM % TILE_B; + if((INPUT0_BATCH_NUM * INPUT0_FEATURE_NUM) % TILE_B != 0) { + uint last_batch_mega_block = (get_num_groups(0) - 1) / (DISPATCH_FSV * DISPATCH_BSV * CEIL_DIV(TILE_OUT_F_NUM, TILE_OFM * SIMD) / DISPATCH_FSV); + uint last_batch_mini_block = (get_num_groups(0) - 1) / DISPATCH_FSV % DISPATCH_BSV; + if (batch_mega_block == last_batch_mega_block && batch_mini_block == last_batch_mini_block){ + left_batch = (INPUT0_BATCH_NUM * INPUT0_FEATURE_NUM) % TILE_B; + } } #if USE_SLM uint out_f = gid * (TILE_OFM * SIMD);