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

Refactor/burn compute #1580

Merged
merged 34 commits into from
Apr 23, 2024
Merged

Refactor/burn compute #1580

merged 34 commits into from
Apr 23, 2024

Conversation

nathanielsimard
Copy link
Member

Instead of a single handle we now have:

  • ID => Buf id
  • Tensor Buf Handle => keep track of the number of tensor pointing to a buffer.
  • Buf Handle => keep track of all reference to a buffer (necessary for dealloc)

@nathanielsimard nathanielsimard requested a review from louisfd April 5, 2024 19:50
Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

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

A few typos. Also as discussed let's rename server buf handles to bindings

@@ -25,26 +33,134 @@ macro_rules! storage_id_type {
};
}

/// Reference to buffer handles, to be holded by a tensor.
Copy link
Member

Choose a reason for hiding this comment

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

held

all: Arc<()>,
}

/// Reference to buffer handles, to be holded by anything else than tensors.
Copy link
Member

Choose a reason for hiding this comment

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

held

#[macro_export(local_inner_macros)]
/// Create a new memory ID type.
/// Create a new memory ID types.
Copy link
Member

Choose a reason for hiding this comment

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

not sure why you added plural, but you should at least remove the "a"

storage: StorageHandle,
handle: SliceTensorBufHandle,
// It is important to keep the chunk handle inside the slice, since it increases the ref count
// on the chunk id and make the `is_free` method returns false until the slice is freed.
Copy link
Member

Choose a reason for hiding this comment

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

makes the is_free method return

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 91.25364% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 86.44%. Comparing base (1718da5) to head (8c3ec74).
Report is 2 commits behind head on main.

Files Patch % Lines
...rates/burn-compute/src/memory_management/simple.rs 90.32% 12 Missing ⚠️
crates/burn-compute/src/channel/mpsc.rs 0.00% 8 Missing ⚠️
crates/burn-compute/src/channel/cell.rs 0.00% 4 Missing ⚠️
crates/burn-compute/src/id.rs 96.49% 2 Missing ⚠️
crates/burn-compute/src/server.rs 91.66% 1 Missing ⚠️
crates/burn-compute/src/storage/base.rs 0.00% 1 Missing ⚠️
crates/burn-jit/src/tensor/base.rs 0.00% 1 Missing ⚠️
crates/burn-wgpu/src/runtime.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1580      +/-   ##
==========================================
+ Coverage   86.42%   86.44%   +0.01%     
==========================================
  Files         694      696       +2     
  Lines       80687    80960     +273     
==========================================
+ Hits        69731    69982     +251     
- Misses      10956    10978      +22     

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

@nathanielsimard nathanielsimard merged commit 886a1de into main Apr 23, 2024
15 checks passed
@nathanielsimard nathanielsimard deleted the refactor/burn-compute branch April 23, 2024 17:05
syl20bnr pushed a commit that referenced this pull request Apr 26, 2024
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.

2 participants