# SNPE

Snapdragon Neural Processing Engine (SNPE) is a Qualcomm Snapdragon software accelerated runtime for the execution of deep neural networks.

## Quantization Scheme

8/16 bit per-layer asymmetric linear quantization.

$$$q = \mathtt{clamp}\left(\left\lfloor R * \dfrac{x - cmin}{cmax - cmin} \right\rceil, lb, ub\right)$$$

where $$R$$ is the integer range after quantization, $$cmax$$ and $$cmin$$ are calculated range of the floating values, $$lb$$ and $$ub$$ are bounds of integer range. Taking 8bit as an example, R=255, [lb, ub]=[0,255].

In fact, when building the SNPE with the official tools, it will firstly convert the model into .dlc model file of full precision, and then optionally change it into a quantized version.

Attention

Users can provide a .json file to override the parameters.

The values of scale and offset are not required, but can be overrided.

SNPE will adjust the values of cmin and cmax to ensure zero is representable.