Comments (3)
Hi @drcut , I am looking into this. thank you for pointing out.
from qpytorch.
Hi @drcut, this is due to a difference between the rounding mode of QPyTorch and PyTorch.
In short, QPyTorch is doing rounding-away-from-zero and PyTorch is doing rounding-to-nearest-even.
If you are not familiar with rounding mode, you can observe this by quantizing these two constants.
QPyTorch: 1.00048828125 -> 1.0010
PyTorch: 1.00048828125 -> 1.0
QPyTorch: 1.00146484375 -> 1.0020
PyTorch: 1.00146484375 -> 1.0020
I am looking into how to conform to PyTorch's standard.
from qpytorch.
Hi @drcut, this is due to a difference between the rounding mode of QPyTorch and PyTorch.
In short, QPyTorch is doing rounding-away-from-zero and PyTorch is doing rounding-to-nearest-even.
If you are not familiar with rounding mode, you can observe this by quantizing these two constants.
QPyTorch: 1.00048828125 -> 1.0010
PyTorch: 1.00048828125 -> 1.0QPyTorch: 1.00146484375 -> 1.0020
PyTorch: 1.00146484375 -> 1.0020I am looking into how to conform to PyTorch's standard.
Thanks! It's really helpful.
from qpytorch.
Related Issues (20)
- optim_low breaks if some parameter in the model has None gradient HOT 2
- Question about float quantization HOT 3
- RuntimeError: Error building extension 'quant_cuda' HOT 6
- Problems in Ninjia build HOT 3
- Segmentation fault HOT 12
- Floatpoint(8,23)flips the input values HOT 4
- About the Speed of Low Precision Training HOT 1
- How to represent integer? HOT 1
- SWALP Example HOT 1
- FixedPoint `symmetric=True` Min Value
- Is there any way to directly convert fp16 tensors to low precision tensors? HOT 2
- Model Export to ONNX dose not work due to quant functions
- Why the gradient scaling factor is multiplied before quantization?
- Code Freezes When Using QPyTorch HOT 9
- 'gbk' codec can't decode
- Rex
- quant_cuda does not compile.
- is there any way to control exponent bias?
- float_quantize at multi-gpu works wrong.
- RuntimeError: Ninja is required to load C++ extensions
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 qpytorch.