From 25985e616ce921796ee1d36f8726e5f9efc0f870 Mon Sep 17 00:00:00 2001 From: Hazen Date: Mon, 20 Jul 2026 22:47:34 +0800 Subject: [PATCH] fix: restore actor weights after initialization In async non-colocate mode, loading the reference checkpoint can leave the ref model active because actor restoration is guarded by offload_train. This causes the first update_weights() call after resume to broadcast reference weights instead of the resumed actor weights. Restore the actor model after initialization regardless of offload_train, while keeping sleep() conditional on offload_train. --- slime/backends/megatron_utils/actor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slime/backends/megatron_utils/actor.py b/slime/backends/megatron_utils/actor.py index fd5027645..8b0424fab 100644 --- a/slime/backends/megatron_utils/actor.py +++ b/slime/backends/megatron_utils/actor.py @@ -183,9 +183,10 @@ def init( # empty cache after initialization clear_memory() - if self.args.offload_train: - # recover to actor in the end. + if self._active_model_tag != "actor": self._switch_model("actor") + + if self.args.offload_train: self.sleep() self.rollout_engines = None