[CI][ROCm] Stabilize Qwen2-VL LoRA test (#50161)
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Andreas Karatzas committed
Jul 28, 2026 at 23:27 UTC
0bb548b60e88b74304008817b4908b65ec8b2393
2 files changed
+21
-2
.buildkite/test_areas/lora.yaml
-1
@@ -16,7 +16,6 @@ steps:
16
amd:
17
dind: false
18
device: mi300_1
19
- soft_fail: true
19
working_dir: "/vllm-workspace/tests"
20
timeout_in_minutes: 85
21
source_file_dependencies:
tests/lora/test_qwenvl.py
+21
-1
@@ -186,6 +186,18 @@ QWEN25VL_MODEL_PATH = "Qwen/Qwen2.5-VL-3B-Instruct"
186
QWEN3VL_MODEL_PATH = "Qwen/Qwen3-VL-4B-Instruct"
187
188
189
+def _enable_deterministic_lora_shrink(monkeypatch: pytest.MonkeyPatch) -> None:
190
+ # These tests assert exact greedy outputs. Force the Triton LoRA shrink
191
+ # kernel to use SPLIT_K=1 so it stores the complete reduction directly
192
+ # instead of accumulating split-K partial results with atomic_add. This
193
+ # targets reduction determinism, not full batch invariance.
194
+ monkeypatch.setenv("VLLM_BATCH_INVARIANT", "1")
195
+ # The kernel configuration reads VLLM_BATCH_INVARIANT at import time.
196
+ # Spawn the engine process so it observes this setting even if the LoRA
197
+ # Triton utilities were already imported during test collection.
198
+ monkeypatch.setenv("VLLM_WORKER_MULTIPROC_METHOD", "spawn")
199
+
200
+
201
def test_qwen2vl_lora(qwen2vl_lora_files):
202
"""Test Qwen 2.0 VL model with LoRA"""
203
config = TestConfig(model_path=QWEN2VL_MODEL_PATH, lora_path=qwen2vl_lora_files)
@@ -250,7 +262,12 @@ def test_qwen25vl_vision_lora(qwen25vl_vision_lora_files):
262
)
263
264
253
-def test_qwen3vl_vision_lora(qwen3vl_vision_lora_files):
265
+def test_qwen3vl_vision_lora(
266
+ qwen3vl_vision_lora_files,
267
+ monkeypatch: pytest.MonkeyPatch,
268
+):
269
+ _enable_deterministic_lora_shrink(monkeypatch)
270
+
271
config = TestConfig(
272
model_path=QWEN3VL_MODEL_PATH,
273
lora_path=qwen3vl_vision_lora_files,
@@ -273,6 +290,7 @@ def test_qwen2vl_multiple_lora_types(
290
qwen2vl_language_lora_files,
291
qwen2vl_vision_tower_connector_lora_files,
292
qwen2vl_vision_tower_lora_files,
293
+ monkeypatch: pytest.MonkeyPatch,
294
):
295
"""
296
Test multiple LoRA adapter types (language, vision tower + connector,
@@ -283,6 +301,8 @@ def test_qwen2vl_multiple_lora_types(
301
the multimodal encoder cache correctly manages state transitions between
302
language-only and vision-enabled LoRA adapters.
303
"""
304
+ _enable_deterministic_lora_shrink(monkeypatch)
305
+
306
config = TestConfig(
307
model_path=QWEN2VL_MODEL_PATH,
308
# We'll override the lora_path for each specific test, but need to provide