-
Notifications
You must be signed in to change notification settings - Fork 608
[ET-VK][ez][Refactor] Re-order DispatchNode
arguments to match shader layout spec
#10700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…er layout spec ## Context As title. Note that this PR was written mainly with a meta internal coding agent. This PR re-orders the arguments to `DispatchNode` to be more intuitive. I asked the agent: --- I want to change the constructor of the class ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params, const vkapi::SpecVarList& spec_vars = {}, const ResizeFunction& resize_fn = nullptr, const std::vector<ValueRef>& resize_args = {}, const std::vector<PushConstantDataInfo>& push_constants = {}); ``` to instead be ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params,, const std::vector<PushConstantDataInfo>& push_constants = {}, const vkapi::SpecVarList& spec_vars = {}, const std::vector<ValueRef>& resize_args = {}, const ResizeFunction& resize_fn = nullptr); ``` Can you make this change and update the callsites as well? --- The motivation is to have the arguments match the order in which parameter UBOs, push constant blocks, and specialization variables are declared in a GLSL shader. The order of `resize`_args` and `resize_fn` was also swapped in the interest of having the function pointer be the last argument. It will also make more sense in a following diff where a `DynamicDispatchNode` class is introduced, which will allow selecting a different compute shader depending on input sizes. As a small additional change, I also asked the agent to --- Go through all the files under `xplat/executorch/backends/vulkan/runtime/graph/ops/impl` Change `vkapi::MemoryAccessType::WRITE` to `vkapi::kWrite` and `vkapi::MemoryAccessType::READ` to `vkapi::kRead` for each file. --- Differential Revision: [D74203482](https://our.internmc.facebook.com/intern/diff/D74203482/) ghstack-source-id: 282122344 Pull Request resolved: #10693
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10700
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 30 PendingAs of commit 3e87524 with merge base 578358b ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
…er layout spec (#10700) ## Context As title. Note that this PR was written mainly with a meta internal coding agent. This PR re-orders the arguments to `DispatchNode` to be more intuitive. I asked the agent: --- I want to change the constructor of the class ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params, const vkapi::SpecVarList& spec_vars = {}, const ResizeFunction& resize_fn = nullptr, const std::vector<ValueRef>& resize_args = {}, const std::vector<PushConstantDataInfo>& push_constants = {}); ``` to instead be ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params,, const std::vector<PushConstantDataInfo>& push_constants = {}, const vkapi::SpecVarList& spec_vars = {}, const std::vector<ValueRef>& resize_args = {}, const ResizeFunction& resize_fn = nullptr); ``` Can you make this change and update the callsites as well? --- The motivation is to have the arguments match the order in which parameter UBOs, push constant blocks, and specialization variables are declared in a GLSL shader. The order of `resize`_args` and `resize_fn` was also swapped in the interest of having the function pointer be the last argument. It will also make more sense in a following diff where a `DynamicDispatchNode` class is introduced, which will allow selecting a different compute shader depending on input sizes. As a small additional change, I also asked the agent to --- Go through all the files under `xplat/executorch/backends/vulkan/runtime/graph/ops/impl` Change `vkapi::MemoryAccessType::WRITE` to `vkapi::kWrite` and `vkapi::MemoryAccessType::READ` to `vkapi::kRead` for each file. --- Differential Revision: [D74203482](https://our.internmc.facebook.com/intern/diff/D74203482/)
…er layout spec (pytorch#10700) ## Context As title. Note that this PR was written mainly with a meta internal coding agent. This PR re-orders the arguments to `DispatchNode` to be more intuitive. I asked the agent: --- I want to change the constructor of the class ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params, const vkapi::SpecVarList& spec_vars = {}, const ResizeFunction& resize_fn = nullptr, const std::vector<ValueRef>& resize_args = {}, const std::vector<PushConstantDataInfo>& push_constants = {}); ``` to instead be ``` explicit DispatchNode( ComputeGraph& graph, const vkapi::ShaderInfo& shader, const utils::uvec3& global_workgroup_size, const utils::uvec3& local_workgroup_size, const std::vector<ArgGroup>& args, const vkapi::ParamsBindList& params,, const std::vector<PushConstantDataInfo>& push_constants = {}, const vkapi::SpecVarList& spec_vars = {}, const std::vector<ValueRef>& resize_args = {}, const ResizeFunction& resize_fn = nullptr); ``` Can you make this change and update the callsites as well? --- The motivation is to have the arguments match the order in which parameter UBOs, push constant blocks, and specialization variables are declared in a GLSL shader. The order of `resize`_args` and `resize_fn` was also swapped in the interest of having the function pointer be the last argument. It will also make more sense in a following diff where a `DynamicDispatchNode` class is introduced, which will allow selecting a different compute shader depending on input sizes. As a small additional change, I also asked the agent to --- Go through all the files under `xplat/executorch/backends/vulkan/runtime/graph/ops/impl` Change `vkapi::MemoryAccessType::WRITE` to `vkapi::kWrite` and `vkapi::MemoryAccessType::READ` to `vkapi::kRead` for each file. --- Differential Revision: [D74203482](https://our.internmc.facebook.com/intern/diff/D74203482/)
This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #10693 by @SS-JIA
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/224/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/224/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/224/orig
@diff-train-skip-merge