-
Notifications
You must be signed in to change notification settings - Fork 502
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
Global seed is the same for each GPU, in multi-GPU #195
Comments
Hi! Have you figured out any solution for this? I also find that multi-GPU training does not accelerate the training. |
The issue is that all gpus use the same seed inside the dataloader. Debug code:
Output:
Expected output: I am investigating this with @zqh0253 to check how to set seed differently in loading data. I set |
fixed this issue by PR: #212 |
As pointed out by @MrTornado24, the sampled noises are the same across different GPUs, which is not the expected behavior. We should check this. |
Could kindly clarify which noise you were referred to? Noised added to the latent during guidance or the random sampled cameras? I checked sampled cameras of my PR, it worked great. Did not check the noises added in latent. |
@guochengqian I think it's the noise added to the latent. Could you please check this too? |
I can do this but only late this week, has to work on some interviews. |
For debug purpose only, I added this line of code
under function I found my PR #212 works. The generated noise is different, the random noise generated is also different. I have been using the multi-gpu training (PR212) for weeks, works good. Note in #220, you rely on broadcasting to make model parameters the same across device. But in your current version broadcasting is only implemented for implicit-sdf in PR220. You might have to fix this. Or just use my PR212, which simply set random seed twice without doing anything else, in the first time using same random seed to init models and second time setting random seed different across devices before training to load different cameras and add different noise to latent. |
The same seed seems to be used by every GPU, so using multi-GPU produces the same result as just using 1.
Reproduction:
python launch.py --config configs/dreamfusion-if.yaml --train --gpu 0,1 system.prompt_processor.prompt="a zoomed out DSLR photo of a baby bunny sitting on top of a stack of pancakes" data.batch_size=2 data.n_val_views=4
The log indicates that all GPUs' global seed are set to the same value:
I also compared images produced in a run with 2 GPUs, with the ones produced in 1 GPU, and the images were identical.
The text was updated successfully, but these errors were encountered: