[GPU] softmax_kernel_items_class_optimized fix (#18178)
This commit is contained in:
1 parent
e1195e39ed
commit
cca8cf15ef
5 files changed
+8
-11
No files matched your search
@@ -88,7 +88,6 @@ KERNEL(reverse_ref)(
|
||||
}
|
||||
#if INPUT0_DIMS >= 5
|
||||
else if (axis[i] == Z_INDEX) {
|
||||
printf("outputZ %d", OUTPUT_SIZE_Z);
|
||||
z = OUTPUT_SIZE_Z - z - 1;
|
||||
}
|
||||
#if INPUT0_DIMS == 6
|
||||
|
||||
@@ -52,7 +52,7 @@ KERNEL (softmax_gpu_continuous_bfyx)(
|
||||
INPUT0_TYPE my_chunk[STACK_SIZE];
|
||||
INPUT0_TYPE my_maximum = -UNIT_VAL_MAX;
|
||||
INPUT0_TYPE my_sum = UNIT_VAL_ZERO;
|
||||
|
||||
|
||||
__local INPUT0_TYPE lg_storage[SLM_SIZE];
|
||||
|
||||
uint i=0;
|
||||
@@ -61,9 +61,6 @@ KERNEL (softmax_gpu_continuous_bfyx)(
|
||||
{
|
||||
for (; i<items_num - (items_num % SUBGROUP_BLOCK_SIZE); i+=SUBGROUP_BLOCK_SIZE)
|
||||
{
|
||||
INPUT0_TYPE tmp = input[data_set_offset + subgroup_offset + i * get_sub_group_size() + get_sub_group_local_id()];
|
||||
my_maximum = max(my_maximum, tmp);
|
||||
my_chunk[i] = tmp;
|
||||
BLOCK_TYPE vec_tmp = BLOCK_READ(input, data_set_offset + subgroup_offset + i * get_sub_group_size());
|
||||
for (int j = 0; j < SUBGROUP_BLOCK_SIZE; j++)
|
||||
{
|
||||
@@ -87,7 +84,7 @@ KERNEL (softmax_gpu_continuous_bfyx)(
|
||||
my_chunk[items_num] = tmp;
|
||||
}
|
||||
my_maximum = sub_group_reduce_max(my_maximum);
|
||||
|
||||
|
||||
if (get_sub_group_local_id() == 0)
|
||||
lg_storage[get_sub_group_id()] = my_maximum;
|
||||
|
||||
@@ -119,7 +116,7 @@ KERNEL (softmax_gpu_continuous_bfyx)(
|
||||
my_sum += tmp;
|
||||
my_chunk[items_num] = tmp;
|
||||
}
|
||||
|
||||
|
||||
my_sum = sub_group_reduce_add(my_sum);
|
||||
|
||||
if (get_sub_group_local_id() == 0)
|
||||
@@ -136,7 +133,7 @@ KERNEL (softmax_gpu_continuous_bfyx)(
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
my_sum = lg_storage[0];
|
||||
|
||||
|
||||
|
||||
i=0;
|
||||
#if HAS_FUSED_OPS
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ KERNEL(softmax_items_class_optimized)(
|
||||
denominator = sub_group_reduce_add(denominator);
|
||||
|
||||
// PART 3. Write out results
|
||||
uint output_idx = out_depth_offset;// + simd_lane * OUTPUT_CLASS_PITCH;
|
||||
uint output_idx = out_depth_offset;
|
||||
cls = 0;
|
||||
#if FULL_ITERATIONS_NUM >= SUB_GROUP_SIZE && IS_SUBGROUP_BLOCK_IO_ENABLED
|
||||
for (; cls < FULL_ITERATIONS_NUM - (FULL_ITERATIONS_NUM % BLOCK_SIZE); cls += BLOCK_SIZE)
|
||||
|
||||
+2
-2
@@ -80,9 +80,9 @@ JitConstants SoftmaxKerneItemsClassOptimized::GetJitConstants(const softmax_para
|
||||
auto jit = SoftmaxItemsClassKernelBase::GetJitConstants(params, dispatchData);
|
||||
|
||||
// sub_group_block_write requires aligned memory,
|
||||
// therefore it can be utilized if either memory is aligned by 16 bytes or there is only 1 dataset
|
||||
// therefore it can be utilized if either memory is aligned by 16 bytes
|
||||
bool isSubGroupBlockIOEnabled = params.dim != SoftmaxDim::BATCH &&
|
||||
(dispatchData.dataSetSize % (16 / params.inputs[0].ElementSize()) == 0 || dispatchData.dataSetsCount == 1);
|
||||
(dispatchData.dataSetSize * params.outputs[0].ElementSize()) % 16 == 0;
|
||||
|
||||
jit.AddConstants({
|
||||
MakeJitConstant("LEFTOVERS", dispatchData.leftovers),
|
||||
|
||||
+1
@@ -71,6 +71,7 @@ const std::vector<ov::Shape> inputShapes4D = {
|
||||
{1, 100, 1, 1},
|
||||
{1, 3, 4, 3},
|
||||
{2, 3, 4, 5},
|
||||
{1, 32, 1, 286},
|
||||
};
|
||||
|
||||
const std::vector<int64_t> axis4D = {-4, -3, -2, -1, 0, 1, 2, 3};
|
||||
|
||||
Reference in new issue
Block a user