Forums - quant FP16

4 posts / 0 new
Last post
quant FP16
MarkWu
Join Date: 8 May 22
Posts: 37
Posted: Mon, 2023-07-03 01:39

Hi,

SNPE Version : snpe-2.12.0.230626

When I read the content of ReleaseNotes.txt, I found that "Tools: Quantizer: Fixed an issue that prevented weights & bias inputs of Batchnorm from being set as FP16.

I would like to ask how to quantify the model weights set as FP16?

BR.

  • Up0
  • Down0
yunxqin
Join Date: 2 Mar 23
Posts: 44
Posted: Mon, 2023-07-03 04:53

Dear developer,

You can use the command 'snpe-dlc-quantize --input_dlc model.dlc --input_list input_list.txt --skip_quantization --enable_htp'  to set fp16 quantization.

Br.

Yunxiang

  • Up0
  • Down0
MarkWu
Join Date: 8 May 22
Posts: 37
Posted: Mon, 2023-07-03 18:44

Dear yunxqin

In the snpe-2.12 version, I found that a new parameter :

 [ --restrict_quantization_steps=<val> ]
                        Specifies the number of steps to use for computing quantization encodings such that scale = (max - min) / number of quantization steps.
                        The option should be passed as a comma separated pair of hexadecimal string minimum and maximum values'
                        i.e. --restrict_quantization_steps "MIN,MAX".  Please note that this is a hexadecimal string literal and not a signed integer,
                        to supply a negative value an explicit minus sign is required. E.g.--restrict_quantization_steps "-0x80,0x7F" indicates an example 8 bit range'
                                                                                           --restrict_quantization_steps "-0x8000,0x7F7F" indicates an example 16 bit range.
                        This option only applies to symmetric param quantization.
 

But I encountered an error when using this parameter. How can I use this parameter?

BR.

  • Up0
  • Down0
MarkWu
Join Date: 8 May 22
Posts: 37
Posted: Mon, 2023-07-03 20:39

Dear yunxqin

fp16 quantization model  can`t run on V68 V66 DSP Hexagon Arch.

BR.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.