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

Question about dist.barrier() use in diff_model_train.py #1933

Open
cbe135 opened this issue Jan 31, 2025 · 0 comments
Open

Question about dist.barrier() use in diff_model_train.py #1933

cbe135 opened this issue Jan 31, 2025 · 0 comments

Comments

@cbe135
Copy link

cbe135 commented Jan 31, 2025

Hi, there are two instances of dist.all_reduce() in diff_model_train.py.
One for scale_factor using ReduceOp.AVG, and one for loss_torch, using ReduceOp.SUM.
However, one uses dist.barrier() before dist.all_reduce() and one doesn't.

I have three short questions regarding this usage in this scenario.
1, Why is dist.barrier() not needed for loss_torch SUM?
2, Is there a reason why SUM is used instead of AVG for loss?
3, If iteration-level losses are added, should dist.barrier() be added for iteration-level loss dist.all_reduce(), SUM or AVG?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant