SIGN IN SIGN UP

[ET-VK][ez][Refactor] Re-order `DispatchNode` arguments to match shader 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/)
P
pytorchbot committed
118afa03cda7a453bbc1f53231d495258e83f706
Parent: 4945f4e
Committed by GitHub <noreply@github.com> on 5/5/2025, 11:36:53 PM