Skip to content
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

Remove gather metatype from input quantizable #2840

Conversation

daniil-lyakhov
Copy link
Collaborator

@daniil-lyakhov daniil-lyakhov commented Jul 24, 2024

Changes

Gather metatype is removed from input quantizable metatypes

Reason for changes

To prevent FQ propagation through gathers (relevant for the ScadeDotProductAttention quantization):

A quantizer starts to quantize all branches of a gather when propagated up through the gather node. This breaks the logic of quantization: some branches should have FP32 precision, and this propagation is ruining it.

Before:
image

After:
image

Related tickets

#2766

Tests

@daniil-lyakhov daniil-lyakhov requested a review from a team as a code owner July 24, 2024 12:39
@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF ONNX Pull requests that updates NNCF ONNX labels Jul 24, 2024
@daniil-lyakhov
Copy link
Collaborator Author

Quantizers are being inserted for gathers which have only one output:
image

@daniil-lyakhov daniil-lyakhov force-pushed the dl/torch/stop_quantize_gather branch from abc3449 to 1703abe Compare July 24, 2024 16:43
@daniil-lyakhov
Copy link
Collaborator Author

Fix is not valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF ONNX Pull requests that updates NNCF ONNX NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF PT Pull requests that updates NNCF PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant