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
PyTorch: improve memory-efficiency in batched non-shuffle buffer #762
Conversation
bef1fc1
to
3a0911e
Compare
Codecov Report
@@ Coverage Diff @@
## master #762 +/- ##
==========================================
- Coverage 86.27% 86.26% -0.01%
==========================================
Files 85 85
Lines 5084 5081 -3
Branches 785 783 -2
==========================================
- Hits 4386 4383 -3
Misses 559 559
Partials 139 139
Continue to review full report at Codecov.
|
b221591
to
6884b3a
Compare
@selitvin Can you take a look? |
Updated PR:
|
904ad1c
to
e5620b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Please add a line to release notes. Perhaps we can improve the _batch_i
variable name?
|
||
def test_batched_noop_shuffling_buffer(): | ||
"""Check intermediate status of batched non-shuffling buffer""" | ||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the import to the top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is out-dated test from previous commit.
self.store.append(batch) | ||
self._buffer = [] | ||
self._done_adding = False | ||
self._batch_i = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a more self explanatory name instead of _batch_i? Something like first_unconsumed_row
or something along the lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with name and comments.
Avoid creating many copies in _make_batch(). Reuse same rowgroup to generate all available batches.
Avoid creating many copies in _make_batch().
Fix #763