[ET-VK] Runtime support for NamedDataMap#13472
[ET-VK] Runtime support for NamedDataMap#13472facebook-github-bot merged 3 commits intogh/SS-JIA/290/basefrom
Conversation
Summary: Allow VulkanBackend to load constant tensors from the NamedDataMap instead of the constant data section of the delegate blob. ## Motivation This enables several key results: * Unblocks delegate retargetability with other backends * Allows reducing peak memory usage when loading models by freeing constant weight data as it gets moved to the GPU ## Changes * Allow `TensorRef` to be constructed with a `FreeableBuffer` rvalue * Add ability to load constant data from `NamedDataMap` in `VulkanBackend.cpp` * When prepacking, free the constant data pointer once it's been copied to the staging buffer Test Plan: CI Validate results by collecting memory measurements in the next few diffs. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13472
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 491055c with merge base 8ef9595 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@SS-JIA has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Allow VulkanBackend to load constant tensors from the NamedDataMap instead of the constant data section of the delegate blob. ## Motivation This enables several key results: * Unblocks delegate retargetability with other backends * Allows reducing peak memory usage when loading models by freeing constant weight data as it gets moved to the GPU ## Changes * Allow `TensorRef` to be constructed with a `FreeableBuffer` rvalue * Add ability to load constant data from `NamedDataMap` in `VulkanBackend.cpp` * When prepacking, free the constant data pointer once it's been copied to the staging buffer Test Plan: CI Validate results by collecting memory measurements in the next few diffs. Differential Revision: [D80460035](https://our.internmc.facebook.com/intern/diff/D80460035) [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D80460035 |
Summary: Allow VulkanBackend to load constant tensors from the NamedDataMap instead of the constant data section of the delegate blob. ## Motivation This enables several key results: * Unblocks delegate retargetability with other backends * Allows reducing peak memory usage when loading models by freeing constant weight data as it gets moved to the GPU ## Changes * Allow `TensorRef` to be constructed with a `FreeableBuffer` rvalue * Add ability to load constant data from `NamedDataMap` in `VulkanBackend.cpp` * When prepacking, free the constant data pointer once it's been copied to the staging buffer Test Plan: CI Validate results by collecting memory measurements in the next few diffs. Differential Revision: [D80460035](https://our.internmc.facebook.com/intern/diff/D80460035) [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D80460035 |
5bf624b
into
gh/SS-JIA/290/base
| ref = compute_graph_->add_tensorref( | ||
| dims_vector, dtype, std::move(buffer.get())); | ||
| } else { | ||
| const uint8_t* tensor_data = constant_data_ + constant_bytes->offset(); |
There was a problem hiding this comment.
nit assert offset != UINT64_MAX for debugging
Stack from ghstack (oldest at bottom):
prepare_pipelines()toprepare()#13478Summary:
Allow VulkanBackend to load constant tensors from the NamedDataMap instead of the constant data section of the delegate blob.
Motivation
This enables several key results:
Changes
TensorRefto be constructed with aFreeableBufferrvalueNamedDataMapinVulkanBackend.cppTest Plan:
CI
Validate results by collecting memory measurements in the next few diffs.
Differential Revision: D80460035