-
Couldn't load subscription status.
- Fork 706
[ET-VK][ez][Refactor] Re-order DispatchNode arguments to match shader layout spec
#10693
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-poisoned]
…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/10693
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 FailureAs of commit 14af33e 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 pull request was exported from Phabricator. Differential Revision: D74203482 |
This PR needs a
|
bd43ce8
into
gh/SS-JIA/224/base
Stack from ghstack (oldest at bottom):
DispatchNodearguments to match shader layout spec #10693Context
As title. Note that this PR was written mainly with a meta internal coding agent. This PR re-orders the arguments to
DispatchNodeto be more intuitive.I asked the agent:
I want to change the constructor of the class
to instead be
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_argsandresize_fnwas 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 aDynamicDispatchNode` 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/implChange
vkapi::MemoryAccessType::WRITEtovkapi::kWriteandvkapi::MemoryAccessType::READtovkapi::kReadfor each file.Differential Revision: D74203482