quanto icon indicating copy to clipboard operation
quanto copied to clipboard

Add examples based on ViT

Open dacorvo opened this issue 10 months ago • 17 comments

Vision Transformers should be supported out-of-the-box by quanto.

The goal of this issue is to add some examples under examples/vision.

At the very minimum, there should be a classification example, using a relatively small dataset so that people can rerun it locally without downloading gigabytes of images (imagenette maybe ?).

An image detection example would also be nice if possible, but maybe it requires too much code.

dacorvo avatar Apr 12 '24 09:04 dacorvo

@dacorvo I can work on this one. I've been contributing to the transformers library recently, but I also want to get into the quanto library as it seems pretty fun!

EduardoPach avatar Apr 29 '24 13:04 EduardoPach

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 30 '24 01:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 04 '24 01:06 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 05 '24 01:07 github-actions[bot]

@dacorvo I would like to work on this

mattiadg avatar Jul 14 '24 13:07 mattiadg

@mattiadg sure: feel free to select a model and create an example.

dacorvo avatar Jul 15 '24 07:07 dacorvo

Oh but I see now there are already 3 examples under vision. Maybe we want to add something different, like Whisper for speech recognition?

mattiadg avatar Jul 15 '24 19:07 mattiadg

@mattiadg yes a whisper example would be awesome

dacorvo avatar Jul 16 '24 06:07 dacorvo

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 16 '24 01:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 21 '24 01:08 github-actions[bot]

@dacorvo I am working on adding a ViT example using the oxford Pets dataset. Is that a good classification example?

shovan777 avatar Sep 02 '24 04:09 shovan777

Nice ! Looking forward to see your example. When submitting your pull-request, please do not forget to use conventional commits to make it easier to review.

dacorvo avatar Sep 02 '24 07:09 dacorvo

Nice ! Looking forward to see your example. When submitting your pull-request, please do not forget to use conventional commits to make it easier to review.

I made a PR. But I couldn't perform model requantize as I faced a problem with quantization_map function. Screenshot 2024-09-12 at 10 40 48 It seems the QLayerNorm doesn't have a quantization weight type. Is this a issue with QLayerNorm?

shovan777 avatar Sep 12 '24 04:09 shovan777

It seems the QLayerNorm doesn't have a quantization weight type. Is this a issue with QLayerNorm?

Yes, line 168 should be modified to support weight_qtype == None, as the line below. If you don't mind, you could add a fix commit to your pull-request.

dacorvo avatar Sep 12 '24 06:09 dacorvo

Yes, I can do that. But do you think I should create a new PR for this or should I commit in the same PR?

shovan777 avatar Sep 12 '24 08:09 shovan777

Do it in the same pull-request, but in a separate commit. They are not squashed when merging so it will appear as a stand-alone change.

dacorvo avatar Sep 12 '24 10:09 dacorvo

Do it in the same pull-request, but in a separate commit. They are not squashed when merging so it will appear as a stand-alone change.

I have made the change and committed. Is test case necessary for the change?

shovan777 avatar Sep 13 '24 06:09 shovan777

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 14 '24 02:10 github-actions[bot]