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 load for non-HSDP device mesh #2997

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Changes from 2 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
4 changes: 3 additions & 1 deletion composer/utils/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def __init__(self, source_path: str, destination_path: str, object_store: Union[
super().__init__(destination_path)

def read_data(self, plan: LoadPlan, planner: LoadPlanner):
first_replica = self.device_mesh is None or self.device_mesh.get_local_rank(mesh_dim=0) == 0
# Download files if not using HSDP or if on first replica with HSDP enabled
first_replica = self.device_mesh is None or self.device_mesh.ndim >= 2 and self.device_mesh.get_local_rank(
mvpatel2000 marked this conversation as resolved.
Show resolved Hide resolved
mesh_dim=0) == 0

# 1. Download to the destination all files this rank needs if on first replica
if first_replica:
Expand Down
Loading