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

Half Precision implemented for Low VRAM GPUs #127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cperales
Copy link

@cperales cperales commented Feb 6, 2022

Hi there!!

First of all, amazing job with your library. It achieves great results, and it is not difficult to implement.

I have several laptops, and I could run this and DeepDaze on my new laptop, but I couldn't run BigSleep on my old computer, with a GPU GTX 1050 with 4 GB of VRAM.

So I decided to implement a boolean parameter that reduces the precision of the model in the train_step method. Besides, I added another parameter, image_folder. This parameter can be a string, naming the folder where to save the images.

@lucidrains
Copy link
Owner

@cperales oh hey Carlos! this looks great! ❤️ do you want to try extending this to the CLI as well?

@cperales
Copy link
Author

Well, I am not so sure about how to do it... Is it enough if I modifed the file cli.py, adding the options to train function?

@cperales
Copy link
Author

Btw, I found out that, better that some code can be simplified with context with torch.cuda.amp.autocast():.

https://spell.ml/blog/mixed-precision-training-with-pytorch-Xuk7YBEAACAASJam

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

Successfully merging this pull request may close these issues.

None yet

2 participants