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

[BUG] Gather Stat is not working for DeepSpeed? #960

Closed
allanj opened this issue Nov 6, 2023 · 5 comments
Closed

[BUG] Gather Stat is not working for DeepSpeed? #960

allanj opened this issue Nov 6, 2023 · 5 comments

Comments

@allanj
Copy link
Contributor

allanj commented Nov 6, 2023

I guess the issue is mainly caused by this line:

self.is_distributed = self.accelerator.distributed_type == "MULTI_GPU"

The self.accelerator.distributed_type is DEEPSPEED when I use DeepSpeed Zero stage 2 with accelerate.

It works when I change this line to

self.is_distributed = self.accelerator.distributed_type == "MULTI_GPU"  or self.accelerator.distributed_type == "DEEPSPEED"

But I think, to make this more general, we can try something like

self.is_distributed = self.accelerator.num_process > 1

Any suggestions?

@seanexp
Copy link
Contributor

seanexp commented Nov 12, 2023

looks like a valid fix to me! 👍

@allanj
Copy link
Contributor Author

allanj commented Nov 13, 2023

maybe I will try to make a pull request for this. Also, I feel like there are some redundant for loop that we can avoid in the code

@younesbelkada
Copy link
Contributor

Hi everyone, yes this looks like a reasonable change, would you be happy to open a quick PR for it?

@allanj
Copy link
Contributor Author

allanj commented Nov 15, 2023

Hi everyone, yes this looks like a reasonable change, would you be happy to open a quick PR for it?

I have created the simple PR fix. Please help review: #997

Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

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

3 participants