From a3133011b295e0b6fcb7937195bf9337e95e422e Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Wed, 26 Mar 2025 12:37:57 -0700 Subject: [PATCH] [ET-VK][ez] Fix printing shader IRs Pull Request resolved: https://github.com/pytorch/executorch/pull/9648 ## 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. ghstack-source-id: 274260087 @exported-using-ghexport Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) --- backends/vulkan/runtime/api/Context.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backends/vulkan/runtime/api/Context.cpp b/backends/vulkan/runtime/api/Context.cpp index 258afba7502..df3d43ee901 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,15 @@ 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}); + {pipeline_layout, shader_cache().retrieve(shader), spec_constants}); return pipeline; }