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

Reversible layers increase memory usage #142

Open
serkansulun opened this issue May 17, 2021 · 1 comment
Open

Reversible layers increase memory usage #142

serkansulun opened this issue May 17, 2021 · 1 comment

Comments

@serkansulun
Copy link

I'm checking memory usage using nvidia-smi. When I turn on reversibility (setting reverse_thres to two times the input length) it's using 8.8 GB memory. When I turn it off (setting reverse_thres to half of the input length), it's using 3.1 GB memory, and it is (naturally) faster. But the memory part doesn't make sense. What can be the problem here?

@lzx325
Copy link

lzx325 commented May 15, 2022

Same issue observed here. Is it because that Pytorch autograd is smart enough to identify on itself that it does not need to remember everything to compute the gradients of the reversible layers? Therefore, using the customized _ReversibleFunction will not provide any advantage?

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