Add Nemotron VLM support in video captioning - #1160
Conversation
|
Thanks @suiyoubi, I've addressed the issues, added tests and updated existing ones as well. |
2d81c50 to
b63e9d2
Compare
…mpat Fix Cosmos-Embed1 compatibility with transformers 4.56+ / 5.x
|
When running with --captioning-algorithm nemotron-bf16, vLLM's nano_nemotron_vl.py accesses config.dtype directly during model initialization:
|
|
Signed-off-by: weijiac <weijiac@NVIDIA.com>
Signed-off-by: weijiac <weijiac@NVIDIA.com>
Signed-off-by: weijiac <weijiac@NVIDIA.com>
| msg = "vllm is required for NemotronHVL but is not installed. Please install vllm: pip install vllm" | ||
| raise ImportError(msg) | ||
|
|
||
| os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" |
There was a problem hiding this comment.
could you please explain why we need this ?
There was a problem hiding this comment.
The env var is not needed on my 48GB GPU. i believe it's a safeguard for smaller GPUs where the 12B BF16 model can trigger OOM. we can move this to docs rather than hardcoding it here.
There was a problem hiding this comment.
Isee. Thanks for explaining. I would prefer to have the min requirement in the docs rather than the safeguard here
| } | ||
|
|
||
|
|
||
| _HEAD_MASK_VECTOR_DIM: Final[int] = 1 |
There was a problem hiding this comment.
do we need all the changes to the cosmos_embed1.py files ?
There was a problem hiding this comment.
yes, they're all needed for trust_remote_code=True to work with newer transformers versions. If the file bulk is a concern, they can be moved to a separate _cosmos_embed1_compat.py.
There was a problem hiding this comment.
discussed with @suiyoubi offline. the patches are not needed with latest cosmos model. will clean this up
Signed-off-by: weijiac <weijiac@NVIDIA.com>
|
/ok to test e13ece3 |
|
/ok to test d8ea9ee |
| "torchaudio", | ||
| # Nemotron VL support | ||
| "transformers>=4.56.0", | ||
| "vllm>=0.13; (platform_machine == 'x86_64' and platform_system != 'Darwin')", |
There was a problem hiding this comment.
Looks like vllm already has its own dependency group, and video_cuda12 already inherits it via nemo_curator[vllm]. Can the requirement here be consolidated?
| "torch<=2.9.1", | ||
| "torchaudio", | ||
| # Nemotron VL support | ||
| "transformers>=4.56.0", |
There was a problem hiding this comment.
The current transformers version is being overwritten via override-dependency: "transformers<=4.55.2", # Else Cosmos Embed imports fail. Is this ok?
There was a problem hiding this comment.
good catch. removed that override-dependency since the cosmos patch was gone.
|
/ok to test c44c94d |
Signed-off-by: weijiac <weijiac@NVIDIA.com>
|
/ok to test c9a2c1c |
|
/ok to test 85bcb78 |
Description
Adds support for the Nemotron Nano 12B V2 VLM
Usage
Checklist