how to support quant tensor in mkldnn?
As the tensor is type of int8 with scale and zeropoint. it means that real_val = (quant_val - zeropoint) * scale. So how do i use mkldnn for the quant tensor? i suppose that reorder can change the quant to real value. but i do not see it in doc or example code.
Hi @kriszhangyf,
MKL-DNN doesn't support quantization with shifted zero. Reorders can do the following:
dst <-- saturate<dst_type>((float)reorder_scale * src)
Please see attributes API, and reorder harness in benchdnn.
Convolution also supports conv_scale, to help using low-precision (int8) computations.
Currently it supports the following:
dst <-- saturate<dst_type>((float)conv_scale * (conv(src_u8, wei_s8, accum data type = s32) + bia_zz))
Here bia_zz -- means that bias might be either f32, s32, s8, or u8 type.
The same for dst_type -- it might be any of f32, s32, {u,s}8.
Please also note, that int8-convolution requires processor with avx512 (avx512_bw) support.