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

Add Lita, Vila and Vita TRTLLM export #9734

Merged
merged 12 commits into from
Jul 19, 2024
Merged

Conversation

xuanzic
Copy link
Contributor

@xuanzic xuanzic commented Jul 15, 2024

What does this PR do ?

  1. modify the neva_model to remove hardcoded 'vision_encoder" name.
  2. add trtllm export support for lita, vila and vita .nemo model.
  3. add run example for running lita, vila and vita inference.
  4. add triton deployment for these models.

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)

Vivian Chen and others added 2 commits July 11, 2024 16:42
@xuanzic xuanzic changed the title Add Lita, Vila and Vita TRTLLM export [DRAFT] Add Lita, Vila and Vita TRTLLM export Jul 15, 2024
@xuanzic xuanzic marked this pull request as draft July 15, 2024 17:27
Signed-off-by: Vivian Chen <[email protected]>
@xuanzic xuanzic changed the title [DRAFT] Add Lita, Vila and Vita TRTLLM export Add Lita, Vila and Vita TRTLLM export Jul 17, 2024
@xuanzic xuanzic marked this pull request as ready for review July 17, 2024 03:21
return image

def process_image(self, image_file, image_processor, nemo_config, image_folder):
image_processor = image_processor

Check failure

Code scanning / CodeQL

Redundant assignment Error

This assignment assigns a variable to itself.
from torchvision import transforms
from transformers import CLIPImageProcessor
from transformers import AutoModel, AutoProcessor, CLIPImageProcessor

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'AutoModel' is not used.
dtype,
image_size=image_size,
num_frames=lita_num_frames if model_type == "lita" or model_type == 'vita' else None,

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'lita_num_frames' may be used before it is initialized.
else:
image = image.expand(batch_size, -1, -1, -1).contiguous()
if self.model_type not in ['vila', 'lita', 'vita']:
if image.dim() == 5:

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'image' may be used before it is initialized.
Vivian Chen and others added 3 commits July 17, 2024 04:39
elif isinstance(video_path, np.ndarray):
frames = torch.tensor(video_path, dtype=torch.float32)

return self.preprocess_frames(frames, config, processor)

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'frames' may be used before it is initialized.
.unsqueeze(0)
.to(self.device, dtype=torch.bfloat16)
)
return image

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'image' may be used before it is initialized.
Signed-off-by: Vivian Chen <[email protected]>
Copy link
Collaborator

@meatybobby meatybobby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@meatybobby meatybobby merged commit ab8988e into NVIDIA:main Jul 19, 2024
206 of 207 checks passed
tonyjie pushed a commit to tonyjie/NeMo that referenced this pull request Jul 24, 2024
* modify vision encoder config

Signed-off-by: Vivian Chen <[email protected]>

* add lita, vila engine build support and fix export api bugs

Signed-off-by: Vivian Chen <[email protected]>

* add run example for vila, lita and vita

Signed-off-by: Vivian Chen <[email protected]>

* couple of changes for exporter

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* address code scanning issues

Signed-off-by: Vivian Chen <[email protected]>

* add triton deployment for lita/vila/vita

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* fix code scan

Signed-off-by: Vivian Chen <[email protected]>

---------

Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: xuanzic <[email protected]>
Co-authored-by: Vivian Chen <[email protected]>
Co-authored-by: xuanzic <[email protected]>
akoumpa pushed a commit that referenced this pull request Jul 25, 2024
* modify vision encoder config

Signed-off-by: Vivian Chen <[email protected]>

* add lita, vila engine build support and fix export api bugs

Signed-off-by: Vivian Chen <[email protected]>

* add run example for vila, lita and vita

Signed-off-by: Vivian Chen <[email protected]>

* couple of changes for exporter

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* address code scanning issues

Signed-off-by: Vivian Chen <[email protected]>

* add triton deployment for lita/vila/vita

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* fix code scan

Signed-off-by: Vivian Chen <[email protected]>

---------

Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: xuanzic <[email protected]>
Co-authored-by: Vivian Chen <[email protected]>
Co-authored-by: xuanzic <[email protected]>
Signed-off-by: Alexandros Koumparoulis <[email protected]>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
* modify vision encoder config

Signed-off-by: Vivian Chen <[email protected]>

* add lita, vila engine build support and fix export api bugs

Signed-off-by: Vivian Chen <[email protected]>

* add run example for vila, lita and vita

Signed-off-by: Vivian Chen <[email protected]>

* couple of changes for exporter

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* address code scanning issues

Signed-off-by: Vivian Chen <[email protected]>

* add triton deployment for lita/vila/vita

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* fix code scan

Signed-off-by: Vivian Chen <[email protected]>

---------

Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: xuanzic <[email protected]>
Co-authored-by: Vivian Chen <[email protected]>
Co-authored-by: xuanzic <[email protected]>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
* modify vision encoder config

Signed-off-by: Vivian Chen <[email protected]>

* add lita, vila engine build support and fix export api bugs

Signed-off-by: Vivian Chen <[email protected]>

* add run example for vila, lita and vita

Signed-off-by: Vivian Chen <[email protected]>

* couple of changes for exporter

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* address code scanning issues

Signed-off-by: Vivian Chen <[email protected]>

* add triton deployment for lita/vila/vita

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* fix code scan

Signed-off-by: Vivian Chen <[email protected]>

---------

Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: xuanzic <[email protected]>
Co-authored-by: Vivian Chen <[email protected]>
Co-authored-by: xuanzic <[email protected]>
Signed-off-by: Hainan Xu <[email protected]>
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
* modify vision encoder config

Signed-off-by: Vivian Chen <[email protected]>

* add lita, vila engine build support and fix export api bugs

Signed-off-by: Vivian Chen <[email protected]>

* add run example for vila, lita and vita

Signed-off-by: Vivian Chen <[email protected]>

* couple of changes for exporter

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* address code scanning issues

Signed-off-by: Vivian Chen <[email protected]>

* add triton deployment for lita/vila/vita

Signed-off-by: Vivian Chen <[email protected]>

* Apply isort and black reformatting

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

* fix code scan

Signed-off-by: Vivian Chen <[email protected]>

---------

Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
Signed-off-by: xuanzic <[email protected]>
Co-authored-by: Vivian Chen <[email protected]>
Co-authored-by: xuanzic <[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.

2 participants