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

Low CPU and GPU usage in training sde_gan, Seeking Help to Improve Performance. #128

Open
maybemind opened this issue Apr 16, 2023 · 2 comments

Comments

@maybemind
Copy link

The CPU core is not fully used, as in the following screenshot.

image

The GPU is not fully used as well, as in the following screenshot.

image

In fact, when I previously run the sde_gan.py on my laptop with 2070maxq, the expected time is about 3:40 to 4 hours; when run on 3900x/4090, it is 2:30 to 3 hours.

The change is not significant, and the resources are not fully used as shown in above figs. What should I do if I want it trained faster?

I also try to choose a larger batch size. It is weird that nothing happend.

image

image

Is the bottleneck elsewhere?

@patrick-kidger
Copy link
Collaborator

One thing you could try is to switch to Diffrax. By taking advantage of JAX's JIT compiler, then this can sometimes be substantially faster than torchsde. (Probably due to reduced Python overhead and fewer memory allocations.)

In particular you can find an SDE-GAN example in the documentation here.

Other than that, I don't have any strong recommendations. Neural SDEs were a topic we never really finished with. I think maximising computational efficiency (amongst other things) remains an open research question for them.

@maybemind
Copy link
Author

Thanks,that's helpful, I'll refer to that

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

2 participants