Skip to content

[PyTorch-MPS] Document verified model support - #859

Merged
WindChimeRan merged 4 commits into
mainfrom
stack/mps-upstream-models
Oct 14, 2026
Merged

WindChimeRan merged 4 commits into
mainfrom
stack/mps-upstream-models

Conversation

@WindChimeRan

@WindChimeRan WindChimeRan commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #858, which adds verified Qwen3 support. Document verified Hunyuan Dense and OLMo2 support through upstream's auto model selection, without model-specific attention patches like #664.

  • Add the PyTorch MPS column to the model table; leave unverified models blank.

Both checkpoints matched 24/24 CPU transformers reference greedy tokens.

Benchmark

Model Path Output tok/s ↑ Mean TTFT (ms) ↓ Mean TPOT (ms) ↓
Hunyuan-1.8B-Instruct MLX 384.0 771.5 68.0
PyTorch MPS 288.4 (-24.9%) 1684.1 86.0
OLMo-2-0425-1B-Instruct MLX 543.9 360.3 48.2
PyTorch MPS 412.4 (-24.2%) 887.1 61.4

M5 Pro 64 GiB; stack c517256, vLLM 0.30 / PyTorch 2.13 / MLX 0.32.1. Same unquantized checkpoint and BF16 weights/KV per pair; greedy Sonnet 1024/128, 100 requests, 10/s, C32; context/batch limit 2048, 2,340 allocator blocks with 16-token attention blocks, prefix cache off, async on both paths. Two fresh-server runs per path in reversed order; identical token counts and no preemptions. Percentages are throughput changes versus MLX.

@WindChimeRan
WindChimeRan added this pull request to stack #860 September 28, 2026 08:02
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from 994a675 to 676fdfe Compare September 28, 2026 09:18
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from 676fdfe to c6b41fa Compare September 28, 2026 09:30
@WindChimeRan
WindChimeRan removed this pull request from stack #860 September 28, 2026 20:31
@WindChimeRan
WindChimeRan added this pull request to stack #871 September 28, 2026 20:32
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from c6b41fa to 79c1ff7 Compare September 28, 2026 22:20
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch 2 times, most recently from 0ae344b to 67aa993 Compare October 3, 2026 16:03
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch 3 times, most recently from 1ac6ec3 to 40c42e8 Compare October 4, 2026 06:04
@WindChimeRan
WindChimeRan marked this pull request as ready for review October 4, 2026 06:36
@ericcurtin
ericcurtin requested a balanced review from Copilot October 4, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Newly admitted model configurations can fail automatic cache sizing because the memory estimator assumes an intermediate_size field.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Broadens the opt-in PyTorch MPS backend beyond Qwen3 using upstream model selection.

Changes:

  • Replaces the model-name restriction with capability and attention-head checks.
  • Documents verified MPS support for Qwen3, Hunyuan Dense, and OLMo 2.
File Description
vllm_metal/​pytorch_backend/​worker.py Adds capability-based model admission checks.
vllm_metal/​envs.py Updates the backend comment only.
docs/​supported_models.md Adds MPS support columns, leaving unverified entries blank.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread vllm_metal/pytorch_backend/worker.py Resolved
Comment thread docs/supported_models.md Resolved
@ericcurtin

Copy link
Copy Markdown
Collaborator

Thanks! Please fix Copilot's findings: determine_available_memory assumes intermediate_size (breaks OPT/GPT-2 layouts this now admits), and the Hunyuan example checkpoint is MLX-only. Rebase after #858. Setting to draft, please reopen when ready for re-review.

@ericcurtin
ericcurtin marked this pull request as draft October 4, 2026 08:26
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch 4 times, most recently from 249e9a6 to e8c4dfd Compare October 4, 2026 22:49
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch 3 times, most recently from 99a3ead to da18035 Compare October 5, 2026 18:36
@WindChimeRan
WindChimeRan marked this pull request as ready for review October 5, 2026 20:11
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from ac9ce1e to edd4c6e Compare October 5, 2026 20:29
@ericcurtin

Copy link
Copy Markdown
Collaborator

Thanks! Blocked on #858 (stacked), so setting to draft. Please rebase onto main once it lands and reopen for re-review.

@ericcurtin
ericcurtin marked this pull request as draft October 5, 2026 21:46
@WindChimeRan
WindChimeRan marked this pull request as ready for review October 5, 2026 21:49
@ericcurtin

Copy link
Copy Markdown
Collaborator

Thanks! Blocked on #858 (stacked), so setting to draft. Please rebase onto main once it lands and reopen for re-review.

@ericcurtin
ericcurtin marked this pull request as draft October 7, 2026 08:32
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from edd4c6e to edf8667 Compare October 7, 2026 20:46
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from edf8667 to 418933b Compare October 7, 2026 21:25
@WindChimeRan
WindChimeRan marked this pull request as ready for review October 8, 2026 04:01
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch 2 times, most recently from e870c85 to fbd5835 Compare October 8, 2026 05:37
Base automatically changed from stack/mps-mrv2-base to main October 13, 2026 21:21
Signed-off-by: Ranran <ranranhaoranzhang@gmail.com>
Signed-off-by: Ranran <ranranhaoranzhang@gmail.com>
Signed-off-by: Ranran <ranranhaoranzhang@gmail.com>
@WindChimeRan
WindChimeRan force-pushed the stack/mps-upstream-models branch from ac10bfd to 5eeb73b Compare October 13, 2026 21:21

@ricky-chaoju ricky-chaoju left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hunyuan on MPS needs --generation-config vllm here: its generation_config.json sets repetition_penalty 1.05, so even temperature=0 requests get a 400. Might be worth a note in the table.

@ricky-chaoju

Copy link
Copy Markdown
Collaborator

@WindChimeRan I have an exam later today, so I'll take a look at #880 tonight.

Signed-off-by: Ranran <ranranhaoranzhang@gmail.com>
@WindChimeRan

Copy link
Copy Markdown
Collaborator Author

Thanks! reproduced red->greed locally with the notes. @ricky-chaoju

No worry on the review. Omni works will mainly depend on PR1 (already merged)

@WindChimeRan
WindChimeRan merged commit 9c7b463 into main Oct 14, 2026
3 checks passed
WindChimeRan added a commit that referenced this pull request Oct 14, 2026
Stacked on #859. Add opt-in MPS support for dense LFM2/LFM2.5 through
upstream `Lfm2ForCausalLM` and MRv2.

- Reuse vLLM's Torch ShortConv implementation through its
pluggable-layer hook.
- Reuse scheduler-owned state copying/clearing and the existing cache
allocation.
- Mark LFM support in the PyTorch MPS model column.

LFM2.5-1.2B FP16 matched 24/24 CPU-reference greedy tokens; prefix reuse
and chunked prefill pass. BF16 normalization rounding changed 18/512
fixed-history greedy choices versus eager (ΔNLL +0.00203).

Validation: 3,857 non-slow tests passed; lint and types pass. Cache
stress completed with 11 preemptions and 80 cached-prefix tokens. No new
kernels or dependencies. Explicit async scheduling passes concurrent
HTTP, cancellation and stop-token checks in FP16. BF16 batch/preemption
rounding can change near-tied greedy choices.

## Benchmark

| Model | Path | Output tok/s ↑ | Mean TTFT (ms) ↓ | Mean TPOT (ms) ↓ |
| --- | --- | ---: | ---: | ---: |
| LFM2.5-1.2B-Instruct | MLX | 806.8 | 255.8 | 30.7 |
|  | PyTorch MPS | 573.0 (-29.0%) | 549.9 | 43.1 |

M5 Pro 64 GiB; stack `c517256`, vLLM 0.30 / PyTorch 2.13 / MLX 0.32.1.
Same unquantized checkpoint and BF16 weights/KV per pair; greedy Sonnet
1024/128, 100 requests, 10/s, C32; context/batch limit 2048, 2,340
allocator blocks with 16-token attention blocks, prefix cache off,
**async on both paths**. Two fresh-server runs per path in reversed
order; identical token counts and no preemptions. Percentages are
throughput changes versus MLX.

---------

Signed-off-by: Ranran <ranranhaoranzhang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants