Repository navigation
[ET-VK] Activation transpose preprocess shaders + dispatch helper - #19995
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19995
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 4 Unrelated FailuresAs of commit e30ba3e with merge base b1385db ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This PR needs a
|
|
@claude review this code |
|
@SS-JIA I don't see any new unit tests added for this. Is it covered by existing ones? |
|
Claude finished @metascroy's task in 1m 23s —— View job Code Review: [ET-VK] Activation transpose preprocess shaders + dispatch helper
Overall this is clean, well-structured infrastructure. The self-gating M==1 → 1. Missing
|
It is tested in the subsequent commit, where fp16 gemm consists of transpose input -> gemm |
84e022b
into
gh/SS-JIA/554/base
Stack from ghstack (oldest at bottom):
Adds a generic "preprocess" dispatch path for transposing/casting an activation tensor into a vectorized layout that downstream compute kernels can consume. This is split out from the upcoming q4gsw GEMM commit so the transpose machinery can be reused by other operators that consume pre-transposed activations.
Two compute shaders are added under
runtime/graph/ops/glsl/:transpose_cast_contig_to_vectorized— transposes a contiguous[M, K]tensor into[K, ceil(M/4)]packed as a vec4 along the inner dim, with optional dtype cast.transpose_cast_contig_to_vectorized_4x4— same idea but produces a 4x4 vectorized tile per output element, used by tile-style GEMM kernels.runtime/graph/ops/impl/Preprocess.{cpp,h}wraps these shaders behindadd_transpose_cast_node(and a 4x4 variant). The dispatch self-gates to{0, 0, 0}when M==1 so that GEMV paths sharing a graph with a GEMM prefill can leave the preprocess in place as a no-op rather than rebuilding the graph at decode time. The matchingresize_transpose_cast_nodekeeps the transposed tensor's virtual size in sync with the source activation acrossvirtual_resize.To support callers that want to invoke the standard prepack path for the activation directly,
Staging.hnow declaresadd_prepack_standard_node(previously file-private).Transpose.cppis reduced to the includes it actually uses.No new ops are dispatched yet; the next commit wires this infrastructure into
et_vk.q4gsw_linear.default.Differential Revision: D107447235