Skip to content

Add Muse Glimmer 30B ExecuTorch example - #21711

Merged
digantdesai merged 1 commit into
mainfrom
muse-glimmer
Aug 10, 2026
Merged

digantdesai merged 1 commit into
mainfrom
muse-glimmer

Conversation

@digantdesai

@digantdesai digantdesai commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Export and runtime support for Muse Glimmer 30B on the CUDA and MLX backends, covering text, vision, DFlash speculative decoding, and OpenAI-compatible serving.

cc @mergennachin @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel @jackzhxng

Copilot AI lite review requested due to automatic review settings August 10, 2026 11:21
@pytorch-bot

pytorch-bot Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 174 Pending

As of commit 5fa8c6c with merge base fb5eedc (image):
💚 Looks good so far! There are no failures yet. 💚

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 Aug 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Export and runtime support for Muse Glimmer 30B on the CUDA and MLX backends,
covering text, vision, DFlash speculative decoding, and OpenAI-compatible
serving.

Authored with AI assistance (Codex, Claude Code).
Copilot AI review requested due to automatic review settings August 10, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@digantdesai digantdesai added module: examples Issues related to demos under examples/ release notes: examples Changes to any of our example LLMs integrations, such as Llama3 and Llava labels Aug 10, 2026
@digantdesai
digantdesai merged commit 52b176f into main Aug 10, 2026
209 of 218 checks passed
@digantdesai
digantdesai deleted the muse-glimmer branch August 10, 2026 11:41
JakeStevens added a commit that referenced this pull request Oct 28, 2026
…3798)

### Summary

Fixes #23797

`interpolate_pos_emb` passed a permuted view of the bf16 positional
table (strides `(1536, 1, 49152, 1536)`) to `F.grid_sample`. For Half
and BFloat16 the CPU kernel computes gather offsets in int16, and only
float32 is guarded against offset overflow, so the H stride of 49152
makes the offsets wrap. On the 32x32 grid about 98% of the outputs are
wrong, some NaN, and the reads that land before the storage are
consistent with the intermittent `grid_sample` segfault in the macOS
unittest job. The issue has the details and references.

The underlying kernel bug is reported upstream in
pytorch/pytorch#200949.

This change makes the view contiguous before `grid_sample`. The largest
gather offset becomes 1023, and the interpolation stays in the table's
dtype, as the docstring requires. The tests only checked shapes and
dtypes: `test_identity_grid_matches_table` now requires the 32x32
interpolation to return the table exactly, and the new
`test_downscaled_matches_float32` compares the 8x8 bf16 result with a
float32 reference, within `3 * eps` times the weighted absolute sum of
the texels. That bound covers the three bf16 roundings of the
accumulation with a factor of two to spare.

Computing in float32 and casting once would also avoid the kernel issue.
However, it departs from the documented computation in the table's dtype
and changes the outputs: about a third of the 8x8 values, by up to
0.0156, and about 97% of the 74x74 values, by up to about 0.75 (the
separate question in the issue). I kept the smaller change.

cc @mergennachin @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel
@jackzhxng @nil-is-all @digantdesai, who added this example in #21711.

### Test plan

```
python -m pytest examples/models/muse-glimmer/tests/test_vision_precompute.py
```

I ran this test file locally on Windows (x86 AVX2), three times under
torch 2.14.0+cpu (Python 3.12) and three times under torch 2.11.0+cu128
(Python 3.14). Neither environment has an editable install, so a small
wrapper made `executorch.examples.models.muse_glimmer` resolve to this
branch's sources before calling pytest with the repository's
`pytest.ini`. With this change, every test passes, except
`ResizeReferenceParityTest::test_matches_pinned_golden` under torch
2.14, which fails in that environment only because PIL is not installed
there. With `precompute.py` from `main` and the new tests,
`test_identity_grid_matches_table` fails (97.5% to 97.8% of the values
mismatched), and so does `test_downscaled_matches_float32` (more than
96000 of 98304 values out of the bound).

Over 50 seeds, the identity case is exact and the 8x8 error stays below
1.34 times `eps` times the weighted absolute sum, against 3 in the test.
`ufmt check` and `flake8`, at the versions pinned in
`requirements-lintrunner.txt`, report no findings; the `torchfix` plugin
was not installed. I could not run the macOS arm64 job.

Disclosure: this PR was authored with AI assistance (Claude Code).

Co-authored-by: Jacob Stevens <stevens.jacob1492@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
cadence — 5fa8c6cf Deployed Aug 10, 2026 by digantdesai
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. module: examples Issues related to demos under examples/ release notes: examples Changes to any of our example LLMs integrations, such as Llama3 and Llava

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants