[Rebase] Align vLLM-Omni with vLLM v0.31.0 (#8459)
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
1f47fa2f29
commit
0b0d2d7009
141 files changed
+2885
-721
No files matched your search
@@ -3,6 +3,7 @@
|
||||
|
||||
import contextlib
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
@@ -22,6 +23,23 @@ class _StopExecutionError(Exception):
|
||||
"""Halts execute_model at the model boundary."""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("randomize_inputs", [False, True])
|
||||
def test_generation_profile_accepts_upstream_randomize_inputs(randomize_inputs):
|
||||
"""Release workers can pass the profiling flag to codec-stage runners."""
|
||||
runner = object.__new__(GPUGenerationModelRunner)
|
||||
runner.supports_mm_inputs = False
|
||||
runner.max_num_tokens = 128
|
||||
runner.encoder_cache = {"temporary": object()}
|
||||
runner._dummy_run = Mock(return_value=(torch.zeros(1), None))
|
||||
runner._sync_device = Mock()
|
||||
|
||||
runner.profile_run(randomize_inputs=randomize_inputs)
|
||||
|
||||
runner._dummy_run.assert_called_once_with(128, is_profile=True, randomize_inputs=randomize_inputs)
|
||||
runner._sync_device.assert_called_once_with()
|
||||
assert runner.encoder_cache == {}
|
||||
|
||||
|
||||
class _DummyInputBatch:
|
||||
def __init__(self, num_reqs: int = 1):
|
||||
self.req_ids = [f"req-{i + 1}" for i in range(num_reqs)]
|
||||
|
||||
@@ -15,8 +15,8 @@ pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||
def test_dispatch_eager_and_manager_paths(monkeypatch, dp_size):
|
||||
runner = object.__new__(OmniGPUModelRunner)
|
||||
runner.cudagraph_manager = None
|
||||
runner.dp_size = dp_size
|
||||
runner.dp_rank = 1
|
||||
runner.parallel_config = SimpleNamespace(data_parallel_size=dp_size, data_parallel_rank=1)
|
||||
runner.dp_size, runner.dp_rank = dp_size, 1
|
||||
|
||||
import vllm.v1.worker.gpu.dp_utils as dp_utils
|
||||
|
||||
@@ -52,6 +52,7 @@ def test_dispatch_eager_and_manager_paths(monkeypatch, dp_size):
|
||||
return expected
|
||||
|
||||
runner.cudagraph_manager = SimpleNamespace(dispatch=dispatch)
|
||||
runner.parallel_config.data_parallel_size = 1
|
||||
runner.dp_size = 1
|
||||
batch_desc, _ = runner._dispatch_batch_descriptor(
|
||||
num_reqs=1, num_toks=8, uniform_tok_count=8, num_active_loras=0, use_eager=False, max_query_len=8
|
||||
|
||||
Reference in new issue
Block a user