-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
base: main
Are you sure you want to change the base?
Conversation
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. |
Signed-off-by: jukim-nv <jukim-nv@users.noreply.github.com>
import logging | ||
from enum import IntEnum, auto | ||
from io import BytesIO | ||
from pathlib import Path |
Check notice
Code scanning / CodeQL
Unused import Note
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
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
tests/deploy/test_neva_deploy.py
Outdated
@@ -0,0 +1,159 @@ | |||
import argparse | |||
from io import BytesIO |
Check notice
Code scanning / CodeQL
Unused import Note test
tests/deploy/test_neva_deploy.py
Outdated
from io import BytesIO | ||
|
||
import numpy as np | ||
from PIL import Image |
Check notice
Code scanning / CodeQL
Unused import Note test
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
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. |
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. |
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 implementingITritonDeployable
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
MegatronNevaDeployable
classtest_neva_deploy.py
script for testing deploymentUsage
See
test_neva_deploy.py
for full example on how to useMegatronNevaDeployable
.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:
PR Type:
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