Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def update_weights(self) -> None:

if dist.get_rank() == 0:
ray.get([engine.pause_generation.remote() for engine in self.rollout_engines])
ray.get([engine.flush_cache.remote() for engine in self.rollout_engines])
if not getattr(self.args, "keep_cache_on_weight_update", False):
ray.get([engine.flush_cache.remote() for engine in self.rollout_engines])

# int4/fp4 pre_process
if self.quantization_config and self.quantization_config["quant_method"] in ["compressed-tensors"]:
Expand Down
6 changes: 6 additions & 0 deletions slime/utils/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ def add_rollout_arguments(parser):
default=1,
help="Interval for updating the weights",
)
parser.add_argument(
"--keep-cache-on-weight-update",
action="store_true",
default=False,
help="If set, skip flushing the rollout engine cache during weight updates.",
)
parser.add_argument(
"--keep-old-actor",
action="store_true",
Expand Down