Skip to content

[OV] Add quantization for text2text-generation models #1359

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

Merged

Conversation

nikita-savelyevv
Copy link
Collaborator

@nikita-savelyevv nikita-savelyevv commented Jun 25, 2025

What does this PR do?

Added post training quantization support for text2text-generation models.

Example metrics are below. Accuracy is computed with EleutherAI/lm-evaluation-harness#3101 on HellaSwag dataset.

Model ID FP32 Accuracy INT8 WC Accuracy INT8 PTQ Accuracy INT8 WC Speedup INT8 PTQ Speedup
google-t5/t5-small 26.72% 26.78% 26.96% 1.06x 1.14x
google-t5/t5-large 34.84% 34.82% 34.80% 1.70x 1.81x
google-t5/t5-3b 38.52% 38.41% 38.79% 2.46x 2.38x

WC stands for weight compression, PTQ stands for Post-Training-Quantization.

Ticket 165770

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@nikita-savelyevv nikita-savelyevv marked this pull request as ready for review July 4, 2025 06:17
@nikita-savelyevv nikita-savelyevv requested a review from rkazants July 4, 2025 06:17
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot @nikita-savelyevv !

@echarlaix echarlaix linked an issue Jul 8, 2025 that may be closed by this pull request
@echarlaix echarlaix removed a link to an issue Jul 8, 2025
@echarlaix echarlaix merged commit 755e63d into huggingface:main Jul 8, 2025
21 checks passed
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

Successfully merging this pull request may close these issues.

5 participants