[ET-VK] Add conv1d shaders and dispatch for 1D convolution#18060
Open
SS-JIA wants to merge 1 commit intogh/SS-JIA/477/basefrom
Open
[ET-VK] Add conv1d shaders and dispatch for 1D convolution#18060SS-JIA wants to merge 1 commit intogh/SS-JIA/477/basefrom
SS-JIA wants to merge 1 commit intogh/SS-JIA/477/basefrom
Conversation
Add dedicated GLSL shaders and C++ dispatch for 1D convolution operations. The new implementation introduces three execution paths: 1. Buffer path (general and depthwise): conv1d.glsl and conv1d_dw.glsl operate on width-packed buffer tensors, with one shader invocation per output element at (n, out_c, out_l). Uses sizes_ubo/strides_ubo and tidx_to_bufi() for layout-agnostic index computation. 2. Buffer path (pointwise): conv1d_pw.glsl specializes the kernel_size=1 case to skip the spatial loop for efficiency. 3. Texture path (pointwise): conv1d_pw_texture.glsl handles the pointwise case for width-packed texture3d tensors, computing one output texel (4 values) per invocation using a scalar weight from a buffer. The legacy conv1d_texture.glsl (renamed from conv1d.glsl) preserves the original channels-packed texture path for backward compatibility. Convolution.cpp is updated to route 1D convolutions to the appropriate specialized dispatch (add_conv1d_buf_node or add_conv1d_pw_texture_node) based on the input storage type and packed dim, falling back to the legacy texture path for channels-packed inputs. op_registry.py gains a pick_conv_storage function that selects: - WIDTH_PACKED_TEXTURE for pointwise 1D conv (kernel_size=1) - CONTIGUOUS_BUFFER for non-pointwise 1D conv - CHANNELS_PACKED_TEXTURE for 2D conv (unchanged) Differential Revision: [D95970166](https://our.internmc.facebook.com/intern/diff/D95970166/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18060
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New FailuresAs of commit c8d484d with merge base f09bd55 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Mar 10, 2026
This PR needs a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Add dedicated GLSL shaders and C++ dispatch for 1D convolution operations.
The new implementation introduces three execution paths:
Buffer path (general and depthwise): conv1d.glsl and conv1d_dw.glsl operate
on width-packed buffer tensors, with one shader invocation per output element
at (n, out_c, out_l). Uses sizes_ubo/strides_ubo and tidx_to_bufi() for
layout-agnostic index computation.
Buffer path (pointwise): conv1d_pw.glsl specializes the kernel_size=1 case
to skip the spatial loop for efficiency.
Texture path (pointwise): conv1d_pw_texture.glsl handles the pointwise case
for width-packed texture3d tensors, computing one output texel (4 values)
per invocation using a scalar weight from a buffer.
The legacy conv1d_texture.glsl (renamed from conv1d.glsl) preserves the
original channels-packed texture path for backward compatibility.
Convolution.cpp is updated to route 1D convolutions to the appropriate
specialized dispatch (add_conv1d_buf_node or add_conv1d_pw_texture_node)
based on the input storage type and packed dim, falling back to the legacy
texture path for channels-packed inputs.
op_registry.py gains a pick_conv_storage function that selects:
Differential Revision: D95970166