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

Dynamic memory management preset + updated wgpu buffer memory management #1962

Merged
merged 11 commits into from
Jul 4, 2024

Conversation

nathanielsimard
Copy link
Member

@nathanielsimard nathanielsimard commented Jul 3, 2024

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.

@nathanielsimard nathanielsimard changed the title Feat/mm/preset Dynamic Memory Management Preset + Updated WGPU buffer memory management Jul 3, 2024
@nathanielsimard nathanielsimard changed the title Dynamic Memory Management Preset + Updated WGPU buffer memory management Dynamic memory management preset + updated wgpu buffer memory management Jul 3, 2024
Copy link
Contributor

@mepatrick73 mepatrick73 left a 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.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 85.50725% with 20 lines in your changes missing coverage. Please review.

Project coverage is 85.64%. Comparing base (d696d74) to head (7c985a4).
Report is 4 commits behind head on main.

Files Patch % Lines
...ates/burn-compute/src/memory_management/dynamic.rs 83.52% 14 Missing ⚠️
...-compute/src/memory_management/memory_pool/base.rs 78.94% 4 Missing ⚠️
...-compute/src/memory_management/memory_pool/ring.rs 83.33% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@nathanielsimard nathanielsimard merged commit 51aea94 into main Jul 4, 2024
15 checks passed
@nathanielsimard nathanielsimard deleted the feat/mm/preset branch July 4, 2024 20:47
@mosure
Copy link
Contributor

mosure commented Jul 10, 2024

it is unclear if a change in this PR introduces this behavior but after migrating from 71bd5efbfaf220b5058dbf4f963326e0b0d38527 to 69be99b802dc35d6eafbf49611776575f0ef906e, I see this assert panic:

thread 'main' panicked at .\burn-178c6829f420dae1\69be99b\crates\burn-compute\src\memory_management\memory_pool\small.rs:123:9:
assertion `left == right` failed
  left: 0
 right: 32
    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
    }

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.

3 participants