[RL] Release weight-transfer communicators without stopping inference (#61060)

Signed-off-by: aoshen02 <aoshen@inferact.ai>
Signed-off-by: fh3 <a@b>
This commit is contained in:
aoshen02
2026-10-11 21:15:14 +08:00
committed by GitHub
parent c85616efc6
commit bd5bbce6e4
22 changed files with 181 additions and 14 deletions
@@ -89,6 +89,11 @@ def test_invalid_field_is_rejected_before_the_engine(client, path, body):
("/update_weights", {"update_info": {"names": []}}, "update_weights"),
("/update_weights", {"update_info": [{}, {}]}, "update_weights"),
("/collective_rpc", {"method": "m"}, "collective_rpc"),
(
"/shutdown_weight_transfer_engine",
{},
"shutdown_weight_transfer_engine",
),
],
)
def test_valid_body_reaches_the_engine(client, path, body, engine_call):
@@ -169,6 +169,13 @@ def test_init_weight_transfer_engine_calls_engine(vllm_runner):
assert called, "init_transfer_engine should have been called"
assert param == "hello", f"Expected 'hello', got {param}"
llm.shutdown_weight_transfer_engine()
assert all(
llm.collective_rpc(
lambda worker: worker.weight_transfer_engine.shutdown_called
)
)
@create_new_process_for_each_test()
def test_update_weights_calls_engine(vllm_runner):
@@ -75,6 +75,7 @@ def test_record_releases_in_flight_and_observes_duration(registry, fail):
"operation,route,body",
[
("init", api_router.init_weight_transfer_engine, {"init_info": {}}),
("shutdown", api_router.shutdown_weight_transfer_engine, None),
("start", api_router.start_weight_update, None),
("start_draft", api_router.start_draft_weight_update, None),
("update", api_router.update_weights, {"update_info": {}}),