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 14, 05:30 UTC
[CI/Build] Fix v1 OOT registration test (#25547)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Isotr0py committed
Sep 24, 2025 at 16:03 UTC
27ec3c78f387f2eaed8c51e749a49972f60225ca
3 files changed
+20
-21
tests/conftest.py
+2
-2
@@ -1079,7 +1079,7 @@ def dummy_llava_path():
1079
local_dir=_dummy_llava_path,
1080
ignore_patterns=[
1081
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
1082
- "*.msgpack"
1082
+ "*.msgpack", "*.safetensors"
1083
])
1084
assert os.path.exists(json_path)
1085
with open(json_path) as f:
@@ -1098,7 +1098,7 @@ def dummy_gemma2_embedding_path():
1098
local_dir=_dummy_gemma2_embedding_path,
1099
ignore_patterns=[
1100
"*.bin", "*.bin.index.json", "*.pt", "*.h5",
1101
- "*.msgpack"
1101
+ "*.msgpack", "*.safetensors"
1102
])
1103
assert os.path.exists(json_path)
1104
with open(json_path) as f:
tests/models/test_oot_registration.py
-2
@@ -42,7 +42,6 @@ def test_oot_registration_text_generation(
42
assert rest == ""
43
44
45
-@pytest.mark.skip(reason="This test is skipped because it failed on V1.")
45
@create_new_process_for_each_test()
46
def test_oot_registration_embedding(
47
monkeypatch: pytest.MonkeyPatch,
@@ -63,7 +62,6 @@ def test_oot_registration_embedding(
62
image = convert_image_mode(ImageAsset("cherry_blossom").pil_image, "RGB")
63
64
66
-@pytest.mark.skip(reason="This test is skipped because it failed on V1.")
65
@create_new_process_for_each_test()
66
def test_oot_registration_multimodal(
67
monkeypatch: pytest.MonkeyPatch,
vllm/model_executor/models/registry.py
+18
-17
@@ -483,23 +483,23 @@ class _LazyRegisteredModel(_BaseRegisteredModel):
483
def inspect_model_cls(self) -> _ModelInfo:
484
model_path = Path(
485
__file__).parent / f"{self.module_name.split('.')[-1]}.py"
486
+ module_hash = None
487
487
- assert model_path.exists(), \
488
- f"Model {self.module_name} expected to be on path {model_path}"
489
- with open(model_path, "rb") as f:
490
- module_hash = hashlib.md5(f.read()).hexdigest()
491
-
492
- mi = self._load_modelinfo_from_cache(module_hash)
493
- if mi is not None:
494
- logger.debug(("Loaded model info "
495
- "for class %s.%s from cache"), self.module_name,
496
- self.class_name)
497
- return mi
498
- else:
499
- logger.debug(("Cache model info "
500
- "for class %s.%s miss. "
501
- "Loading model instead."), self.module_name,
502
- self.class_name)
488
+ if model_path.exists():
489
+ with open(model_path, "rb") as f:
490
+ module_hash = hashlib.md5(f.read()).hexdigest()
491
+
492
+ mi = self._load_modelinfo_from_cache(module_hash)
493
+ if mi is not None:
494
+ logger.debug(("Loaded model info "
495
+ "for class %s.%s from cache"), self.module_name,
496
+ self.class_name)
497
+ return mi
498
+ else:
499
+ logger.debug(("Cache model info "
500
+ "for class %s.%s miss. "
501
+ "Loading model instead."), self.module_name,
502
+ self.class_name)
503
504
# Performed in another process to avoid initializing CUDA
505
mi = _run_in_subprocess(
@@ -508,7 +508,8 @@ class _LazyRegisteredModel(_BaseRegisteredModel):
508
self.class_name)
509
510
# save cache file
511
- self._save_modelinfo_to_cache(mi, module_hash)
511
+ if module_hash is not None:
512
+ self._save_modelinfo_to_cache(mi, module_hash)
513
514
return mi
515