Skip to content

Commit ad576ef

Browse files
committed
Update on "[ET-VK] Serialize constant data outside of flatbuffer"
## Context This changeset is a mirror of #1542 and #1543 for the Vulkan delegate, which enables serialization of constant weight data outside the flatbuffer blob. I decided to package some miscellaneous codebase improvements with this changeset: * Update field names of `VkGraph` table in `schema.fbs` and update the namespace to be simply `vkgraph`: * In `VulkanBackend.cpp`, use aliases for generated flatbuffer types * Move build targets to a `targets.bzl` file with a `define_common_targets()` method Differential Revision: [D53957852](https://our.internmc.facebook.com/intern/diff/D53957852/) [ghstack-poisoned]
1 parent ec602b6 commit ad576ef

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

backends/vulkan/test/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _generate_random_const_tensors(self, num_tensors: int) -> List[torch.Tensor]
3636

3737
return tensors
3838

39-
def test_serialize_xnnpack_binary(self):
39+
def test_serialize_vulkan_binary(self):
4040
vk_graph = VkGraph(
4141
version="0",
4242
chain=[],

backends/vulkan/vulkan_preprocess.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
import ctypes
87
from typing import Dict, final, List
98

109
import executorch.backends.vulkan.serialization.vulkan_graph_schema as vk_graph_schema
@@ -178,8 +177,6 @@ def create_vk_values_for(node: Node, buffer_idx: int = -1):
178177
),
179178
)
180179
elif node.op == "get_attr":
181-
# Tensor
182-
# Adapted from https://www.internalfb.com/code/fbsource/[18c174b709f321d26e6632e2f826498cde730f8c]/fbcode/executorch/backends/xnnpack/xnnpack_preprocess.py?lines=127
183180
buffer_idx = len(const_tensors)
184181
const_tensors.append(
185182
getattr(node.graph.owning_module, node.target).contiguous()

0 commit comments

Comments
 (0)