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

feat: bump openclip to v2.5.0 #859

Merged
merged 9 commits into from
Nov 16, 2022

Conversation

OrangeSodahub
Copy link
Contributor

@OrangeSodahub OrangeSodahub commented Nov 15, 2022

Goals : align with openclip v2.5.0
Changes :

  • Add two new models: roberta-ViT-B-32 xlm-roberta-base-ViT-B-32;
  • Add LayernormFp32 (original Layernorm handles fp16).
    (Default set: fp32 on cpu and fp16 on gpu);
  • Split original CLIP to TextTransformer, VisionTransformer and add _build_text_tower _build_vision_tower;
  • Rearrange modules;

@ZiniuYu
Copy link
Member

ZiniuYu commented Nov 15, 2022

Note: be careful with fp16

@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #859 (9b0a267) into bump-openclip-v25 (e4717a3) will decrease coverage by 39.56%.
The diff coverage is 56.49%.

❗ Current head 9b0a267 differs from pull request most recent head 50528b3. Consider uploading reports for the commit 50528b3 to get more accurate results

@@                  Coverage Diff                   @@
##           bump-openclip-v25     #859       +/-   ##
======================================================
- Coverage              80.28%   40.71%   -39.57%     
======================================================
  Files                     22       25        +3     
  Lines                   1633     1820      +187     
======================================================
- Hits                    1311      741      -570     
- Misses                   322     1079      +757     
Flag Coverage Δ
cas 40.71% <56.49%> (-39.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/clip_server/model/pretrained_models.py 77.77% <ø> (-20.64%) ⬇️
server/clip_server/model/utils.py 41.66% <41.66%> (ø)
server/clip_server/model/transformer.py 50.99% <50.99%> (ø)
server/clip_server/model/model.py 53.35% <57.00%> (-16.76%) ⬇️
server/clip_server/model/modified_resnet.py 69.91% <69.91%> (ø)
server/clip_server/model/mclip_model.py 82.05% <75.00%> (-1.29%) ⬇️
server/clip_server/model/simple_tokenizer.py 0.00% <0.00%> (-94.90%) ⬇️
server/clip_server/executors/clip_tensorrt.py 0.00% <0.00%> (-93.11%) ⬇️
server/clip_server/model/clip_trt.py 0.00% <0.00%> (-85.72%) ⬇️
server/clip_server/model/trt_utils.py 0.00% <0.00%> (-83.52%) ⬇️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@numb3r3 numb3r3 requested a review from ZiniuYu November 16, 2022 03:02
@numb3r3
Copy link
Member

numb3r3 commented Nov 16, 2022

@OrangeSodahub Please make sure the changes will not change the embedding result for each model.

@ZiniuYu ZiniuYu changed the base branch from main to bump-openclip-v25 November 16, 2022 08:50
@OrangeSodahub OrangeSodahub changed the base branch from bump-openclip-v25 to bump-openclip-v2.50 November 16, 2022 08:57
@ZiniuYu ZiniuYu marked this pull request as ready for review November 16, 2022 08:58
@ZiniuYu ZiniuYu merged commit 5524f46 into jina-ai:bump-openclip-v2.50 Nov 16, 2022
@OrangeSodahub
Copy link
Contributor Author

OrangeSodahub commented Nov 16, 2022

To transfer the code, we merge into a new subbranch first #860 .

numb3r3 pushed a commit that referenced this pull request Nov 29, 2022
* feat: bump openclip to v2.5.0 (#859)

* feat: bump openclip to v2.5.0

* fix: conflicts

* fix: default fp32 on cpu and fp16 on gpu

* feat: add two new models

* fix: remove debug

* fix: add roberta models (test)

* fix: model name xlm

* fix: (wip)

* fix: remove roberta model

* fix: model name

* fix: add :: to model name

* fix: add transformers

* fix: remove is_init_value

* fix: remove transformers

* fix: not use flash-attn on cpu

* fix: add assert description

* fix: housekeeping

* fix: cleanup

* fix: cleanup

* fix: allow to set precision

* fix: gpu-test

* fix: add roberta model test

* fix: dtype

* fix: dtype

* fix: remove optional

* fix: housekeeping

* fix: housekeeping

* fix: typo

* fix: refactor

* fix: refactor

* fix: refactor

* fix: type hint

* fix: address comments

* fix: visiontransformer

* fix: d_model and n_head

* fix: texttransformer

* fix: change model to fix oom gh action

* fix: class init and param name

* fix: black

* chore: bump open-clip version

Co-authored-by: ZiniuYu <[email protected]>
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.

3 participants