Skip to content

[Native] Fuse broadcast RoPE frequencies and lower tanh in ggml - #24945

Draft
metascroy wants to merge 1 commit into
offgraph-kv-swafrom
offgraph-kv-mg-ops
Draft

metascroy wants to merge 1 commit into
offgraph-kv-swafrom
offgraph-kv-mg-ops

Conversation

@metascroy

@metascroy metascroy commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Stack

Off-graph KV cache for the native ggml engine, through serving Muse Glimmer on it. Review bottom-up; each PR builds and passes its tests on its own.

Summary

Two ops Muse Glimmer's Hugging Face model needs on the ggml engine:

  • RoPE fusion: its rotary embedding builds the angles as position_ids[..., None] * inv_freq rather than HF's batched matmul, so FuseRoPEPass left cos/sin in the graph, which ggml can't run. The pass now recognizes that outer product too.
  • aten.tanh: lowered to ggml_tanh; Muse Glimmer's final logit soft cap uses it.

Test plan

  • test_passes.py: the broadcast form fuses to a single native.rope and matches the unfused output.
  • test_ggml_ops.py::test_tanh is added but not run here (it needs Buck's ggml_ptn_runner). The Muse Glimmer export later in the stack exercises both changes end to end.

Authored with Claude Code.

@pytorch-bot

pytorch-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 138 New Failures, 7 Unrelated Failures, 10 Unclassified Failures

As of commit ddb4ff2 with merge base c7f7931 (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:

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 Nov 12, 2026
This was referenced Nov 12, 2026
Muse Glimmer's Hugging Face rotary embedding builds its angles as
position_ids[..., None] * inv_freq rather than HF's batched matmul, so
FuseRoPEPass left the cos/sin tables in the graph, which the ggml engine
cannot run. The pass now recognizes that outer product too. The ggml engine
also lowers aten.tanh, which Muse Glimmer's final logit soft cap uses.

This branch had an error being deployed

1 failed deployment
cadence — ddb4ff29 Deployed Nov 14, 2026 by metascroy via vision-build / vision #38302
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.

1 participant