[ExecuTorch][WebGPU] Add logical_and op (aten.logical_and.default)#21221
[ExecuTorch][WebGPU] Add logical_and op (aten.logical_and.default)#21221JCNTH wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21221
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Unrelated FailureAs of commit df77bb2 with merge base 4a26c64 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
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):
Adds the elementwise bool
aten.logical_and.defaultto the WebGPU delegate. Vulkan maps this op to itsbitwise_andhandler (BinaryOp.cpp:161), valid for canonical 0/1 bool bytes; this port mirrors that. Both operands and the output are 1-byte bool tensors packed 4/word intoarray<u32>, so a word-wise AND is exactly a per-byte AND.Key changes:
runtime/ops/logical_and/logical_and.wgsl— one thread per packed word,t_out[w] = t_a[w] & t_b[w](2D-folded dispatch).runtime/ops/logical_and/LogicalAnd.cpp— handler binds out (rw) + a/b (ro) + params (uniform); fail-loud guards on bool dtype, null buffer, and same-shape; resize hook re-appliesnum_words+ dispatch.CMakeLists.txt— register the op source.Same-shape only (
numel % 4 == 0for the packed bool bindings), matching the backend's other bool ops.Co-authored-with: Claude Code.
@exported-using-ghexport
Differential Revision: D112257653
Differential Revision: D112257653