Skip to content

Calibration dataset in INT8 Qunatization #44

Answered by mavihs7
phanben110 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @phanben110,

Since we generally train models in FP32, we don't require any further calibration. And when you convert your model from FP32 to FP16, we just drop half of those 32bits and you loose some precision.

However, if we do the same to go from FP16 to INT8, we'd loose all the precision and most of the numbers would just become zero. That's why instead of dropping bits, we map FP16 values to INT8 values to capture the range. And to capture this range properly, we run our FP16 models with a group of expected inputs values, which helps us in minimizing precision loss. To know more about this topic, I'd recommend this article

Now what should be your calibration dataset, depends on you…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@phanben110
Comment options

@mavihs7
Comment options

Answer selected by mavihs7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants