@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d56e952239
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 5, 12:15 UTC

nano_nemotron_vl: fix tensor device mismatch exception when video profiling (#39029)

Signed-off-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com>

Netanel Haber committed Apr 6, 2026 at 01:23 UTC d56e95223917ba21af2dd87a335dcb5c0b347bfe
1 file changed +3 -2
vllm/model_executor/models/nano_nemotron_vl.py
+3 -2
@@ -1239,12 +1239,13 @@ class NemotronH_Nano_VL_V2(
1239 img_context_token_ids=self._img_context_token_ids,
1240 video_temporal_patch_size=video_temporal_patch_size,
1241 )
1242 + device = video_embeddings.device
1243
1244 # video_repl.full is a list of token IDs
1244 - repl_token_ids = torch.tensor(video_repl.full)
1245 + repl_token_ids = torch.tensor(video_repl.full, device=device)
1246
1247 # Get embedding token IDs for image context (use pre-tokenized version)
1247 - embed_token_ids = torch.tensor(self._img_context_token_ids)
1248 + embed_token_ids = torch.tensor(self._img_context_token_ids, device=device)
1249
1250 # Create mask for video embedding positions
1251 is_video_embed = torch.isin(repl_token_ids, embed_token_ids)