Skip to content

[Quantization] Make Int8 MaxPool and AvgPool handle different input/output fp32 dynamic ranges #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rdzhabarov opened this issue Nov 14, 2018 · 1 comment

Comments

@rdzhabarov
Copy link
Contributor

Currently both operations expect Scales and Offsets for inputs/outputs to be the same.
In reality, most common case would be a different quantization parameters for inputs/outputs.
There is a high chance that Max pool for example would increase the lower bound of possible values and hence output needs to have a smaller fp32 dynamic range.

There are several places which needs to be fixed:

  • Implementation of mentioned above functions on CPU and Interpreter
  • Quantization procedure which should not enforce same scale/offset for inputs/outputs
  • Caffe2 loader of quantized operations for pooling ops

See: #2016 (comment)

@rdzhabarov
Copy link
Contributor Author

apparently avg pool already supports this. For max pool it'd make sense from the efficiency stand point to keep the same params as inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant