Skip to content

Commit 03b0d87

Browse files
committed
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]
2 parents 785daa8 + afd0e32 commit 03b0d87

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,9 +1660,8 @@ TEST(VulkanComputeGraphTest, test_simple_shared_objects_with_resize) {
16601660
for (auto& new_sizes : new_sizes_list) {
16611661
graph.get_tensor(a.value)->virtual_resize(new_sizes);
16621662
graph.get_tensor(b.value)->virtual_resize(new_sizes);
1663-
graph.get_tensor(c)->virtual_resize(new_sizes);
16641663
graph.get_tensor(d.value)->virtual_resize(new_sizes);
1665-
graph.get_tensor(e)->virtual_resize(new_sizes);
1664+
graph.propagate_resize();
16661665

16671666
float val_a = new_sizes[1] + 4.0f;
16681667
float val_b = new_sizes[2] + 1.5f;

0 commit comments

Comments
 (0)