Skip to content

Remove the conv2d op-test case that can never be delegated, so the WebGPU op tests can run - #21697

Open
shoumikhin wants to merge 1 commit into
mainfrom
shoumikhin/webgpu-drop-undelegatable-conv2d-case
Open

Remove the conv2d op-test case that can never be delegated, so the WebGPU op tests can run#21697
shoumikhin wants to merge 1 commit into
mainfrom
shoumikhin/webgpu-drop-undelegatable-conv2d-case

Conversation

@shoumikhin

@shoumikhin shoumikhin commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What is broken

test-webgpu-native fails before it runs a single op test:

RuntimeError: conv2d/gemm_batched produced NO VulkanBackend delegate (silent CPU fallback) - this case would not exercise the WebGPU path.

Why it happens

The op-test generator exports every case in
backends/webgpu/test/op_tests/cases.py and then checks that the exported
program really contains a WebGPU (Vulkan) delegate. If it does not, the case
would run on CPU and prove nothing, so the generator refuses to write it.

The gemm_batched case gives conv2d an input of shape (2, 8, 16, 16), so a
batch of 2. check_conv_node in backends/vulkan/op_registry.py returns False
for any 4-D convolution whose batch is not 1:

if len(x_shape) == 4:
    batches = x.meta["val"].size()[0]
    if batches != 1:
        return False

So this case can never be delegated. It has been in cases.py since the suite
was added and has never worked.

Why it only turns the job red now

Until recently the CI script wrapped the generator in an if:

if $PYTHON_EXECUTABLE -m ...generate_op_tests --output "${OP_TEST_DIR}"; then
  ...
else
  echo "WARN: op-test manifest generation failed (needs the executorch wheel); skipping"
fi

The generator was failing on this case every time, so the whole op-test
framework took the else branch and was quietly skipped. #21646 replaced that
with a plain call, and the script runs under set -e, so the same old failure
is now fatal.

Making it fatal is the right call. The op tests are meant to run. This change
removes the one case that stops them.

The fix

Delete the gemm_batched case, and say in the suite comment why there is no
batched case, so it is clear what to add back once the partitioner accepts
batch > 1.

Why not mark the case required=False instead

required=False makes the generator print a warning instead of raising, but it
still writes the .pte and still adds the case to the manifest. The C++ driver
would then load a CPU-only program, compare it to the torch golden, and pass.
That is a green tick for a test that never touches the GPU, which is worse than
having no case at all.

Teaching the generator to also drop the manifest entry in that situation would
be a reasonable follow-up, but it is a separate change.

Test plan

test-webgpu-native is the only job that runs the op tests, and on its own this
branch cannot reach them: the job still stops earlier on the missing RoPE fixture
that #21690 fixes. So the two changes were tested together, on a branch holding
both, and that run passes:

[       OK ] WebGPUNative.RopeHfDynamicSequenceReusedGraph (29 ms)
=== WebGPU native tests on Dawn: all run targets passed ===
Generated 390 cases -> /tmp/webgpu_op_tests/manifest.json
[----------] 6 tests from OpTest_conv2d
[==========] 391 tests from 88 test suites ran. (37413 ms total)
[  PASSED  ] 391 tests.
=== WebGPU op-test framework on Dawn: passed ===

So the generator now gets all the way through, the op-test binary runs for the
first time, and all 391 generated tests pass, conv2d included with its
remaining 6 cases.

Tested on this branch alone as well, to confirm this change does not break
anything earlier: the job reaches the native tests and 28 of them pass, with the
single failure being the RoPE fixture that #21690 fixes.

One thing worth knowing: generating the 390 cases takes about 35 minutes, and the
whole job now takes about 78 minutes against a 120 minute limit. It fits, but the
margin is not large, and it was invisible until now because the stage never ran.

Copilot AI lite review requested due to automatic review settings August 9, 2026 04:56
@pytorch-bot

pytorch-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21697

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 969df9d with merge base fb5eedc (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copilot AI review requested due to automatic review settings August 10, 2026 05:51
@shoumikhin
shoumikhin force-pushed the shoumikhin/webgpu-drop-undelegatable-conv2d-case branch from 1df8615 to 969df9d Compare August 10, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants