Imagenet1k benchmark #57
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A small script to setup ImageNet1k for the benchmark
Minor changes to the downloaded dataset as there are duplicated classes, some classes also contains "/" which is replaced with "or".
I looked at the clip-benchmark package and they average the vectors of a bunch of templates strings where they insert the class name. I made some c++ code for that as well but did not include it. Let me know if you want to have a look at that. Perhaps in another PR.
I have run this on the default setup described in the README and performance is not really looking as expected.
As mentioned in another issue, the performance difference could be due to different tokenizer strategy. But I have tried to make a dumb test change to the benchmark script where I call the python tokenizer instead and I only get slightly better results.
Here are the results:
With python tokenizer:
| total | 0.1102 | 0.1600 |
With cpp tokenizer:
| total | 0.0800 | 0.1182 |
As mentioned what I ran with was
CLIP-ViT-B-32-laion2B-s34B-b79K
fp16 model.Regardless, I think the benchmark dataset is nice to have to validate what performance hits are taken from different quantization strategies.