Skip to content

[ExecuTorch][WebGPU] Adopt WebGPU layout:"auto" in make_compute_pipeline#20867

Open
JCNTH wants to merge 3 commits into
gh/JCNTH/42/basefrom
gh/JCNTH/42/head
Open

[ExecuTorch][WebGPU] Adopt WebGPU layout:"auto" in make_compute_pipeline#20867
JCNTH wants to merge 3 commits into
gh/JCNTH/42/basefrom
gh/JCNTH/42/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Replace the hand-built bind-group layout + pipeline layout in the shared utils::make_compute_pipeline helper with WebGPU-native layout:"auto" (pipeline_desc.layout = nullptr) + wgpuComputePipelineGetBindGroupLayout(pipeline, 0). This removes the per-op WGPUBindGroupLayoutEntry[] + pipeline-layout boilerplate across every helper-using op — the driver derives the bind-group layout from the shader's statically-used bindings. This mirrors the Vulkan delegate's codegen descriptor-derivation, achieved via the WebGPU runtime feature instead of build-time codegen. BindingSpec.type is retained but unused, so no call sites change.

Precondition: auto layout omits any binding the shader never statically references. Audited across every helper-using shader — every declared binding is statically referenced (optional bias/mask/affine bindings under a runtime-uniform guard, which counts as static use). The lone exception was max_pool2d, whose out_idx (binding 3) was gated by a compile-time override (write_indices) — which auto layout could drop. Converted it to a runtime params.write_indices uniform (reusing a padding slot; PoolParams stays 64 bytes) so out_idx is unconditionally statically referenced regardless of Tint's override handling, matching the runtime-uniform pattern the other optional-binding ops use.
@exported-using-ghexport

Differential Revision: D110836671

Differential Revision: D110836671

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 131 New Failures, 2 Unrelated Failures, 7 Unclassified Failures

As of commit 2910518 with merge base c2b273e (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

  • pull / unittest / windows / windows-job (gh) (matched win rule in flaky-rules.json)
    Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under 'C:\actions-runner\_work\executorch\executorch\test-infra\.github\actions\teardown-windows'. Did you forget to run actions/checkout before running your local action?
  • pull / unittest-editable / windows / windows-job (gh) (matched win rule in flaky-rules.json)
    Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under 'C:\actions-runner\_work\executorch\executorch\test-infra\.github\actions\teardown-windows'. Did you forget to run actions/checkout before running your local action?

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

@github-actions

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.

This was referenced Jul 10, 2026
[ghstack-poisoned]
[ghstack-poisoned]
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants