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

[engine] fixed empty op hook check #1096

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

FrankLeeeee
Copy link
Contributor

Fixed #1095 . The bug in the issue is because that empty hooks are registered on the modules and these hooks seem to incur extra memory, perhaps there are some underlying tensor cloning. With this PR, this bug can be fixed. Some experiment results are shown below.

Model: ResNet101
Dataset: CIFAR10 (resize to 224)
Optim: Adam
Batch size: 128
#GPU: 1

Experiment Max CUDA memory allocated / GB
without engine 8.25
with engine (before fix) 16.49
with engine (after fix) 8.25

@FrankLeeeee FrankLeeeee merged commit 7f2d2b2 into hpcaitech:main Jun 10, 2022
@FrankLeeeee FrankLeeeee deleted the hotfix/engine-hook branch June 13, 2022 02:07
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.

[BUG]: Memory consumption by fp16 is not normal when using Engine.
2 participants