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

Efficient ad reduced memory footprint #1340

Merged

Conversation

MG109
Copy link
Contributor

@MG109 MG109 commented Sep 12, 2023

Description

I ran into an OutOfMemory exception when calculating the teacher channel mean and standard deviation while training the EfficientAD model. I fixed this by not saving the teacher outputs to a list but instead iterating the dataloader twice.

Changes

Describe the changes you made
  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which refactors the code base)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

Ensure that you followed the following
  • I have added a summary of my changes to the CHANGELOG (not for minor changes, docs and tests).
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas (If applicable)
  • I have made corresponding changes to the documentation (If applicable)
  • I have added tests that prove my fix is effective or that my feature works (If applicable)

MG109 and others added 3 commits July 26, 2023 13:24
Workaround loops over dataset twice: no need to save teacher_outputs (which needs much GPU memory for large datasets)
@MG109 MG109 requested a review from samet-akcay as a code owner September 12, 2023 06:18
@samet-akcay
Copy link
Contributor

@alexriedel1, would you like to review this PR?

@alexriedel1
Copy link
Contributor

alexriedel1 commented Sep 12, 2023

@alexriedel1, would you like to review this PR?

Sure! I would prefer to only use one method without going for the try except. So just implement the twice iterating method as Standard @MG109

@alexriedel1
Copy link
Contributor

looks good to me!

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@samet-akcay samet-akcay merged commit 816841c into openvinotoolkit:main Sep 18, 2023
@MG109 MG109 deleted the efficient_ad_reduced_memory_footprint branch September 18, 2023 11:42
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.

[Task]: EfficientAD OutOfMemory exception (fix included)
3 participants