Migrate VLM tests and remove unit-test-backend-1-gpu job (#16679)

This commit is contained in:
Alison Shao
2026-01-09 15:24:26 -08:00
committed by GitHub
parent 08636f72b5
commit ef35d8fe4e
5 changed files with 14 additions and 70 deletions
-5
View File
@@ -8,10 +8,6 @@ from sglang.test.ci.ci_utils import TestFile, run_unittest_files
# NOTE: please sort the test cases alphabetically by the test file name
suites = {
"per-commit-1-gpu": [
TestFile("test_evs.py", 20),
TestFile("test_video_utils.py", 5),
],
"per-commit-4-gpu": [
TestFile("models/test_qwen3_next_models.py", 650),
TestFile("test_gpt_oss_4gpu.py", 300),
@@ -91,7 +87,6 @@ suite_amd = {
TestFile("test_rope_rocm.py", 3),
# TestFile("test_torch_compile_moe.py", 210), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/13107
TestFile("test_type_based_dispatcher.py", 10),
TestFile("test_video_utils.py", 8),
# Disabled temporarily
# TestFile("test_vlm_input_format.py", 300),
# TestFile("openai_server/features/test_openai_server_hidden_states.py", 240),
-56
View File
@@ -1,56 +0,0 @@
from dataclasses import asdict, dataclass
from types import SimpleNamespace
import pytest
from sglang.test.test_utils import run_doctests
def test_resolve_evs_config():
from sglang.srt.multimodal.evs import EVS, EVSConfig, EVSProcessor
@dataclass(frozen=True, kw_only=True)
class EVSModelConfig:
video_pruning_rate: float = 0.1
spatial_merge_size: int = 2
class EVSModel(EVS):
@staticmethod
def create_evs_config(hf_config: EVSModelConfig) -> EVSConfig:
return EVSConfig(
video_pruning_rate=hf_config.video_pruning_rate,
spatial_merge_size=hf_config.spatial_merge_size,
)
processor = EVSProcessor(
hf_config=EVSModelConfig(spatial_merge_size=3),
config_to_evs_model={EVSModelConfig: EVSModel},
)
expected = EVSConfig(video_pruning_rate=0.1, spatial_merge_size=3)
assert asdict(processor.evs_config) == asdict(expected)
# No EVS for pruning rate 0.0
processor = EVSProcessor(
hf_config=EVSModelConfig(video_pruning_rate=0.0),
config_to_evs_model={EVSModelConfig: EVSModel},
)
assert processor.evs_config is None
# No EVS for non-EVS config
processor = EVSProcessor(
hf_config=SimpleNamespace(),
config_to_evs_model={EVSModelConfig: EVSModel},
)
assert processor.evs_config is None
def test_replace_offsets_with_tokens_per_frame():
from sglang.srt.multimodal.evs.evs_core import replace_offsets_with_tokens_per_frame
run_doctests(replace_offsets_with_tokens_per_frame)
if __name__ == "__main__":
import sys
sys.exit(pytest.main([__file__]))
-61
View File
@@ -1,61 +0,0 @@
from dataclasses import dataclass
import pytest
from sglang.srt.utils import sample_video_frames
class DummyVideo:
def __init__(self, total_frames: int, avg_fps: float):
self._frames = total_frames
self._fps = avg_fps
def __len__(self):
return self._frames
def get_avg_fps(self):
return self._fps
@dataclass(kw_only=True)
class Case:
frames: int
avg_fps: float
desired_fps: int
max_frames: int
expected_frames: list[int]
description: str
# fmt: off
@pytest.mark.parametrize("case", [
Case(
frames=100, avg_fps=25.0, desired_fps=5, max_frames=200,
expected_frames=[0, 5, 10, 15, 20, 26, 31, 36, 41, 46, 52, 57, 62, 67, 72, 78, 83, 88, 93, 99],
description="capped by desired_fps"
),
Case(
frames=10, avg_fps=10.0, desired_fps=100, max_frames=5,
expected_frames=[0, 2, 4, 6, 9],
description="capped by max_frames"
),
Case(
frames=50, avg_fps=25.0, desired_fps=50, max_frames=200,
expected_frames=list(range(50)),
description="capped by total_frames"
),
Case(
frames=1, avg_fps=30.0, desired_fps=0, max_frames=0,
expected_frames=[0],
description="always sample at least 1 frame"
)
], ids=lambda c: c.description)
def test_sample_video_frames_lengths(case: Case):
video = DummyVideo(case.frames, case.avg_fps)
result = sample_video_frames(video, desired_fps=case.desired_fps, max_frames=case.max_frames)
assert result == case.expected_frames
if __name__ == "__main__":
import sys
sys.exit(pytest.main([__file__]))