From 54a7a11f7f86a3fa9d2bfc6ab02ca7e85e3da1d7 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Wed, 26 Mar 2025 09:12:06 -0700 Subject: [PATCH 1/2] [ET-VK][ez] Fix printing shader IRs ## Context As title; similar to https://github.com/pytorch/executorch/pull/9016 since the interface for `ComputePipeline` descriptor was reverted in https://github.com/pytorch/executorch/pull/9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) [ghstack-poisoned] --- backends/vulkan/runtime/api/Context.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backends/vulkan/runtime/api/Context.cpp b/backends/vulkan/runtime/api/Context.cpp index 258afba7502..58881c89341 100644 --- a/backends/vulkan/runtime/api/Context.cpp +++ b/backends/vulkan/runtime/api/Context.cpp @@ -272,7 +272,7 @@ Context* context() { VkPipeline Context::get_shader_pipeline( const vkapi::ShaderInfo& shader, - const vkapi::SpecVarList& spec_constants) { + const vkapi::SpecVarList& additional_constants) { const uint32_t push_constants_size = 128u; VkDescriptorSetLayout shader_layout = @@ -281,12 +281,17 @@ VkPipeline Context::get_shader_pipeline( pipeline_layout_cache().retrieve(shader_layout, push_constants_size); const utils::WorkgroupSize local_workgroup_size(4u, 4u, 1u); + vkapi::SpecVarList spec_constants = { + SV(local_workgroup_size[0u]), + SV(local_workgroup_size[1u]), + SV(local_workgroup_size[2u])}; + + spec_constants.append(additional_constants); VkPipeline pipeline = pipeline_cache().retrieve( {pipeline_layout, shader_cache().retrieve(shader), - spec_constants, - local_workgroup_size}); + spec_constants}); return pipeline; } From 3dfe673fe8bac7b8252e94bc38de67f477943191 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Wed, 26 Mar 2025 12:37:57 -0700 Subject: [PATCH 2/2] Update on "[ET-VK][ez] Fix printing shader IRs" ## Context As title; similar to https://github.com/pytorch/executorch/pull/9016 since the interface for `ComputePipeline` descriptor was reverted in https://github.com/pytorch/executorch/pull/9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) [ghstack-poisoned] --- backends/vulkan/runtime/api/Context.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backends/vulkan/runtime/api/Context.cpp b/backends/vulkan/runtime/api/Context.cpp index 58881c89341..df3d43ee901 100644 --- a/backends/vulkan/runtime/api/Context.cpp +++ b/backends/vulkan/runtime/api/Context.cpp @@ -289,9 +289,7 @@ VkPipeline Context::get_shader_pipeline( spec_constants.append(additional_constants); VkPipeline pipeline = pipeline_cache().retrieve( - {pipeline_layout, - shader_cache().retrieve(shader), - spec_constants}); + {pipeline_layout, shader_cache().retrieve(shader), spec_constants}); return pipeline; }