Skip to content

Commit a717a64

Browse files
committed
Update base for Update on "[ET-VK][ez] Fix handling of assert ops"
## Changes * Apply `RemoveAssertsTransform` as part of `vulkan_preprocess` * Do not call `RemoveAssertsTransform` before lowering the graph * Register ops related to asserts to the operator registry as ephemeral ops ## Motivation assert ops are not implemented in Vulkan, so previously `RemoveAssertsTransform()` is called on the graph before the lowering process. However, it turns out that the assertion ops are required to properly handle dynamic shapes, because they place constraints on the possible range of symbolic integers. If they are not present, then re-tracing the graph during a recompile (which may occur during a graph transform pass) may fail. Therefore, instead of calling the transform before lowering, call it inside vulkan_preprocess after a point where subsequent passes will not attempt to trace the graph. Differential Revision: [D75686048](https://our.internmc.facebook.com/intern/diff/D75686048/) [ghstack-poisoned]
1 parent 05d3956 commit a717a64

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

backends/vulkan/runtime/VulkanBackend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ class VulkanBackend final : public ::executorch::runtime::BackendInterface {
569569

570570
if (should_propagate_resize) {
571571
compute_graph->propagate_resize();
572-
compute_graph->encode_execute();
573572
}
574573
compute_graph->execute();
575574

backends/vulkan/runtime/graph/ComputeGraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ void ComputeGraph::propagate_resize() {
712712
for (std::unique_ptr<ExecuteNode>& node : execute_nodes_) {
713713
node->trigger_resize(this);
714714
}
715+
encode_execute();
715716
}
716717

717718
} // namespace vkcompute

0 commit comments

Comments
 (0)