[Refactor][CI] Reorganize test tree, and move slow e2e to weekly (#4951)
Signed-off-by: wangyu <410167048@qq.com>
This commit is contained in:
1 parent
925347332f
commit
7c17111ff5
158 files changed
+3479
-4130
No files matched your search
@@ -14,6 +14,7 @@ import torch
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
import vllm_omni.diffusion.diffusion_engine as diffusion_engine_module
|
||||
from tests.helpers.mark import hardware_test
|
||||
from vllm_omni.diffusion.data import DiffusionOutput, OmniDiffusionConfig
|
||||
from vllm_omni.diffusion.diffusion_engine import (
|
||||
DiffusionEngine,
|
||||
@@ -30,6 +31,8 @@ from vllm_omni.diffusion.sched.interface import (
|
||||
)
|
||||
from vllm_omni.inputs.data import OmniDiffusionSamplingParams
|
||||
|
||||
pytestmark = [pytest.mark.core_model, pytest.mark.diffusion]
|
||||
|
||||
|
||||
@dataclass
|
||||
class DiffusionSchedulerOutput:
|
||||
@@ -56,6 +59,8 @@ class MockScheduler:
|
||||
def __init__(self):
|
||||
self._waiting_queue = []
|
||||
self._step_id = 0
|
||||
# Match RequestScheduler API used by request-batch admission wait.
|
||||
self.max_num_running_reqs = 5
|
||||
|
||||
def add_request(self, request):
|
||||
self._waiting_queue.append(request)
|
||||
@@ -64,6 +69,12 @@ class MockScheduler:
|
||||
def has_requests(self):
|
||||
return len(self._waiting_queue) > 0
|
||||
|
||||
def num_waiting_requests(self) -> int:
|
||||
return len(self._waiting_queue)
|
||||
|
||||
def num_running_requests(self) -> int:
|
||||
return 0
|
||||
|
||||
def schedule(self) -> DiffusionSchedulerOutput:
|
||||
if not self._waiting_queue:
|
||||
return DiffusionSchedulerOutput(step_id=self._step_id)
|
||||
@@ -582,9 +593,7 @@ def test_move_tensor_tree_returns_non_tensor_values_unchanged() -> None:
|
||||
assert moved is value
|
||||
|
||||
|
||||
@pytest.mark.diffusion
|
||||
@pytest.mark.cuda
|
||||
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA required")
|
||||
@hardware_test(res={"cuda": "L4"}, num_cards=1)
|
||||
def test_move_tensor_tree_moves_nested_cuda_tensors_to_cpu() -> None:
|
||||
tensor = torch.arange(8, dtype=torch.float32, device="cuda")
|
||||
other = torch.arange(4, dtype=torch.int64, device="cuda")
|
||||
@@ -610,6 +619,7 @@ async def _consume_final_output(generator):
|
||||
return final_output
|
||||
|
||||
|
||||
@pytest.mark.cpu
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_add_req_and_stream_response():
|
||||
engine = object.__new__(DiffusionEngine)
|
||||
@@ -621,13 +631,24 @@ async def test_async_add_req_and_stream_response():
|
||||
engine._cv = threading.Condition(engine._rpc_lock)
|
||||
engine._init_lock = asyncio.Lock()
|
||||
engine._closed = False
|
||||
engine.od_config = SimpleNamespace(streaming_output=False)
|
||||
# Enable admission wait so concurrent adds land in one schedule wave;
|
||||
# otherwise the first request can execute alone (~1s) and the rest in a
|
||||
# second wave (~2s), failing the latency-spread assertion.
|
||||
engine.od_config = SimpleNamespace(
|
||||
streaming_output=False,
|
||||
request_batch_max_wait_ms=500.0,
|
||||
)
|
||||
engine._loop_started = False
|
||||
engine.main_loop = None
|
||||
engine.supports_request_batch = False
|
||||
engine.supports_request_batch = True
|
||||
engine.step_execution = False
|
||||
engine.execution_mode = DiffusionExecutionMode.REQUEST_BATCH
|
||||
|
||||
engine._finalize_finished_request = lambda rid, out, err: out.result
|
||||
def _finalize(rid, out, err=None):
|
||||
# Stream consumers stop on ``finished``; keep result_data for assertions.
|
||||
return SimpleNamespace(result_data=out.result.result_data, finished=True)
|
||||
|
||||
engine._finalize_finished_request = _finalize
|
||||
|
||||
def mock_execute_batch(sched_output):
|
||||
request_ids = sched_output.scheduled_request_ids
|
||||
|
||||
Reference in new issue
Block a user