Comments (3)
What's the default quantization type?
Asymmetric quantization, which uses uint8
as the data type.
where, even users set the 'asymmetric' to False, the codes still force to use uint8.
No, your understanding is not correct. Since we use the QNNPACK backend, the dtype of the weights are required to be of uint8
type at the PyTorch side. What actually matters here is the argument qscheme=torch.per_tensor_symmetric
, apart from the default value torch.per_tensor_affine
, which means the offset is always pinned to 128
, while the scale remains learnable. Later, during the conversion phase, we will minus the unsigned quantized values (ranges from 0 to 256) by 128 so that they will become int8
.
BTW, to use symmetric quantization, you'll have to pass additional flags to both the quantizer and the converter. Related comments:
- https://github.com/alibaba/TinyNeuralNetwork/blob/main/examples/qat/qat.py#L36
- https://github.com/alibaba/TinyNeuralNetwork/blob/main/examples/qat/qat.py#L74
from tinyneuralnetwork.
I get it. Thanks a lot.
from tinyneuralnetwork.
I set asymmetric=False to TFLiteConverter and the generated tflite is int8 quantized then. Big thanks.
from tinyneuralnetwork.
Related Issues (20)
- tinynn.converter module not found! HOT 2
- [CI] several tests for modifier failed
- Whether to support pytorch to keras HOT 1
- TransposeConv wrong shape? HOT 15
- change input to INT8 after converting to tflite HOT 2
- [converter] implement torch's `aten::scaled_dot_product_attention` operator HOT 2
- Request: clamp would be more efficient to go to Bounded Relu than Maximum + Minimum HOT 3
- Do not support PReLU module? HOT 5
- torch.max not working HOT 2
- OneShotChannelPruner results in the miss of some operators HOT 4
- KeyError when executing quantization HOT 5
- PyTorch 转 TFLite 使用 int8 量化 HOT 4
- Does tinynn support following int16 quantization? HOT 1
- jit.trace succeed but tinynn tracer failed HOT 1
- It became larger after converting to tflite model HOT 4
- how to do Post-training integer quantization with int16 activation HOT 4
- unnecessary float() variables cause quantization to fail. HOT 7
- aten::index nodes take multiple indices in PyTorch model but cause an error when trying to convert to TFLite HOT 1
- aten::repeat_interleave is considered an unsupported Tensor and causing an error when trying to convert to TFLite HOT 2
- convert model error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyneuralnetwork.