@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / cf16342d43
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, 20:15 UTC

[ROCm][CI] Update MiniCPM model test: MiniCPM3-4B to MiniCPM4.1-8B and simplify attention backend testing (#31551)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>

Andreas Karatzas committed Dec 31, 2025 at 02:12 UTC cf16342d435f5d6cbbeaf076ed4546bda0f89a20
2 files changed +19 -7
tests/models/language/generation/test_common.py
+16 -7
@@ -10,6 +10,11 @@ from ....utils import large_gpu_mark
10 from ...registry import HF_EXAMPLE_MODELS
11 from ...utils import check_logprobs_close
12
13 +# Models that require embedding scaling for prompt_embeds test
14 +EMBED_SCALING_MODELS = {
15 + "openbmb/MiniCPM4.1-8B",
16 +}
17 +
18 # This list contains the model that are using AITER kernel.
19 # Skip model that are not using AITER tests.
20 # When more AITER kernels are added, this list will not be
@@ -64,8 +69,8 @@ AITER_MODEL_LIST = [
69 marks=[pytest.mark.core_model, pytest.mark.cpu_model],
70 ),
71 pytest.param(
67 - "openbmb/MiniCPM3-4B",
68 - marks=[pytest.mark.core_model, large_gpu_mark(min_gb=32)],
72 + "openbmb/MiniCPM4.1-8B", # minicpm
73 + marks=[pytest.mark.core_model, large_gpu_mark(min_gb=48)],
74 ),
75 pytest.param(
76 "facebook/opt-125m", # opt
@@ -135,16 +140,20 @@ def test_models(
140
141 prompt_embeds: list[torch.Tensor] | None = [] if use_prompt_embeds else None
142
138 - prompt_token_ids = []
143 for prompt in example_prompts:
144 token_ids = hf_model.tokenizer(prompt, return_tensors="pt").input_ids.to(
145 hf_model.model.device
146 )
143 - prompt_token_ids.append(token_ids)
147 if prompt_embeds is not None:
145 - prompt_embeds.append(
146 - hf_model.model.get_input_embeddings()(token_ids).squeeze(0)
147 - )
148 + embed = hf_model.model.get_input_embeddings()(token_ids)
149 +
150 + # MiniCPM models apply scale_emb to embeddings internally.
151 + # vLLM expects pre-scaled embeddings when using inputs_embeds.
152 + if model in EMBED_SCALING_MODELS:
153 + config = hf_model.model.config
154 + embed = embed * config.scale_emb
155 +
156 + prompt_embeds.append(embed.squeeze(0))
157
158 with vllm_runner(
159 model,
tests/models/registry.py
+3
@@ -355,6 +355,9 @@ _TEXT_GENERATION_EXAMPLE_MODELS = {
355 "MiniCPM3ForCausalLM": _HfExamplesInfo(
356 "openbmb/MiniCPM3-4B", trust_remote_code=True
357 ),
358 + "MiniCPM4ForCausalLM": _HfExamplesInfo(
359 + "openbmb/MiniCPM4.1-8B", trust_remote_code=True
360 + ),
361 "MiniMaxForCausalLM": _HfExamplesInfo("MiniMaxAI/MiniMax-Text-01-hf"),
362 "MiniMaxText01ForCausalLM": _HfExamplesInfo(
363 "MiniMaxAI/MiniMax-Text-01",