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

Clip Model in Nemo2 #11980

Merged
merged 76 commits into from
Feb 4, 2025
Merged

Clip Model in Nemo2 #11980

merged 76 commits into from
Feb 4, 2025

Conversation

abhinavg4
Copy link
Collaborator

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

abhinavg4 and others added 27 commits December 20, 2024 09:51
# Conflicts:
#	nemo/collections/multimodal/data/energon/base.py
#	nemo/collections/vlm/__init__.py
#	nemo/collections/vlm/neva/model/base.py
#	nemo/lightning/pytorch/callbacks/progress_printer.py
…p_ab/clip

# Conflicts:
#	nemo/collections/vlm/openvla/data/lazy.py
#	nemo/collections/vlm/openvla/data/prismatic/util/data_utils.py
@abhinavg4 abhinavg4 marked this pull request as draft January 28, 2025 22:54
@yaoyu-33 yaoyu-33 removed the audio label Feb 3, 2025
@NVIDIA NVIDIA deleted a comment from github-actions bot Feb 3, 2025
@abhinavg4 abhinavg4 added the audio label Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.collections.multimodal.data.clip.augmentations.augmentations
nemo/collections/multimodal/data/clip/augmentations/augmentations.py:48:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/multimodal/data/clip/augmentations/augmentations.py:58:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/multimodal/data/clip/augmentations/augmentations.py:68:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/augmentations/augmentations.py:88:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.multimodal.data.clip.clip_dataset
nemo/collections/multimodal/data/clip/clip_dataset.py:186:0: C0301: Line too long (131/119) (line-too-long)
nemo/collections/multimodal/data/clip/clip_dataset.py:75:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:99:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:121:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:129:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:135:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:165:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:172:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:242:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/multimodal/data/clip/clip_dataset.py:288:0: C0115: Missing class docstring (missing-class-docstring)
************* Module nemo.collections.multimodal.data.energon.base
nemo/collections/multimodal/data/energon/base.py:97:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/multimodal/data/energon/base.py:99:0: C0301: Line too long (124/119) (line-too-long)
nemo/collections/multimodal/data/energon/base.py:319:0: C0301: Line too long (150/119) (line-too-long)
nemo/collections/multimodal/data/energon/base.py:331:0: C0301: Line too long (127/119) (line-too-long)
************* Module nemo.collections.multimodal.losses.clip_loss
nemo/collections/multimodal/losses/clip_loss.py:132:4: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.52/10

Mitigation guide:

  • Add sensible and useful docstrings to functions and methods
  • For trivial methods like getter/setters, consider adding # pylint: disable=C0116 inside the function itself
  • To disable multiple functions/methods at once, put a # pylint: disable=C0116 before the first and a # pylint: enable=C0116 after the last.

By applying these rules, we reduce the occurance of this message in future.

Thank you for improving NeMo's documentation!

Copy link
Contributor

github-actions bot commented Feb 3, 2025

beep boop 🤖: 🚨 The following files must be fixed before merge!


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.collections.vlm.clip.data.mock
nemo/collections/vlm/clip/data/mock.py:102:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/data/mock.py:118:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/data/mock.py:123:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/data/mock.py:128:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.vlm.clip.model.base
nemo/collections/vlm/clip/model/base.py:44:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:64:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:69:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:85:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:108:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:147:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:150:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:162:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:175:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:201:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:239:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:247:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:252:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:264:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:274:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/base.py:291:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:299:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:345:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:358:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:362:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:365:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:368:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:371:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:375:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:378:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:395:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:440:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:450:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/base.py:457:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.vlm.clip.model.clip
nemo/collections/vlm/clip/model/clip.py:193:0: C0301: Line too long (137/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:194:0: C0301: Line too long (133/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:195:0: C0301: Line too long (140/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:196:0: C0301: Line too long (136/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:201:0: C0301: Line too long (129/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:202:0: C0301: Line too long (125/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:203:0: C0301: Line too long (141/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:204:0: C0301: Line too long (137/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:205:0: C0301: Line too long (144/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:206:0: C0301: Line too long (140/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:211:0: C0301: Line too long (133/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:212:0: C0301: Line too long (129/119) (line-too-long)
nemo/collections/vlm/clip/model/clip.py:83:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/clip.py:109:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/clip.py:132:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/clip.py:138:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/clip.py:144:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/clip/model/clip.py:172:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/clip.py:230:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/clip.py:236:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/clip/model/clip.py:297:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module scripts.vlm.clip_pretrain
scripts/vlm/clip_pretrain.py:43:0: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.22/10

Mitigation guide:

  • Add sensible and useful docstrings to functions and methods
  • For trivial methods like getter/setters, consider adding # pylint: disable=C0116 inside the function itself
  • To disable multiple functions/methods at once, put a # pylint: disable=C0116 before the first and a # pylint: enable=C0116 after the last.

By applying these rules, we reduce the occurance of this message in future.

Thank you for improving NeMo's documentation!

@abhinavg4 abhinavg4 removed the audio label Feb 3, 2025
nemo/collections/vlm/clip/model/base.py Dismissed Show dismissed Hide dismissed
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.43%. Comparing base (09186c3) to head (2233f22).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11980      +/-   ##
==========================================
+ Coverage   30.30%   30.43%   +0.13%     
==========================================
  Files        1387     1395       +8     
  Lines      176283   176930     +647     
  Branches    27091    27128      +37     
==========================================
+ Hits        53423    53856     +433     
- Misses     118776   118986     +210     
- Partials     4084     4088       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Feb 4, 2025

[🤖]: Hi @abhinavg4 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

@abhinavg4 abhinavg4 merged commit ff1da18 into main Feb 4, 2025
219 of 221 checks passed
@abhinavg4 abhinavg4 deleted the wip_ab/clip branch February 4, 2025 17:22
BoxiangW pushed a commit that referenced this pull request Feb 7, 2025
* Initial commit

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Initial commit

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Adding clip data module

* Adding some data modules

* Adding code for Yash

* Adding code for Yash

* first commit

* cleaning codes

* runnable code for one vision encoder

* Apply isort and black reformatting

Signed-off-by: huvunvidia <[email protected]>

* Newer code

* remove irrelevant code in backbones (download models and models-related methods)

* Apply isort and black reformatting

Signed-off-by: huvunvidia <[email protected]>

* Code for Huy

* Code for Huy

* Code for Huy

* Code for Huy

* Code for Huy

* Code for Huy

* Removing OpenVLA related commits

* Removing OpenVLA related commits

* Code for Clip

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Apply isort and black reformatting

Signed-off-by: artbataev <[email protected]>

* Removing some debug commits

* Removing some debug commits

* Code for Clip

* Code for Clip

* Code for Clip

* Code for Clip

* Removing some not needed files

* Some more minor change

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Adding Nemo Run

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Batch size changes

* PR comments

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* PR comments

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* PR comments

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Adding Energon requirements

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* PR Changes

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* PR Changes

* Changes to Energon

* Changes for PR

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Changes for PR

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

* Changes for PR

* Apply isort and black reformatting

Signed-off-by: abhinavg4 <[email protected]>

---------

Signed-off-by: abhinavg4 <[email protected]>
Signed-off-by: huvunvidia <[email protected]>
Signed-off-by: artbataev <[email protected]>
Co-authored-by: abhinavg4 <[email protected]>
Co-authored-by: Huy Vu2 <[email protected]>
Co-authored-by: huvunvidia <[email protected]>
Co-authored-by: artbataev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants