[Core][Frontend] Add weight version tagging for RL rollouts (#49040)

Signed-off-by: Shuolei Wang <shuoleiwang123@gmail.com>
Signed-off-by: Shuolei Wang <948904026@qq.com>
This commit is contained in:
Shuolei Wang
2026-07-28 14:35:29 +08:00
committed by GitHub
parent 90245f4190
commit 9069a57139
16 changed files with 142 additions and 18 deletions
+8 -1
View File
@@ -1247,7 +1247,7 @@ class RecordingClient:
self.order.append("update")
self.last_update_info = update_info
def finish_weight_update(self) -> None:
def finish_weight_update(self, weight_version: str | None = None) -> None:
self.order.append("finish")
@@ -1303,6 +1303,10 @@ class TestTrainerClients:
assert isinstance(update_req, WeightTransferUpdateRequest)
assert update_req.update_info == {"names": ["w"]}
client.finish_weight_update("step-42")
handle.finish_weight_update.remote.assert_called_once_with()
handle.update_weight_version.remote.assert_called_once_with("step-42")
def test_http_client_pickles_ipc_handles_for_json(self, monkeypatch):
"""HTTP update_weights must encode raw ipc_handles as a base64 pickle."""
captured = {}
@@ -1334,6 +1338,9 @@ class TestTrainerClients:
client.update_weights(update_info)
assert captured["json"]["update_info"] == update_info
client.finish_weight_update("step-42")
assert captured["json"] == {"weight_version": "step-42"}
class TestModuleSource:
"""`ModuleSource` metadata vs. materialized iteration (dense, no GPU)."""