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

Log rank information #1068

Merged
merged 1 commit into from
Feb 27, 2025
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
13 changes: 12 additions & 1 deletion src/fairseq2/recipes/common/_gang.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,23 @@ def setup_gangs(context: RuntimeContext, recipe_config: object) -> Gangs:
log.info("Parallel gangs initialized.")

try:
return _maybe_setup_fsdp_gangs(context, recipe_config, gangs)
gangs = _maybe_setup_fsdp_gangs(context, recipe_config, gangs)
except GangError as ex:
raise ProgramError(
"The hybrid sharded data parallel gangs cannot set up. See the nested exception for details."
) from ex

s = (
f"Data: {gangs.dp.rank} | "
f"Data/Replicated: {gangs.rdp.rank} | "
f"Data/Sharded: {gangs.sdp.rank} | "
f"Tensor: {gangs.tp.rank}"
)

log.info("Process Ranks - {}", s)

return gangs


def _maybe_setup_fsdp_gangs(
context: RuntimeContext, recipe_config: object, gangs: Gangs
Expand Down
Loading