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

BN memory usage #8

Closed
WANGSSSSSSS opened this issue Jul 29, 2022 · 1 comment
Closed

BN memory usage #8

WANGSSSSSSS opened this issue Jul 29, 2022 · 1 comment

Comments

@WANGSSSSSSS
Copy link

Hello, impressed by your block squeezing and block linearization idea, but the memory usage of bn implemented by pytorch is some kind of weird, which is not IN-PLACE, which allocates an input tensor size memory buffer for output, thus doubles the memory consumption. please refer to https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/cudnn/BatchNorm.cpp so i think your comparison is not fair, to some extent.

@JUGGHM
Copy link
Owner

JUGGHM commented Aug 1, 2022

Thanks for your interest WangS! I agree that in-place BN layers are more memory-efficient. When we were conducting this work we followed the implementations of Ding etal's and didn't take in-place BN layers into consideration, neither in DBB/RepVGG nor ours. This surely leads to higher extra memory to a severer extent for DBB. However, I could not provide results for in-placed variants currently since I am working on some other projects now.

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