[ExecuTorch][WebGPU] Op-tests for comparisons + bool-output golden harness#21220
[ExecuTorch][WebGPU] Op-tests for comparisons + bool-output golden harness#21220JCNTH wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21220
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: ❌ 46 New Failures, 3 Unrelated FailuresAs of commit bc10f23 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):
Problem: The new comparison ops (
aten.eq/lt/le/gt/ge.Tensor) output BOOL, which the op-test golden harness did not handle (only fp32/int8/int64). And the goldens must actually discriminate the comparators.Solution: Extend the golden harness with a
boolbranch (mirrors the int8/int64 branches):generate_op_testswrites the bool golden as 0/1 bytes (raw.dtype==torch.bool -> _write_int8(raw.to(int8)), dtype "bool") andop_test_driverreads the bool output viaconst_data_ptr<bool>()and byte-compares. The change is additive (bool is a distinct dtype; the branch precedes int8) — existing fp32/int8/int64 paths are untouched (regression 27/27).CompareModule(op)covers all 5 ops; the two inputs draw from DIFFERENT discrete-range seeds (compare_gen_a/compare_gen_b) soa!=bwith frequent collisions — givingeq/le/gegenuine ties andlt/gta real true/false mix, so an op-switch swap diverges from the golden.Implementation:
cases.pyregisterseq/lt/le/gt/gevia a shared_compare_suite(2d/3d/sq shapes, all numel%4==0);test_compare.pyholdsCompareModule+ the seeded gens + a delegation smoke test.Differential Revision: D112257586