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

Revert "Update mosaic_fsdp_utils.py" #3187

Merged
merged 1 commit into from
Apr 12, 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
11 changes: 8 additions & 3 deletions composer/trainer/mosaic_fsdp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ def _get_process_group(pg, process_group_cache=None):
return process_group_cache[ranks]

log.info(f'Instantiating custom process groups with {ranks=} on rank={dist.get_global_rank()}.')
process_group = distributed.new_group(ranks)

ranks_per_subgroup_list = list(set(dist.all_gather_object(ranks)))
(
current_group,
_subgroups,
) = distributed.distributed_c10d.new_subgroups_by_enumeration(ranks_per_subgroup_list)

if process_group_cache is not None:
process_group_cache[ranks] = process_group
return process_group
process_group_cache[ranks] = current_group
return current_group


def _set_custom_fsdp_module_kwargs(module_kwargs: Dict, process_group_cache: Dict[Tuple[int], Any]) -> Dict:
Expand Down
Loading