Unverified Commit 9d0d7f48 authored by Andreas Karatzas's avatar Andreas Karatzas Committed by GitHub
Browse files

[ROCm][CI] Handle missing vision_config in Isaac model attention patch (#32281)


Signed-off-by: default avatarAndreas Karatzas <akaratza@amd.com>
parent 50632adc
...@@ -5,7 +5,9 @@ for manipulating the input / output of HF & vLLM test runners, which are ...@@ -5,7 +5,9 @@ for manipulating the input / output of HF & vLLM test runners, which are
typically specific to a small subset of models. typically specific to a small subset of models.
""" """
import logging
import types import types
import warnings
from pathlib import PosixPath from pathlib import PosixPath
import numpy as np import numpy as np
...@@ -31,6 +33,8 @@ from vllm.utils.collection_utils import is_list_of ...@@ -31,6 +33,8 @@ from vllm.utils.collection_utils import is_list_of
from .....conftest import HfRunner, ImageAsset, ImageTestAssets from .....conftest import HfRunner, ImageAsset, ImageTestAssets
from .types import RunnerOutput from .types import RunnerOutput
logger = logging.getLogger(__name__)
####### vLLM output processors functions ####### vLLM output processors functions
def blip2_vllm_to_hf_output(vllm_output: RunnerOutput, model: str) -> RunnerOutput: def blip2_vllm_to_hf_output(vllm_output: RunnerOutput, model: str) -> RunnerOutput:
...@@ -582,7 +586,25 @@ def isaac_patch_hf_runner(hf_model: HfRunner) -> HfRunner: ...@@ -582,7 +586,25 @@ def isaac_patch_hf_runner(hf_model: HfRunner) -> HfRunner:
# ---------------------------- # ----------------------------
from ...conftest import patch_hf_vision_attn_for_rocm from ...conftest import patch_hf_vision_attn_for_rocm
patch_hf_vision_attn_for_rocm(hf_model.model) try:
patch_hf_vision_attn_for_rocm(hf_model.model)
except AttributeError as e:
if "vision_config" in str(e):
warnings.warn(
f"Skipping ROCm vision attention patch for Isaac model: {e}. "
"This is expected for models without vision_config in "
"attention layers (e.g., Siglip2VariableLengthAttention).",
stacklevel=2,
)
else:
logger.error(
"Unexpected AttributeError during ROCm vision attention patch: %s. "
"Model type: %s. Inner model type: %s.",
e,
type(hf_model.model).__name__,
type(getattr(hf_model.model, "model", None)).__name__,
)
raise
def patched_forward( def patched_forward(
self, self,
......
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