Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU] Fix oob in fc bf tiled for BMG #28329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -352,17 +352,18 @@ inline void FUNC(fc_bf_tiled_kernel_default)(
// =====================================================================================================================================
// Main computation loop
uint iterations = MAIN_LOOP_ELEMENTS_COUNT / (TILE_IFM * SIMD);
const uint B_PITCH_MAX = min((uint)((BATCH_SIZE-out_b) * (SIMD/INPUT0_TYPE_SIZE)), (uint)TILE_IN_B_PITCH);
__attribute__((opencl_unroll_hint(1)))
for (uint ni = 0; ni < iterations; ++ni) {
// Load input.
#define LOAD_IN_0(bi) do { \
in_0[bi] = INPUT_BLOCK_READ(input, input_offset); \
input_offset += TILE_IN_B_PITCH; \
input_offset += B_PITCH_MAX; \
} while (false)

CONST_LOOP(TILE_B, LOAD_IN_0);
#undef LOAD_IN_0
input_offset += TILE_IFM * SIMD - TILE_IN_B_PITCH * TILE_B;
input_offset += TILE_IFM * SIMD - B_PITCH_MAX * TILE_B;
// NOTE: Manually unrolling multiplication loop leads to lower register pressure and allows for bigger block sizes,
// but significantly degrades readability and generality of code.
// It doesn't also show noticable performance improvement on tested configurations.
Expand Down
Loading