[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:
@@ -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)."""
|
||||
|
||||
Reference in New Issue
Block a user