-
Notifications
You must be signed in to change notification settings - Fork 440
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
Dynamic memory management preset + updated wgpu buffer memory management #1962
Conversation
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 to me! Maybe when we do chunk removal, we don't want to reset the cursor_chunk to 0, but for now I think it's fine.
passing min_size_buffer_alignment_offset as an argument to MM, and querying the device to find the value on different platforms
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1962 +/- ##
==========================================
+ Coverage 85.23% 85.64% +0.41%
==========================================
Files 810 810
Lines 99753 100154 +401
==========================================
+ Hits 85022 85776 +754
+ Misses 14731 14378 -353 ☔ View full report in Codecov by Sentry. |
e39584a
to
7c985a4
Compare
it is unclear if a change in this PR introduces this behavior but after migrating from
fn allocate_slice(&self, handle_chunk: ChunkHandle, slice_size: usize) -> SmallSlice {
let slice = self.create_slice(0, slice_size, handle_chunk.clone());
let effective_size = slice.effective_size();
assert_eq!(effective_size, self.buffer_storage_alignment_offset);
slice
} |
It's now more stable and much faster. The maximum memory usage is probably higher than before, but this is because it shows the maximum amount of memory used by the GPU, not the current amount. There is no deallocation, and we allocate in a way that is fragmentation-friendly for better speed, possibly at the cost of slightly higher maximum memory usage.