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

Draft: Add MegatronNevaDeployable for serving multimodal models on Triton server #9553

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jukim-nv
Copy link
Contributor

@jukim-nv jukim-nv commented Jun 27, 2024

TODO: still need to add a query helper in the style of nemo.deploy.nlp.query_llm.

What does this PR do ?

Adds a MegatronNevaDeployable class implementing ITritonDeployable enabling deployment of multimodal models like LLaVA/Neva to Triton inference server directly from .nemo checkpoints.

Currently this has only been tested with a LLaVA 1.5 model created with the instructions here.

Collection: [Note which collection this PR will affect]
deploy/

Changelog

  • Add MegatronNevaDeployable class
  • Add test_neva_deploy.py script for testing deployment

Usage

See test_neva_deploy.py for full example on how to use MegatronNevaDeployable.

    megatron_deployable = MegatronNevaDeployable(args.nemo_checkpoint, args.num_gpus)
...
    nm = DeployPyTriton(
        model=megatron_deployable,
        triton_model_name=model_name,
        triton_model_version=1,
        max_batch_size=8,
        port=8000,
        address="0.0.0.0",
        streaming=False,
    )
    nm.deploy()

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)

Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 12, 2024
import logging
from enum import IntEnum, auto
from io import BytesIO
from pathlib import Path

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Path' is not used.
import wrapt
from omegaconf import OmegaConf
from PIL import Image
from pytorch_lightning.trainer.trainer import Trainer

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Trainer' is not used.
get_default_sampling_params,
)
from nemo.collections.nlp.modules.common.transformer.text_generation import LengthParam, SamplingParam
from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'NLPDDPStrategy' is not used.
@@ -0,0 +1,159 @@
import argparse
from io import BytesIO

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'BytesIO' is not used.
from io import BytesIO

import numpy as np
from PIL import Image

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'Image' is not used.
for index, prompt_string in enumerate(input_strings):
media = input_media[index][0]
if media_type == MediaType.IMAGE:
size = len(media)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable size is not used.
@github-actions github-actions bot removed the stale label Jul 26, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 2024

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 9, 2024
@github-actions github-actions bot removed the stale label Aug 10, 2024
Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 25, 2024
@github-actions github-actions bot removed the stale label Aug 28, 2024
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.

None yet

1 participant