@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 2cd94259c8
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 10, 22:45 UTC

[CI/Build] Ignore max transformers version skipping for initialization tests (#30619)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Dec 26, 2025 at 10:50 UTC 2cd94259c806984eeadfcae833ce02802f6df2e0
2 files changed +57 -29
tests/models/registry.py
+52 -28
@@ -47,9 +47,11 @@ class _HfExamplesInfo:
47 The maximum version of HF Transformers that this model runs on.
48 """
49
50 - transformers_version_reason: str | None = None
50 + transformers_version_reason: dict[Literal["vllm", "hf"], str] | None = None
51 """
52 - The reason for the minimum/maximum version requirement.
52 + The type and reason to skip test for the minimum/maximum version requirement.
53 + vllm: skip all vLLM tests if the version requirement is not met.
54 + hf: only skip tests that uses HF runner if the version requirement is not met.
55 """
56
57 require_embed_inputs: bool = False
@@ -109,6 +111,7 @@ class _HfExamplesInfo:
111 self,
112 *,
113 on_fail: Literal["error", "skip", "return"],
114 + check_version_reason: Literal["vllm", "hf"] = "hf",
115 check_min_version: bool = True,
116 check_max_version: bool = True,
117 ) -> str | None:
@@ -129,23 +132,28 @@ class _HfExamplesInfo:
132 msg = f"`transformers=={current_version}` installed, but `transformers"
133 # Only check the base version for the min/max version, otherwise preview
134 # models cannot be run because `x.yy.0.dev0`<`x.yy.0`
132 - if (
133 - check_min_version
134 - and min_version
135 - and Version(cur_base_version) < Version(min_version)
136 - ):
135 + if min_version and Version(cur_base_version) < Version(min_version):
136 + is_version_valid = not check_min_version
137 msg += f">={min_version}` is required to run this model."
138 - elif (
139 - check_max_version
140 - and max_version
141 - and Version(cur_base_version) > Version(max_version)
142 - ):
138 + elif max_version and Version(cur_base_version) > Version(max_version):
139 + is_version_valid = not check_max_version
140 msg += f"<={max_version}` is required to run this model."
141 else:
145 - return None
142 + is_version_valid = True
143
147 - if self.transformers_version_reason:
148 - msg += f" Reason: {self.transformers_version_reason}"
144 + # check if Transformers version breaks the corresponding model runner,
145 + # skip test when model runner not compatible
146 + is_reason_valid = not (
147 + check_version_reason
148 + and self.transformers_version_reason
149 + and check_version_reason in self.transformers_version_reason
150 + )
151 + is_transformers_valid = is_version_valid and is_reason_valid
152 + if is_transformers_valid:
153 + return None
154 + elif self.transformers_version_reason:
155 + for reason_type, reason in self.transformers_version_reason.items():
156 + msg += f" Reason({reason_type}): {reason}"
157
158 if on_fail == "error":
159 raise RuntimeError(msg)
@@ -416,7 +424,9 @@ _TEXT_GENERATION_EXAMPLE_MODELS = {
424 "QWenLMHeadModel": _HfExamplesInfo(
425 "Qwen/Qwen-7B-Chat",
426 max_transformers_version="4.53",
419 - transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501
427 + transformers_version_reason={
428 + "hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
429 + },
430 trust_remote_code=True,
431 ),
432 "Qwen2ForCausalLM": _HfExamplesInfo(
@@ -502,12 +512,16 @@ _EMBEDDING_EXAMPLE_MODELS = {
512 "Qwen2ForRewardModel": _HfExamplesInfo(
513 "Qwen/Qwen2.5-Math-RM-72B",
514 max_transformers_version="4.53",
505 - transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501
515 + transformers_version_reason={
516 + "hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
517 + },
518 ),
519 "Qwen2ForProcessRewardModel": _HfExamplesInfo(
520 "Qwen/Qwen2.5-Math-PRM-7B",
521 max_transformers_version="4.53",
510 - transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501
522 + transformers_version_reason={
523 + "hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
524 + },
525 ),
526 "RobertaModel": _HfExamplesInfo("sentence-transformers/stsb-roberta-base-v2"),
527 "RobertaForMaskedLM": _HfExamplesInfo("sentence-transformers/all-roberta-large-v1"),
@@ -616,7 +630,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
630 "deepseek-ai/deepseek-vl2-tiny",
631 extras={"fork": "Isotr0py/deepseek-vl2-tiny"},
632 max_transformers_version="4.48",
619 - transformers_version_reason="HF model is not compatible.",
633 + transformers_version_reason={"hf": "HF model is not compatible."},
634 hf_overrides={"architectures": ["DeepseekVLV2ForCausalLM"]},
635 ),
636 "DeepseekOCRForCausalLM": _HfExamplesInfo(
@@ -648,7 +662,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
662 trust_remote_code=True,
663 extras={"2b": "h2oai/h2ovl-mississippi-2b"},
664 max_transformers_version="4.48",
651 - transformers_version_reason="HF model is not compatible.",
665 + transformers_version_reason={"hf": "HF model is not compatible."},
666 ),
667 "HCXVisionForCausalLM": _HfExamplesInfo(
668 "naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B",
@@ -694,9 +708,13 @@ _MULTIMODAL_EXAMPLE_MODELS = {
708 extras={"thinking": "moonshotai/Kimi-VL-A3B-Thinking"},
709 trust_remote_code=True,
710 max_transformers_version="4.53.3",
697 - transformers_version_reason="HF model uses deprecated transformers API "
698 - "(PytorchGELUTanh, DynamicCache.seen_tokens, and more). See: "
699 - "https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/discussions/31",
711 + transformers_version_reason={
712 + "hf": (
713 + "HF model uses deprecated transformers API "
714 + "(PytorchGELUTanh, DynamicCache.seen_tokens, and more). See: "
715 + "https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/discussions/31"
716 + )
717 + },
718 ),
719 "LightOnOCRForConditionalGeneration": _HfExamplesInfo(
720 "lightonai/LightOnOCR-1B-1025"
@@ -725,7 +743,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
743 "MantisForConditionalGeneration": _HfExamplesInfo(
744 "TIGER-Lab/Mantis-8B-siglip-llama3",
745 max_transformers_version="4.48",
728 - transformers_version_reason="HF model is not compatible.",
746 + transformers_version_reason={"hf": "HF model is not compatible."},
747 hf_overrides={"architectures": ["MantisForConditionalGeneration"]},
748 ),
749 "MiDashengLMModel": _HfExamplesInfo(
@@ -752,7 +770,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
770 "MolmoForCausalLM": _HfExamplesInfo(
771 "allenai/Molmo-7B-D-0924",
772 max_transformers_version="4.48",
755 - transformers_version_reason="Incorrectly-detected `tensorflow` import.",
773 + transformers_version_reason={
774 + "vllm": "Incorrectly-detected `tensorflow` import from processor."
775 + },
776 extras={"olmo": "allenai/Molmo-7B-O-0924"},
777 trust_remote_code=True,
778 ),
@@ -771,7 +791,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
791 "AIDC-AI/Ovis2-1B",
792 trust_remote_code=True,
793 max_transformers_version="4.53",
774 - transformers_version_reason="HF model is not compatible",
794 + transformers_version_reason={"hf": "HF model is not compatible"},
795 extras={
796 "1.6-llama": "AIDC-AI/Ovis1.6-Llama3.2-3B",
797 "1.6-gemma": "AIDC-AI/Ovis1.6-Gemma2-9B",
@@ -790,7 +810,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
810 "microsoft/Phi-3-vision-128k-instruct",
811 trust_remote_code=True,
812 max_transformers_version="4.48",
793 - transformers_version_reason="Use of deprecated imports which have been removed.", # noqa: E501
813 + transformers_version_reason={
814 + "hf": "HF model use deprecated imports which have been removed."
815 + }, # noqa: E501
816 extras={"phi3.5": "microsoft/Phi-3.5-vision-instruct"},
817 ),
818 "Phi4MMForCausalLM": _HfExamplesInfo(
@@ -809,7 +831,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
831 extras={"chat": "Qwen/Qwen-VL-Chat"},
832 trust_remote_code=True,
833 max_transformers_version="4.53.3",
812 - transformers_version_reason="Use of deprecated imports which have been removed.", # noqa: E501
834 + transformers_version_reason={
835 + "hf": "HF model uses deprecated imports which have been removed."
836 + }, # noqa: E501
837 hf_overrides={"architectures": ["QwenVLForConditionalGeneration"]},
838 ),
839 "Qwen2AudioForConditionalGeneration": _HfExamplesInfo(
tests/models/test_initialization.py
+5 -1
@@ -66,7 +66,11 @@ def can_initialize(
66
67 model_info = EXAMPLE_MODELS.get_hf_info(model_arch)
68 model_info.check_available_online(on_fail="skip")
69 - model_info.check_transformers_version(on_fail="skip")
69 + model_info.check_transformers_version(
70 + on_fail="skip",
71 + check_max_version=False,
72 + check_version_reason="vllm",
73 + )
74
75 hf_overrides_fn = partial(
76 dummy_hf_overrides,