Skip to content

[models] Skip torch.compile on the Muse Glimmer vision adapter - #4806

Merged
tianyu-l merged 2 commits into
pytorch:mainfrom
YeonwooSung:pr/muse-vision-adapter-compile
Sep 21, 2026
Merged

tianyu-l merged 2 commits into
pytorch:mainfrom
YeonwooSung:pr/muse-vision-adapter-compile

Conversation

@YeonwooSung

Copy link
Copy Markdown
Contributor

Summary

apply_compile walks model.layers and compiles each TransformerBlock. Muse Glimmer's vision adapter is a two-layer GELU MLP (c_fc / c_proj) with no layers attribute, so parallelize_muse_glimmer(..., compile.components=["model"]) raises AttributeError on multimodal flavors.

Qwen3.5, which this file mirrors, already compiles only the decoder and vision encoder. The AC path next to this code already skips the adapter for the same reason. Stop compiling the adapter; FSDP wrapping of encoder and adapter is unchanged.

Also extend the skip_dp AST allowlist to Qwen3.5, gpt-oss, and Muse Glimmer. Those entry points already accept skip_dp for vLLM; the test list did not. Flux is left out (no skip_dp, not a vLLM generator path).

Test plan

  • pytest tests/unit_tests/cpu/test_muse_glimmer_compile.py tests/unit_tests/cpu/test_skip_dp.py (9 passed locally)
  • Lint

apply_compile walks model.layers (TransformerBlock stack). The adapter is a
two-layer MLP with no layers attribute, so compiling it raises AttributeError.
These entry points already accept skip_dp for vLLM; the AST allowlist did not.
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Sep 20, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 20, 2026
@tianyu-l
tianyu-l merged commit 3b48c2f into pytorch:main Sep 21, 2026
14 checks passed
@YeonwooSung
YeonwooSung deleted the pr/muse-vision-adapter-compile branch September 22, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants