Pre.2021.1.submission (#2094)
* fixed code and updated unit tests to accomodate auto-reshaping graphs, to unlock full validation * [CPU][BF16] bf16 for Gemm or MatMul was enabled (#1920) # Conflicts: # inference-engine/thirdparty/mkl-dnn * Fuse EmbeddingBag * [IE CLDNN] Fix result storing in leftover's branch (#2050) Co-authored-by: Alexey Varyzgin <alexey.varyzgin@intel.com> Co-authored-by: Vafin, Maxim <maxim.vafin@intel.com> Co-authored-by: Ilya Znamenskiy <ilya.znamenskiy@intel.com>
This commit is contained in:
parent
1e6ca0627a
commit
c8b783f644
|
|
@ -76,6 +76,7 @@ JitConstants SoftmaxKerneItemsClassOptimized::GetJitConstants(const softmax_para
|
|||
auto jit = SoftmaxItemsClassKernelBase::GetJitConstants(params, kd);
|
||||
|
||||
jit.AddConstant(MakeJitConstant("WORKITEMS_PER_CLASSES", workitems_per_classes));
|
||||
jit.AddConstant(MakeJitConstant("HAS_DRIVER_PROBLEMS", params.engineInfo.bIMADSupport));
|
||||
|
||||
return jit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,12 +63,24 @@ KERNEL(softmax_items_class_optimized)(__global INPUT0_TYPE* input, __global OUTP
|
|||
ACCUMULATOR_TYPE denominator = 0.0;
|
||||
for (uint cls = 0; cls < FULL_ITERATIONS_NUM; cls++)
|
||||
{
|
||||
// This is a temporary solution for unresolved problem when ocl kernels compilation step doesn't produce actual binaries
|
||||
// for current kernel but driver doesn't report any errors (JIRA CVS-32211)
|
||||
#if HAS_DRIVER_PROBLEMS
|
||||
data[cls] = data[cls] == max_value ? 1.0 : native_exp(data[cls] - max_value);
|
||||
#else
|
||||
data[cls] = native_exp(data[cls] - max_value);
|
||||
#endif
|
||||
denominator += data[cls];
|
||||
}
|
||||
if(simd_lane < LEFTOVERS)
|
||||
{
|
||||
// This is a temporary solution for unresolved problem when ocl kernels compilation step doesn't produce actual binaries
|
||||
// for current kernel but driver doesn't report any errors (JIRA CVS-32211)
|
||||
#if HAS_DRIVER_PROBLEMS
|
||||
data[DATA_PER_WORKITEM-1] = data[DATA_PER_WORKITEM-1] == max_value ? 1.0 : native_exp(data[DATA_PER_WORKITEM-1] - max_value);
|
||||
#else
|
||||
data[DATA_PER_WORKITEM-1] = native_exp(data[DATA_PER_WORKITEM-1] - max_value);
|
||||
#endif
|
||||
denominator += data[DATA_PER_WORKITEM-1];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue