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

Add the Quantized model and also a Demo of the Quantized model #587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ruhaan838
Copy link

Post Training Quantization for GPT2

  • In this commit, I try to add the Quantization for the GPT2 most of the code remains the same.
  • Made the new files quantized_model.py in this repo I tried my best for this.
  • If anything you feel is wrong then ask me I try my best.
  • I can't change the original code just make the new file and done.

Size measure for both models

  • Original GPT2 (from_pretrain): 497813.01 KB
  • Quantized GPT2 (from_pretrain): 164120.94 KB
  • Difference: 333692.07 KB

Drawbacks

  • I still can't figure out how to generate the text with this Quantized model.
  • After applying the engine for quantization it will show the error of NotImplementation for Embeddings

@karpathy If you have time to review this code and merge it or feel something wrong then tell me I try my best

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.

1 participant