[Model] Add Granite 4.0 1B speech to supported models (#38019)

Signed-off-by: Nick Cao <ncao@redhat.com>
This commit is contained in:
Nick Cao
2026-03-24 18:23:41 +00:00
committed by GitHub
parent 057fc94cbd
commit 935c46dd9b
4 changed files with 20 additions and 9 deletions
@@ -29,10 +29,13 @@ def vllm_to_hf_output(
MODEL_NAME = "ibm-granite/granite-speech-3.3-2b"
# Audio lora co-exists directly in the model directory, but
# currently still needs to be passed directly to vLLM.
audio_lora_path = MODEL_NAME
models = [MODEL_NAME]
MODEL_NAME_4_0 = "ibm-granite/granite-4.0-1b-speech"
# Audio lora co-exists directly in the 3.3 model directory,
# the 4.0 model has adapters merged into the weights.
models: dict[str, str | None] = {
MODEL_NAME: MODEL_NAME,
MODEL_NAME_4_0: None,
}
@pytest.fixture
@@ -60,6 +63,7 @@ def run_test(
tensor_parallel_size: int,
distributed_executor_backend: str | None = None,
attention_config: dict | None = None,
audio_lora_path: str | None = None,
):
"""Inference result should be the same between hf and vllm.
@@ -84,12 +88,14 @@ def run_test(
limit_mm_per_prompt={"audio": 1},
tensor_parallel_size=tensor_parallel_size,
distributed_executor_backend=distributed_executor_backend,
enable_lora=True,
enable_lora=audio_lora_path is not None,
max_lora_rank=64,
enforce_eager=True,
attention_config=attention_config,
) as vllm_model:
lora_request = LoRARequest("audio", 1, audio_lora_path)
lora_request = (
LoRARequest("audio", 1, audio_lora_path) if audio_lora_path else None
)
vllm_outputs_per_case = [
vllm_model.generate_greedy_logprobs(
prompts,
@@ -125,7 +131,7 @@ def run_test(
)
@pytest.mark.parametrize("model", models)
@pytest.mark.parametrize("model,audio_lora_path", models.items())
@pytest.mark.parametrize(
"dtype", ["float16"] if current_platform.is_rocm() else ["bfloat16"]
)
@@ -138,6 +144,7 @@ def test_models(
hf_runner,
vllm_runner,
model: str,
audio_lora_path: str | None,
audio_assets: AudioTestAssets,
granite_speech_attention_config,
dtype: str,
@@ -167,4 +174,5 @@ def test_models(
num_logprobs=num_logprobs,
tensor_parallel_size=1,
attention_config=granite_speech_attention_config,
audio_lora_path=audio_lora_path,
)
+2 -1
View File
@@ -810,7 +810,8 @@ _MULTIMODAL_EXAMPLE_MODELS = {
),
"GraniteVision": _HfExamplesInfo("ibm-granite/granite-vision-3.3-2b"),
"GraniteSpeechForConditionalGeneration": _HfExamplesInfo(
"ibm-granite/granite-speech-3.3-2b"
"ibm-granite/granite-speech-3.3-2b",
extras={"4.0-1b": "ibm-granite/granite-4.0-1b-speech"},
),
"GLM4VForCausalLM": _HfExamplesInfo(
"zai-org/glm-4v-9b",