Unverified Commit 2cd94259 authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

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


Signed-off-by: default avatarIsotr0py <mozf@mail2.sysu.edu.cn>
parent b7165d53
...@@ -47,9 +47,11 @@ class _HfExamplesInfo: ...@@ -47,9 +47,11 @@ class _HfExamplesInfo:
The maximum version of HF Transformers that this model runs on. The maximum version of HF Transformers that this model runs on.
""" """
transformers_version_reason: str | None = None transformers_version_reason: dict[Literal["vllm", "hf"], str] | None = None
""" """
The reason for the minimum/maximum version requirement. The type and reason to skip test for the minimum/maximum version requirement.
vllm: skip all vLLM tests if the version requirement is not met.
hf: only skip tests that uses HF runner if the version requirement is not met.
""" """
require_embed_inputs: bool = False require_embed_inputs: bool = False
...@@ -109,6 +111,7 @@ class _HfExamplesInfo: ...@@ -109,6 +111,7 @@ class _HfExamplesInfo:
self, self,
*, *,
on_fail: Literal["error", "skip", "return"], on_fail: Literal["error", "skip", "return"],
check_version_reason: Literal["vllm", "hf"] = "hf",
check_min_version: bool = True, check_min_version: bool = True,
check_max_version: bool = True, check_max_version: bool = True,
) -> str | None: ) -> str | None:
...@@ -129,23 +132,28 @@ class _HfExamplesInfo: ...@@ -129,23 +132,28 @@ class _HfExamplesInfo:
msg = f"`transformers=={current_version}` installed, but `transformers" msg = f"`transformers=={current_version}` installed, but `transformers"
# Only check the base version for the min/max version, otherwise preview # Only check the base version for the min/max version, otherwise preview
# models cannot be run because `x.yy.0.dev0`<`x.yy.0` # models cannot be run because `x.yy.0.dev0`<`x.yy.0`
if ( if min_version and Version(cur_base_version) < Version(min_version):
check_min_version is_version_valid = not check_min_version
and min_version
and Version(cur_base_version) < Version(min_version)
):
msg += f">={min_version}` is required to run this model." msg += f">={min_version}` is required to run this model."
elif ( elif max_version and Version(cur_base_version) > Version(max_version):
check_max_version is_version_valid = not check_max_version
and max_version
and Version(cur_base_version) > Version(max_version)
):
msg += f"<={max_version}` is required to run this model." msg += f"<={max_version}` is required to run this model."
else: else:
return None is_version_valid = True
if self.transformers_version_reason: # check if Transformers version breaks the corresponding model runner,
msg += f" Reason: {self.transformers_version_reason}" # skip test when model runner not compatible
is_reason_valid = not (
check_version_reason
and self.transformers_version_reason
and check_version_reason in self.transformers_version_reason
)
is_transformers_valid = is_version_valid and is_reason_valid
if is_transformers_valid:
return None
elif self.transformers_version_reason:
for reason_type, reason in self.transformers_version_reason.items():
msg += f" Reason({reason_type}): {reason}"
if on_fail == "error": if on_fail == "error":
raise RuntimeError(msg) raise RuntimeError(msg)
...@@ -416,7 +424,9 @@ _TEXT_GENERATION_EXAMPLE_MODELS = { ...@@ -416,7 +424,9 @@ _TEXT_GENERATION_EXAMPLE_MODELS = {
"QWenLMHeadModel": _HfExamplesInfo( "QWenLMHeadModel": _HfExamplesInfo(
"Qwen/Qwen-7B-Chat", "Qwen/Qwen-7B-Chat",
max_transformers_version="4.53", max_transformers_version="4.53",
transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501 transformers_version_reason={
"hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
},
trust_remote_code=True, trust_remote_code=True,
), ),
"Qwen2ForCausalLM": _HfExamplesInfo( "Qwen2ForCausalLM": _HfExamplesInfo(
...@@ -502,12 +512,16 @@ _EMBEDDING_EXAMPLE_MODELS = { ...@@ -502,12 +512,16 @@ _EMBEDDING_EXAMPLE_MODELS = {
"Qwen2ForRewardModel": _HfExamplesInfo( "Qwen2ForRewardModel": _HfExamplesInfo(
"Qwen/Qwen2.5-Math-RM-72B", "Qwen/Qwen2.5-Math-RM-72B",
max_transformers_version="4.53", max_transformers_version="4.53",
transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501 transformers_version_reason={
"hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
},
), ),
"Qwen2ForProcessRewardModel": _HfExamplesInfo( "Qwen2ForProcessRewardModel": _HfExamplesInfo(
"Qwen/Qwen2.5-Math-PRM-7B", "Qwen/Qwen2.5-Math-PRM-7B",
max_transformers_version="4.53", max_transformers_version="4.53",
transformers_version_reason="HF model uses remote code that is not compatible with latest Transformers", # noqa: E501 transformers_version_reason={
"hf": "HF model uses remote code that is not compatible with latest Transformers" # noqa: E501
},
), ),
"RobertaModel": _HfExamplesInfo("sentence-transformers/stsb-roberta-base-v2"), "RobertaModel": _HfExamplesInfo("sentence-transformers/stsb-roberta-base-v2"),
"RobertaForMaskedLM": _HfExamplesInfo("sentence-transformers/all-roberta-large-v1"), "RobertaForMaskedLM": _HfExamplesInfo("sentence-transformers/all-roberta-large-v1"),
...@@ -616,7 +630,7 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -616,7 +630,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
"deepseek-ai/deepseek-vl2-tiny", "deepseek-ai/deepseek-vl2-tiny",
extras={"fork": "Isotr0py/deepseek-vl2-tiny"}, extras={"fork": "Isotr0py/deepseek-vl2-tiny"},
max_transformers_version="4.48", max_transformers_version="4.48",
transformers_version_reason="HF model is not compatible.", transformers_version_reason={"hf": "HF model is not compatible."},
hf_overrides={"architectures": ["DeepseekVLV2ForCausalLM"]}, hf_overrides={"architectures": ["DeepseekVLV2ForCausalLM"]},
), ),
"DeepseekOCRForCausalLM": _HfExamplesInfo( "DeepseekOCRForCausalLM": _HfExamplesInfo(
...@@ -648,7 +662,7 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -648,7 +662,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
trust_remote_code=True, trust_remote_code=True,
extras={"2b": "h2oai/h2ovl-mississippi-2b"}, extras={"2b": "h2oai/h2ovl-mississippi-2b"},
max_transformers_version="4.48", max_transformers_version="4.48",
transformers_version_reason="HF model is not compatible.", transformers_version_reason={"hf": "HF model is not compatible."},
), ),
"HCXVisionForCausalLM": _HfExamplesInfo( "HCXVisionForCausalLM": _HfExamplesInfo(
"naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B", "naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B",
...@@ -694,9 +708,13 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -694,9 +708,13 @@ _MULTIMODAL_EXAMPLE_MODELS = {
extras={"thinking": "moonshotai/Kimi-VL-A3B-Thinking"}, extras={"thinking": "moonshotai/Kimi-VL-A3B-Thinking"},
trust_remote_code=True, trust_remote_code=True,
max_transformers_version="4.53.3", max_transformers_version="4.53.3",
transformers_version_reason="HF model uses deprecated transformers API " transformers_version_reason={
"hf": (
"HF model uses deprecated transformers API "
"(PytorchGELUTanh, DynamicCache.seen_tokens, and more). See: " "(PytorchGELUTanh, DynamicCache.seen_tokens, and more). See: "
"https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/discussions/31", "https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/discussions/31"
)
},
), ),
"LightOnOCRForConditionalGeneration": _HfExamplesInfo( "LightOnOCRForConditionalGeneration": _HfExamplesInfo(
"lightonai/LightOnOCR-1B-1025" "lightonai/LightOnOCR-1B-1025"
...@@ -725,7 +743,7 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -725,7 +743,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
"MantisForConditionalGeneration": _HfExamplesInfo( "MantisForConditionalGeneration": _HfExamplesInfo(
"TIGER-Lab/Mantis-8B-siglip-llama3", "TIGER-Lab/Mantis-8B-siglip-llama3",
max_transformers_version="4.48", max_transformers_version="4.48",
transformers_version_reason="HF model is not compatible.", transformers_version_reason={"hf": "HF model is not compatible."},
hf_overrides={"architectures": ["MantisForConditionalGeneration"]}, hf_overrides={"architectures": ["MantisForConditionalGeneration"]},
), ),
"MiDashengLMModel": _HfExamplesInfo( "MiDashengLMModel": _HfExamplesInfo(
...@@ -752,7 +770,9 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -752,7 +770,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
"MolmoForCausalLM": _HfExamplesInfo( "MolmoForCausalLM": _HfExamplesInfo(
"allenai/Molmo-7B-D-0924", "allenai/Molmo-7B-D-0924",
max_transformers_version="4.48", max_transformers_version="4.48",
transformers_version_reason="Incorrectly-detected `tensorflow` import.", transformers_version_reason={
"vllm": "Incorrectly-detected `tensorflow` import from processor."
},
extras={"olmo": "allenai/Molmo-7B-O-0924"}, extras={"olmo": "allenai/Molmo-7B-O-0924"},
trust_remote_code=True, trust_remote_code=True,
), ),
...@@ -771,7 +791,7 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -771,7 +791,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
"AIDC-AI/Ovis2-1B", "AIDC-AI/Ovis2-1B",
trust_remote_code=True, trust_remote_code=True,
max_transformers_version="4.53", max_transformers_version="4.53",
transformers_version_reason="HF model is not compatible", transformers_version_reason={"hf": "HF model is not compatible"},
extras={ extras={
"1.6-llama": "AIDC-AI/Ovis1.6-Llama3.2-3B", "1.6-llama": "AIDC-AI/Ovis1.6-Llama3.2-3B",
"1.6-gemma": "AIDC-AI/Ovis1.6-Gemma2-9B", "1.6-gemma": "AIDC-AI/Ovis1.6-Gemma2-9B",
...@@ -790,7 +810,9 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -790,7 +810,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
"microsoft/Phi-3-vision-128k-instruct", "microsoft/Phi-3-vision-128k-instruct",
trust_remote_code=True, trust_remote_code=True,
max_transformers_version="4.48", max_transformers_version="4.48",
transformers_version_reason="Use of deprecated imports which have been removed.", # noqa: E501 transformers_version_reason={
"hf": "HF model use deprecated imports which have been removed."
}, # noqa: E501
extras={"phi3.5": "microsoft/Phi-3.5-vision-instruct"}, extras={"phi3.5": "microsoft/Phi-3.5-vision-instruct"},
), ),
"Phi4MMForCausalLM": _HfExamplesInfo( "Phi4MMForCausalLM": _HfExamplesInfo(
...@@ -809,7 +831,9 @@ _MULTIMODAL_EXAMPLE_MODELS = { ...@@ -809,7 +831,9 @@ _MULTIMODAL_EXAMPLE_MODELS = {
extras={"chat": "Qwen/Qwen-VL-Chat"}, extras={"chat": "Qwen/Qwen-VL-Chat"},
trust_remote_code=True, trust_remote_code=True,
max_transformers_version="4.53.3", max_transformers_version="4.53.3",
transformers_version_reason="Use of deprecated imports which have been removed.", # noqa: E501 transformers_version_reason={
"hf": "HF model uses deprecated imports which have been removed."
}, # noqa: E501
hf_overrides={"architectures": ["QwenVLForConditionalGeneration"]}, hf_overrides={"architectures": ["QwenVLForConditionalGeneration"]},
), ),
"Qwen2AudioForConditionalGeneration": _HfExamplesInfo( "Qwen2AudioForConditionalGeneration": _HfExamplesInfo(
......
...@@ -66,7 +66,11 @@ def can_initialize( ...@@ -66,7 +66,11 @@ def can_initialize(
model_info = EXAMPLE_MODELS.get_hf_info(model_arch) model_info = EXAMPLE_MODELS.get_hf_info(model_arch)
model_info.check_available_online(on_fail="skip") model_info.check_available_online(on_fail="skip")
model_info.check_transformers_version(on_fail="skip") model_info.check_transformers_version(
on_fail="skip",
check_max_version=False,
check_version_reason="vllm",
)
hf_overrides_fn = partial( hf_overrides_fn = partial(
dummy_hf_overrides, dummy_hf_overrides,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment