[ExecuTorch][WebGPU] Add HuggingFace rotate-half RoPE#21135
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21135
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: ❌ 3 New Failures, 1 Unrelated FailureAs of commit 0c45a43 with merge base 86c3470 ( NEW FAILURES - The following jobs have failed:
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
|
SS-JIA
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Stack from ghstack (oldest at bottom):
Qwen models use the HuggingFace rotate-half rotary embedding, which pairs the
first and second halves of each head vector rather than adjacent elements as the
existing interleaved Llama RoPE does. This adds the rotate-half operator with
dynamic start-position updates, full-dimension Q/K head handling, a generated
WGSL kernel, and a strict frequency-table bound that rejects out-of-range
positions; the interleaved Llama route is left unchanged. Mirrors Vulkan
xplat/executorch/backends/vulkan/runtime/graph/ops/glsl/rotary_embedding_hf.glsl.
Key changes:
per-pair rotate-half rotation reading the first-half frequency column.
frequency-table bound check.
@exported-using-ghexport
Differential Revision: D113171746
Differential Revision: D113171746