Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] move ask for live reco #158

Merged
merged 2 commits into from
Nov 13, 2024
Merged
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
8 changes: 5 additions & 3 deletions src/zeroband/comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def __init__(

# Logging
self._optimize_ring_ranks()
if self.live_recovery_rank_src is not None:
self.live_recovery.ask_for_live_ckpt(self.live_recovery_rank_src)
self.global_pg.barrier().wait()

self._logger.info(f"global_pg size : {self.global_pg.size()}, local_pg size: {self.local_pg.size()}")

def __del__(self):
Expand Down Expand Up @@ -263,9 +267,6 @@ def _init_global_pg(self) -> None:
self.global_status = "running"
self._last_resolved_time = self.global_store.get("resolved_time").decode("utf-8")

if self.live_recovery_rank_src is not None:
self.live_recovery.ask_for_live_ckpt(self.live_recovery_rank_src)

self._start_heartbeat()

self._logger.info(
Expand Down Expand Up @@ -421,6 +422,7 @@ def maybe_reinit_global_pg(self, admit_joiners: bool = False) -> bool:
try:
self._create_global_pg()
self._optimize_ring_ranks()
self.global_pg.barrier().wait()
except Exception as e:
self._logger.error(f"Error recreating process group: {e}. Retrying...")
return self.maybe_reinit_global_pg(admit_joiners=admit_joiners)
Expand Down