[ExecuTorch][WebGPU] Add Gemma 4 speculative decode runtime - #21677
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21677
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Unrelated FailureAs of commit 8546246 with merge base ceca90f ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
Hi @JCNTH! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Stack from ghstack (oldest at bottom):
Add reset-safe Gemma 4 K=2 speculative decode and a source-bound dual-runtime browser closure. The runtime owns one WebGPU context, loads target and assistant methods, maintains speculative counters, and resets by unload/reload while clearing query/profile generations. Combined staging binds both plain and MTP wall/profile builds to one source receipt without marking either view accepted.
Key changes:
gemma4_spec_runner/ adapter implements K=2 execution, fail-closed load/reset, context ownership, and versioned profiling.--no-entry, modularization, and distinctcreateGemma4Mtp/gemma4_mtpidentity.{plain,mtp}targets and eight wall/profile JS/WASM identities.Single-compute-pass remains default-OFF: the official K2 PTE contains 317 standalone live-row CQP sites, and canonical evidence records a live-row/single-pass regression. Production activation requires exporter proof plus runtime graph validation; no caller-trusted toggle or speed claim is shipped.
Co-authored-with: Claude Code.
Differential Revision: D115234077