huggingface / optimum-quanto

A pytorch quantization backend for optimum
Apache License 2.0
833 stars 62 forks source link

feat(examples): add image classification example using quantized vit … #308

Closed shovan777 closed 2 months ago

shovan777 commented 2 months ago

What does this PR do?

This adds an image classification example using a quantized ViT model as per #169.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

dacorvo commented 2 months ago

The CPU tests are failing because of the release of pytorch 2.4.1 last week (I have a guard preventing to use torch._int_mm for versions up to 2.4.0, but it seems it is still inaccurate in 2.4.1).

shovan777 commented 2 months ago

@dacorvo I have made the changes you requested.