diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/scaled_dot_product_attention.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/scaled_dot_product_attention.cpp index b2e79292ea268b..dad93d94946490 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/scaled_dot_product_attention.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/scaled_dot_product_attention.cpp @@ -78,10 +78,10 @@ struct scaled_dot_product_attention_impl : multi_stage_primitive layouts; - for (size_t i = 0; i < _kernels_data.size(); i++) { - auto dtype = from_data_type(_kernels_data[i].internalBufferDataType); + if (kernel_idx < _kernels_data.size()) { + auto dtype = from_data_type(_kernels_data[kernel_idx].internalBufferDataType); const auto bpp = data_type_traits::size_of(dtype); - for (auto size : _kernels_data[i].internalBufferSizes) { + for (auto size : _kernels_data[kernel_idx].internalBufferSizes) { layout inbuf_layout = {dtype, format::bfyx, // simple linear format (flattern to x channel) {1, 1, 1, (tensor::value_type)(size / bpp)}}; layouts.push_back(inbuf_layout);