Skip to content

[ET-VK] Removing un used push constants for conv2d pw. #10814

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

Merged
merged 4 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ ${layout_declare_tensor(3, "r", "t_bias", DTYPE, "texture2d")}

layout(push_constant) uniform restrict Block {
ivec4 out_limits;
ivec4 in_sizes;
ivec2 kernel_size;
ivec2 stride;
ivec2 padding;
ivec2 dilation;
ivec2 overlay_region;
int in_group_size;
int dummy_padding;
float out_min;
Expand Down
22 changes: 21 additions & 1 deletion backends/vulkan/runtime/graph/ops/impl/Convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,27 @@ void add_conv2d_node(

vkapi::ParamsBindList param_buffers;
std::vector<PushConstantDataInfo> push_constants;
if (method == Conv2dMethod::Pointwise || method == Conv2dMethod::Depthwise) {
if (method == Conv2dMethod::Pointwise) {
const utils::ivec4 kernel_param_stride_pad = {
kernel_params.stride[0],
kernel_params.stride[1],
kernel_params.padding[0],
kernel_params.padding[1],
};

struct Conv2dPWParams final {
int in_group_size;
int dummy_padding;
OutputParams out_params;
} param{extra_params.in_group_size, 0, out_params};

push_constants = {
graph.logical_limits_pc_of(out),
PushConstantDataInfo(
&kernel_param_stride_pad, sizeof(kernel_param_stride_pad)),
PushConstantDataInfo(&param, sizeof(param)),
};
} else if (method == Conv2dMethod::Depthwise) {
const utils::ivec4 kernel_param_size_stride = {
kernel_params.kernel_size[0],
kernel_params.kernel_size[1],
Expand Down
Loading