ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

How can I test using qsymm_per_channel ?

Open gunjupark opened this issue 6 years ago • 3 comments

Hi,

In ACL v20.02.1 , I find that new data type(QSYMM8_PER_CHANNEL) support for Conv layers.

I want to measure inference time difference using QASYMM8 and QSYMM8_PER_CHANNEL.

I can test with QASYMM8 using ACL benchmark and ACL graph.

but QSYMM8_PER_CHANNEL do not suuport in ACL graph API. so I tried to test with ACL CL functions and it has problem.

How can I set quantization_info for QSYMM8_PER_CHANNEL type?

I think QSYMM8_PER_CHANNEL should have quant_scale_factors equal to the number of channels. but I can't find the code that set multiple quantization_infos.

Is there an easy way to use QSYMM8_PER_CHANNEL?

thank you

gunjupark avatar Apr 03 '20 02:04 gunjupark

Hi @gunjupark

Thanks for your question. For per-channel quantization, one QuantizationInfo instance can have multiple values, so that instance can represent per-channel quantization.

QuantizationInfo uses std::vector as shown below. https://github.com/ARM-software/ComputeLibrary/blob/575c81f38edecaa662f3ee45d04ad8efded4fa81/arm_compute/core/QuantizationInfo.h#L158

I hope it helps.

Thanks.

sanpar02 avatar Apr 03 '20 14:04 sanpar02

Thank you. I could run with CLGEMMMatMulCore function with your help.

Is Per channel not supported in ACL Graph so far?

gunjupark avatar Apr 07 '20 05:04 gunjupark

Hi @gunjupark

Unless you want the graph API to generate quantization information for you, I believe it should be done by passing the correct data type (DataType enum) or QuantizationInfo with multiple scale values depending on which API you want to use.

In other words, as long as the API you're hoping to use accepts QuantizationInfo (or DataType enum), you can specify per-channel quantization information in the same way you did for function.

I hope it helps.

Thanks.

sanpar02 avatar Apr 08 '20 09:04 sanpar02