Skip to content

Commit 176560f

Browse files
[executorch][native-vk] Support Vulkan aliases and mutable state (pytorch#23457)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#23421 by @digantdesai ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/117/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/117/head Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/116/orig Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/117/orig Differential Revision: [D121140200](https://our.internmc.facebook.com/intern/diff/D121140200/) @diff-train-skip-merge cc @SS-JIA @manuelcandales @digantdesai @cbilgin Co-authored-by: Digant Desai <digantdesai@meta.com>
1 parent d6b8260 commit 176560f

5 files changed

Lines changed: 807 additions & 119 deletions

File tree

‎backends/native/runtime/vulkan/VulkanEngine.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct VulkanEngineHost::Impl {
2929
struct VulkanEngineContext::Impl {
3030
GraphConfig config;
3131
VulkanConstantMaterializationTracker materializations;
32+
VulkanMutableStateOwners mutable_state_owners;
3233
};
3334

3435
VulkanEngineHost::VulkanEngineHost(std::unique_ptr<Impl> impl)
@@ -101,7 +102,11 @@ size_t VulkanEngineContext::materialized_constant_bytes() const {
101102
std::unique_ptr<EngineExecutable> VulkanEngineContext::compile_method(
102103
const Method& method) {
103104
return create_vulkan_engine_executable(
104-
method, package(), impl_->materializations, impl_->config);
105+
method,
106+
package(),
107+
impl_->materializations,
108+
impl_->mutable_state_owners,
109+
impl_->config);
105110
}
106111

107112
} // namespace ptn

‎backends/native/runtime/vulkan/VulkanEngine.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class VulkanEngineHost final : public EngineHost {
4646

4747
// Per-program Vulkan state. Each executable owns its ComputeGraph and command
4848
// resources while sharing this context's constant materialization tracker.
49+
// Mutable state is not shared yet: compile throws while another live
50+
// executable holds one of the method's mutable DataBinding keys.
4951
class VulkanEngineContext final : public EngineContext {
5052
private:
5153
friend class VulkanEngineHost;

0 commit comments

Comments
 (0)