[ExecuTorch][WebGPU] Op-tests for floor_divide#21208
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21208
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 7fa4fbb 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
floor_divide(aten.div.Tensor_mode) op needs golden coverage — and, because it is discontinuous, a correct oracle.Solution:
FloorDivideModulerunstorch.div(a, b, rounding_mode="floor")through the partitioner; thefloor_dividesuite goldens the WebGPU output against agolden_fncomputingfloor(a / b)in fp32 — the exact Vulkan glsl formula and the kernel's formula. This is deliberately NOT torch's eagerdiv.Tensor_modeoutput: torch'sdiv_flooris an fmod-corrected algorithm that can differ fromfloor(a/b)by 1 at fp-boundary quotients, so eager is the wrong oracle for a Vulkan-faithfulfloor(a/b)port (the "goldens = Vulkan" rule).Implementation:
cases.pyregisters2dand3dsame-shape cases with the divisor bounded away from zero (_unary_lin(0.5, 4.0)) and a widened dividend (_unary_lin(-8, 8)) for varied floor results; each case setsgolden_fn=_floor_div_golden.test_floor_divide.pyholdsFloorDivideModule+ the oracle rationale.Differential Revision: D112257640