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

Feature/reduce-decoder-mem-usage #84

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

cathalobrien
Copy link

This change increases the memory saved from using chunking in the mapper. At the moment we use two arrays to accumulate chunks, this replaces it with a single array. At 9km this reduces peak memory usage by 6GB.

Below I have pictures of memory usage during the chunking part of the decoder at 9km

Before

Screenshot 2024-11-21 at 13 55 24

Notice the zig-zag pattern. This is from the 'out1' tensor being constantly created and freed each chunk.

After

Screenshot 2024-11-21 at 13 55 37

Now the zig-zag pattern is gone and peak memory usage has decreased by 6GB

declare an empty accum tensor outside the for loop. the old way of having out and out1 results in two copies of the array which results in more memory use. at 9km this added 6gb to peak mem usage
@FussyDuck
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (1a50508) to head (a81ab4e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #84   +/-   ##
========================================
  Coverage    99.85%   99.85%           
========================================
  Files           23       23           
  Lines         1350     1350           
========================================
  Hits          1348     1348           
  Misses           2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@cathalobrien cathalobrien self-assigned this Nov 21, 2024
@ssmmnn11
Copy link
Member

great work. Is this from a training run or inference run?

@cathalobrien
Copy link
Author

great work. Is this from a training run or inference run?

Inference. Havent tried in training bc this only happens when num_chunks > 1

@ssmmnn11
Copy link
Member

Absolutely, would be just interesting to check.

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.

4 participants