[Core] Cleanup Omni connector runtime and transfer backends (#5096)
Signed-off-by: spencerr221 <liubingyu62@gmail.com>
This commit is contained in:
1 parent
2cf5f57b3e
commit
dcf8b07d39
53 files changed
+349
-448
No files matched your search
@@ -110,7 +110,6 @@ class TestMixinAsyncChunkSendRecv(unittest.TestCase):
|
||||
|
||||
sender = MixinHost()
|
||||
sender.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0, async_chunk=True),
|
||||
)
|
||||
sender._omni_connector = connector
|
||||
@@ -147,7 +146,6 @@ class TestMixinAsyncChunkSendRecv(unittest.TestCase):
|
||||
|
||||
sender = MixinHost()
|
||||
sender.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0, async_chunk=True),
|
||||
)
|
||||
sender._omni_connector = connector
|
||||
@@ -180,7 +178,6 @@ class TestMixinKVCacheTransfer(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
kv_transfer_manager=mock_kvm,
|
||||
)
|
||||
@@ -202,7 +199,6 @@ class TestMixinKVCacheTransfer(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
kv_transfer_manager=mock_kvm,
|
||||
)
|
||||
@@ -219,7 +215,6 @@ class TestMixinKVCacheTransfer(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
kv_transfer_manager=mock_kvm,
|
||||
)
|
||||
@@ -257,7 +252,6 @@ class TestMixinKVCacheTransfer(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
kv_transfer_manager=mock_kvm,
|
||||
)
|
||||
@@ -281,7 +275,6 @@ class TestOmniConnectorOutput(unittest.TestCase):
|
||||
def test_output_aggregation(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
)
|
||||
|
||||
@@ -310,7 +303,6 @@ class TestMixinNoConnector(unittest.TestCase):
|
||||
def test_no_connector(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
)
|
||||
self.assertIsNone(host._omni_connector)
|
||||
@@ -336,7 +328,6 @@ class TestFinishedLoadReqsDrain(unittest.TestCase):
|
||||
def test_finished_load_reqs_flow_to_chunk_ready(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
)
|
||||
|
||||
@@ -389,7 +380,6 @@ class TestFullPayloadSendWithCustomFunc(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=0)
|
||||
@@ -424,7 +414,6 @@ class TestFullPayloadSendWithCustomFunc(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=0)
|
||||
@@ -453,7 +442,6 @@ class TestKVSentReqIdsAccumulation(unittest.TestCase):
|
||||
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(),
|
||||
kv_transfer_manager=mock_kvm,
|
||||
)
|
||||
@@ -488,7 +476,6 @@ class TestChunkStreamCompletedGuard(unittest.TestCase):
|
||||
def _make_host(self, stage_id: int = 1) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=stage_id, async_chunk=True),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=stage_id)
|
||||
@@ -587,7 +574,6 @@ class TestCleanupFinishedRequest(unittest.TestCase):
|
||||
def _make_host(self, stage_id: int = 1) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=stage_id, async_chunk=True),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=stage_id)
|
||||
@@ -771,7 +757,6 @@ class TestSendChunkCachesMapping(unittest.TestCase):
|
||||
"""send_chunk should cache the internal→external mapping."""
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0, async_chunk=True),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=0)
|
||||
@@ -802,7 +787,6 @@ class TestLocalPayloadCacheLifecycle(unittest.TestCase):
|
||||
def _make_host(self) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0),
|
||||
)
|
||||
host._omni_connector = MockConnector(stage_id=0)
|
||||
@@ -901,7 +885,6 @@ class TestTPAsyncChunkFanout(unittest.TestCase):
|
||||
def _make_host(self, rank: int) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=2, async_chunk=True, worker_type="gen"),
|
||||
)
|
||||
host._omni_connector = MagicMock()
|
||||
@@ -984,7 +967,6 @@ class TestKVTransferLifecycle(unittest.TestCase):
|
||||
def _make_host(self) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0),
|
||||
)
|
||||
return host
|
||||
@@ -1039,7 +1021,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_send_side_request_payload_not_cleared_before_payload_is_consumable(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=1, async_chunk=True, worker_type="ar"),
|
||||
)
|
||||
host._request_ids_mapping["r1"] = "r1"
|
||||
@@ -1063,7 +1044,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_payload_consumable_ignores_token_horizon_only_updates(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=1, async_chunk=True, worker_type="ar"),
|
||||
)
|
||||
payload = {
|
||||
@@ -1084,7 +1064,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_payload_consumable_accepts_decode_embeddings(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=1, async_chunk=True, worker_type="ar"),
|
||||
)
|
||||
payload = {
|
||||
@@ -1098,7 +1077,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_ar_metadata_only_followup_chunk_does_not_rewake_request(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=1, async_chunk=True, worker_type="ar"),
|
||||
)
|
||||
host._omni_connector = MagicMock()
|
||||
@@ -1138,7 +1116,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_non_ar_recv_does_not_overwrite_unconsumed_staged_chunk(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=2, async_chunk=True, worker_type="gen"),
|
||||
)
|
||||
host._omni_connector = MagicMock()
|
||||
@@ -1164,7 +1141,6 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
def test_non_ar_recv_waits_for_scheduler_handoff_before_fetching_next_chunk(self):
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=2, async_chunk=True, worker_type="gen"),
|
||||
)
|
||||
host._omni_connector = MagicMock()
|
||||
@@ -1208,7 +1184,7 @@ class TestAsyncPayloadLifecycle(unittest.TestCase):
|
||||
class TestRankAwareKVRouting(unittest.TestCase):
|
||||
def _make_host(self, *, from_tp: int, to_tp: int, local_rank: int) -> MixinHost:
|
||||
host = MixinHost()
|
||||
host.init_omni_connectors(vllm_config=None, model_config=_make_model_config(stage_id=1))
|
||||
host.init_omni_connectors(model_config=_make_model_config(stage_id=1))
|
||||
host._from_tp = from_tp
|
||||
host._to_tp = to_tp
|
||||
host._local_rank = local_rank
|
||||
@@ -1287,7 +1263,7 @@ class TestConnectorConfigValidation(unittest.TestCase):
|
||||
model_config.stage_connector_config = {"name": " "}
|
||||
|
||||
with self.assertRaisesRegex(RuntimeError, "missing connector name"):
|
||||
host.init_omni_connectors(vllm_config=None, model_config=model_config)
|
||||
host.init_omni_connectors(model_config=model_config)
|
||||
|
||||
|
||||
class _FailingConnector:
|
||||
@@ -1319,7 +1295,6 @@ class TestSendRetry(unittest.TestCase):
|
||||
def _make_sender(self, connector):
|
||||
sender = MixinHost()
|
||||
sender.init_omni_connectors(
|
||||
vllm_config=None,
|
||||
model_config=_make_model_config(stage_id=0, async_chunk=True),
|
||||
)
|
||||
sender._omni_connector = connector
|
||||
|
||||
Reference in new issue
Block a user