Refresh backend README (#21385) - #21385
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21385
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JCNTH has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113580415. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Refreshes the WebGPU backend README to reflect the current backend architecture, operator surface, and measured browser performance/validation claims.
Changes:
- Updates the README’s backend overview, architecture diagram, and operator support summary.
- Adds a performance/results section and an optimization-techniques summary.
- Rewrites the quick-start/testing guidance and updates the directory structure sketch.
Comments suppressed due to low confidence (3)
backends/webgpu/README.md:121
- "This scripted path" is ambiguous (no script is referenced here). Since
test_build_webgpu.shis the scripted entrypoint and it sources.ci/scripts/setup-webgpu-linux-deps.shto install Dawn/SwiftShader, call that out explicitly so readers know what to run and where the deps come from.
This scripted path installs a Dawn and SwiftShader prebuilt for Linux. On
macOS, provide a configured Dawn installation instead of using this script.
backends/webgpu/README.md:154
- The quick-start exports
model.pte, but the follow-uptest_build_webgpu.shscript doesn’t run that artifact; it exports its own reference models under/tmpand runs native tests. Clarifying this avoids users thinking their exported.pteis being exercised.
The script exports a `.pte`, builds the native runtime, and validates GPU
output.
backends/webgpu/README.md:176
- The directory tree under
scripts/is incomplete: the repo currently also hasbackends/webgpu/scripts/test_webgpu_native_ci.sh. Keeping this listing accurate helps readers discover the right entrypoints.
├── scripts/
│ └── gen_wgsl_headers.py # Generate embedded WGSL headers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **CI:** Dawn/Tint and SwiftShader provide headless GPU execution on Linux/x86. | ||
| - **Operator tests:** 89 Python operator-test modules exercise export and | ||
| delegation. The code-generated op-test catalog and native runners compare | ||
| GPU output with eager-generated goldens. |
|
@claude Review for staleness, hard coding, and support for scaling webgpu in future |
|
Claude finished @JCNTH's task in 2m 11s —— View job Review:
|
Summary: **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
| This scripted path installs a Dawn and SwiftShader prebuilt for Linux. On | ||
| macOS, provide a configured Dawn installation instead of using this script. |
| ├── scripts/ | ||
| │ ├── setup-wgpu-native.sh # Download wgpu-native binaries | ||
| │ └── gen_wgsl_headers.py # Generate the embedded *_wgsl.h shader headers | ||
| │ └── gen_wgsl_headers.py # Generate embedded WGSL headers |
|
@claude Review for staleness, hard coding, and support for scaling webgpu in future |
|
Claude finished @JCNTH's task in 1m 13s —— View job Re-review:
|
| # | Earlier finding | Status in current README |
|---|---|---|
| 1 | Hard-coded 89 Python operator-test modules |
Fixed — line 110 now reads "Python operator-test modules exercise export and delegation" with no count. |
| 4 | scripts/ tree omitted test_webgpu_native_ci.sh |
Fixed — line 183 now lists it with a # CI entry point for native tests comment. |
| 5 | Quick Start implied model.pte was validated by the script |
Fixed — lines 150–151 explicitly state "This snippet demonstrates the export path. The validation script below exports and runs its own native reference models; it does not consume model.pte." |
| 6 | "This scripted path" had no antecedent | Fixed — lines 120–123 now name test_build_webgpu.sh and the sourced .ci/scripts/setup-webgpu-linux-deps.sh, and clarify the macOS path. |
The macOS caveat also resolves Copilot's second-round comment about setup-webgpu-linux-deps.sh being Linux/apt-specific — the README now says macOS users should "provide a configured Dawn installation instead of using this script."
✅ Hard-coding posture — now consistent
more than 100 operator symbols(lines 10, 53): verified — there are currently 219WEBGPU_REGISTER_OPcall sites underruntime/ops/. "More than 100" is a floor that ages gracefully. This is the right pattern and it's now used everywhere; the one exact count (89) that would drift has been removed. 👍- Performance table (lines 16–24): now carries a "Measured in July 2026" datestamp plus the hash-pinned-artifact caveat — exactly the hedge I asked for. A future reader can tell whether the numbers are current.
✅ Architecture & tree claims — verified against source
VH00header +VK00FlatBuffer identifier: confirmed —WebGPUDelegateHeader.cpp:31(kExpectedMagic = {'V','H','0','0'}) andWebGPUBackend.cpp:78(expectsVK00).- "No Python AOT layer" / consumes
.pteexported withVulkanPartitioner: confirmed —test/tester.pylowers viaVulkanPartitioner(line 89 comment: "WebGPU consumes the Vulkan VK00 serialization"). - WGSL drift check: confirmed —
test_build_webgpu.sh:19runsgen_wgsl_headers.py --checkand fails on drift. scripts/tree matches the two files actually present (gen_wgsl_headers.py,test_webgpu_native_ci.sh).
📈 Scaling posture — good, one optional suggestion
The doc is well-positioned for growth: floors-over-counts is now applied consistently, the per-model validation table (lines 42–46) adds rows cheaply, and the "registry coverage alone does not guarantee end-to-end" caveat sets the right expectation as the op surface grows.
One optional item carried over from last round (not blocking):
- State the long-term stance on the Vulkan-derived serialization. The README leans on the Vulkan FlatBuffer / partitioner /
VK00today and is honest about it, but doesn't say whether that reuse is a permanent design choice or a bootstrapping shortcut. A one-line note on intent would keep the doc from reading as accidentally coupled as WebGPU scales. Purely a nicety — nothing here is inaccurate.
Verdict: All blocking and should-fix items from the prior review are resolved and every architecture claim verifies against the tree. This is ready from a staleness/hard-coding standpoint. The remaining Vulkan-intent note is optional polish.
- Read the current README (post-updates)
- Verify operator registry / test counts against the tree
- Verify directory structure & script references
- Verify architecture claims (VH00/VK00, partitioner)
- Assess hard-coding & scaling posture
- Post findings
· branchexport-D113580415
| The backend registers more than 100 operator symbols. Representative groups | ||
| are listed below; this is not an exhaustive registry listing. | ||
|
|
||
| | Category | Representative operators | |
Summary: Pull Request resolved: pytorch#21385 **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
backends/webgpu/README.md:123
- The “Linux Native Quick Start” section mentions macOS, but doesn’t describe a runnable macOS path and could be read as implying
test_build_webgpu.shworks on macOS. Since the script unconditionally sources.ci/scripts/setup-webgpu-linux-deps.sh(Linux-specific), it’d be clearer to state that this dependency install flow is Linux-only and that macOS users must provideDawn_DIRthemselves.
The `test_build_webgpu.sh` flow sources
`.ci/scripts/setup-webgpu-linux-deps.sh` to install Dawn and SwiftShader
prebuilts on Linux. On macOS, provide a configured Dawn installation instead
of using this script.
Summary: **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
backends/webgpu/README.md:134
- The README’s sample export code imports
VulkanPartitionerfrom an internal module path. The public import (executorch.backends.vulkan) already re-exportsVulkanPartitioner, and this is the import style used by WebGPU op tests (e.g.backends/webgpu/test/ops/test_sdpa.py). Using the public import keeps the documentation aligned with the stable API surface and avoids coupling to internal module layout.
from executorch.backends.vulkan.partitioner.vulkan_partitioner import (
VulkanPartitioner,
)
Summary: Pull Request resolved: pytorch#21385 **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary: **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary: Pull Request resolved: pytorch#21385 **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary: **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary: **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
backends/webgpu/README.md:145
- The snippet imports
VulkanPartitionerfrom the deep module path, even thoughexecutorch.backends.vulkanre-exportsVulkanPartitioneras a public entrypoint. Using the public import keeps the README example shorter and avoids coupling docs to internal module layout.
from executorch.backends.vulkan.partitioner.vulkan_partitioner import (
VulkanPartitioner,
)
Summary: Pull Request resolved: pytorch#21385 **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary: Pull Request resolved: pytorch#21385 **Document the current WebGPU backend and measured browser results** The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts. Key changes: - `README.md` — document the current architecture and representative 100+ operator registry - `README.md` — report accepted Llama browser medians and conservative Qwen validation status - `README.md` — replace stale setup and test guidance with current paths Documentation only; runtime behavior is unchanged. Co-authored-with: Claude Code. Reviewed By: psiddh Differential Revision: D113580415
Summary:
Document the current WebGPU backend and measured browser results
The existing README describes an early five-operator prototype. This refresh aligns it with the landed backend and validated browser artifacts.
Key changes:
README.md— document the current architecture and representative 100+ operator registryREADME.md— report accepted Llama browser medians and conservative Qwen validation statusREADME.md— replace stale setup and test guidance with current pathsDocumentation only; runtime behavior is unchanged.
Co-authored-with: Claude Code.
Reviewed By: psiddh
Differential Revision: D113580415