Files
sglang/test/registered/vlm/test_encoder_dp.py
T
Jimmy Shongandgemini-code-assist[bot] fa8985486e [test/fix]: isolate VLM MMMU eval output dirs to fix nightly-4-gpu cross-test pollution (#24623)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-08 15:01:53 -07:00

46 lines
1.4 KiB
Python

import random
import tempfile
import unittest
from types import SimpleNamespace
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
from sglang.test.kits.mmmu_vlm_kit import MMMUMultiModelTestBase
from sglang.test.test_utils import is_in_ci
register_cuda_ci(est_time=500, suite="nightly-4-gpu", nightly=True)
register_amd_ci(est_time=500, suite="nightly-amd-4-gpu", nightly=True)
MODELS = [
SimpleNamespace(model="Qwen/Qwen2.5-VL-72B-Instruct", mmmu_accuracy=0.55),
SimpleNamespace(model="Qwen/Qwen3-VL-32B-Instruct", mmmu_accuracy=0.55),
SimpleNamespace(model="OpenGVLab/InternVL2_5-8B", mmmu_accuracy=0.52),
SimpleNamespace(model="zai-org/GLM-4.1V-9B-Thinking", mmmu_accuracy=0.68),
]
class TestVLMEncoderDP(MMMUMultiModelTestBase):
# --cuda-graph-max-bs 32 last-wins over the kit's default 64.
other_args = [
"--mm-enable-dp-encoder",
"--tp=4",
"--cuda-graph-max-bs",
"32",
]
def test_vlm_mmmu_benchmark(self):
models_to_test = MODELS
if is_in_ci():
models_to_test = [random.choice(MODELS)]
for model in models_to_test:
# Per-model temp dir avoids cross-test cached results.
with tempfile.TemporaryDirectory(
prefix=f"encoder_dp_{model.model.replace('/', '_')}_"
) as output_path:
self._run_vlm_mmmu_test(model, output_path)
if __name__ == "__main__":
unittest.main()