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 11, 12:30 UTC
[CI/Build] Fix broken mm processor test Mistral-3-large (#30597)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Isotr0py committed
Dec 13, 2025 at 20:43 UTC
e5db3e2774fd16394f8a96a608263ff2416385c8
1 file changed
+8
tests/models/multimodal/processing/test_tensor_schema.py
+8
@@ -8,6 +8,7 @@ from typing import Any, TypeAlias
8
9
import numpy as np
10
import pytest
11
+import torch
12
import torch.nn as nn
13
from PIL import Image
14
@@ -35,6 +36,7 @@ from vllm.tokenizers import cached_tokenizer_from_config
36
from vllm.utils.collection_utils import is_list_of
37
from vllm.utils.torch_utils import set_default_torch_dtype
38
39
+from ....utils import create_new_process_for_each_test
40
from ...registry import HF_EXAMPLE_MODELS
41
from ...utils import dummy_hf_overrides
42
from .test_common import get_model_ids_to_test, get_text_token_prompts
@@ -136,6 +138,7 @@ def create_batched_mm_kwargs(
138
)
139
140
141
+# TODO(Isotr0py): Don't initalize model during test
142
@contextmanager
143
def initialize_dummy_model(
144
model_cls: type[nn.Module],
@@ -150,16 +153,21 @@ def initialize_dummy_model(
153
backend="nccl",
154
)
155
initialize_model_parallel(tensor_model_parallel_size=1)
156
+
157
+ current_device = torch.get_default_device()
158
vllm_config = VllmConfig(model_config=model_config)
159
with set_current_vllm_config(vllm_config=vllm_config):
160
with set_default_torch_dtype(model_config.dtype):
161
+ torch.set_default_device(current_platform.device_type)
162
model = model_cls(vllm_config=vllm_config)
163
+ torch.set_default_device(current_device)
164
yield model
165
166
del model
167
cleanup_dist_env_and_memory()
168
169
170
+@create_new_process_for_each_test()
171
@pytest.mark.parametrize("model_id", get_model_ids_to_test())
172
def test_model_tensor_schema(model_id: str):
173
model_info = HF_EXAMPLE_MODELS.find_hf_info(model_id)