[ExecuTorch][WebGPU] Raise TensorMeta rank cap 4->8 to fix rank>4 ops (0x30)#21231
[ExecuTorch][WebGPU] Raise TensorMeta rank cap 4->8 to fix rank>4 ops (0x30)#21231JCNTH wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21231
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: ❌ 31 New Failures, 3 Unrelated FailuresAs of commit 139066b with merge base 266e0dc ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were 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
|
psiddh
left a comment
There was a problem hiding this comment.
Approving full WebGPU stack
Stack from ghstack (oldest at bottom):
Rank-5+ tensors threw
0x30(DelegateInvalidCompatibility) at delegate init: the sharedTensorMetaUBO capped rank at 4 (kTensorMetaMaxNdim), sofill_tensor_meta/fill_tensor_meta_broadcasthard-throw duringbuild()and the WGSL mirror storedsizes/stridesas a singlevec4<u32>. This clearstest_permute_different_shapes[webgpu],test_transpose_different_shapes[webgpu](transpose lowers topermute_copy), and the rank>4 model failures (conformer,maxvit_t).Raise the global cap to 8 and widen the uniform to two
vec4<u32>blocks, keeping the C++ and WGSL layouts byte-identical:sizes[8]/strides[8]:sizeof(TensorMeta)48->80,stridesoffset 32->48 (ndim/numel/sizesoffsets unchanged).sizes: array<vec4<u32>, 2>/strides: array<vec4<u32>, 2>: in the uniform address space thevec4<u32>element stride is 16, so two blocks are 32 contiguous bytes matchinguint32_t[8]; component k sits at byte16 + 4*kon both sides, so the raw memcpy stays correct. Runtime readsm.strides[d]becomem.strides[d >> 2u][d & 3u].u32tightly, so rank-5 would allocate the same twovec4s; 8 is the natural 2-vec4boundary and covers all realistic ranks.Key changes:
runtime/ops/TensorMeta.h- cap 4->8;static_assert(sizeof == 80)andoffsetof(strides) == 48; throw text._wgsl.h):permute,flip,cat,binary_op(div/sub),binary_mul,binary_pow,binary_minimum,binary_floor_divide,where,select,slice,expand_copy,gather,index_select,repeat.permute/flipalso widen their per-dimParamsarray (perm/flipvec4<u32>->array<vec4<u32>, 2>;sizeof(PermuteParams)/sizeof(FlipParams)16->32).div/mul/sub/where/binary/index_select/repeat.xplat/andfbcode/mirrors (byte-identical).Co-authored-with: Claude Code.
Differential Revision: D113319595