move empty cache

This commit is contained in:
YeAnbang 2025-04-10 10:22:43 +08:00
parent f7e532511c
commit 1723a02860

View File

@ -129,6 +129,7 @@ class BaseConsumer:
if episode != self.num_episodes - 1 or step != self.num_update_per_episode - 1:
print(f"[T{dist.get_rank()}] Sync model episode {episode} step {step}")
torch.cuda.empty_cache()
state_dict = self.state_dict()
if self.rank == 0:
ray_broadcast_tensor_dict(