Found a Bug with going_modular.data_setup.create_dataloaders! #1047
luxexistentia
started this conversation in
General
Replies: 1 comment
-
Hi @luxexistentia , Great find! Thank you for sharing. This is interesting as I've found on different hardware tweaking the Good work troubleshooting this though. Perhaps your CPU is best when using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my env: Local Window PC with Ryzen5600x & rtx3070 & pytorch2.4.0
I was using the going_modular files and I didn't know why but it took too long to train/test models and gpu usage was almost 0% while cpu is almost 100% constantly, even tho device was set to "cuda".
But fortunately I found out what the problem was. It was problem with dataloader. I tried different number of num_workers manually and If it was set to 0, It seems like automatically pytorch optimize multi threading.
So In my test, By changing num_workers=0, speed to load a batch(32 imgs) went from 8.26 s ± 253 ms per loop -> 111 ms ± 7.13 ms per loop Around 74.5X Faster
And while Cpu reaching under 30%. And finally my training time got so much faster and almost fully use my graphic card!(almost reach to 100% during training)
Conclusion: Changing dataloader setting can boost up around 75 times. So I hope you to change the file:)
Ps. Thanks for ur Lecture! I finished it and it helped me a lot!
Beta Was this translation helpful? Give feedback.
All reactions