Skip to content

Fix the MPS RMSNorm hub kernel repo id - #50714

Merged
tarekziade merged 1 commit into
mainfrom
fix-mps-rmsnorm-kernel-repo
Nov 13, 2026
Merged

tarekziade merged 1 commit into
mainfrom
fix-mps-rmsnorm-kernel-repo

Conversation

@tarekziade

@tarekziade tarekziade commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

🤗 Transformers CI

use_kernels=True fails on MPS for every model with an RMSNorm: the kernel mapping points at kernels-community/mlx_rmsnorm, which the kernels API no longer serves (Repository Not Found for url: https://huggingface.co/api/kernels/kernels-community/mlx_rmsnorm/refs). The kernel lives at kernels-community/mlx-rmsnorm.

Reproducer (Apple M5, torch 2.15.0, kernels 0.18.2): fails on main, and with this change the kernelized RMSNorm matches eager to 9e-8.

import torch
from transformers import LlamaConfig, LlamaForCausalLM

config = LlamaConfig(vocab_size=128, hidden_size=64, intermediate_size=128, num_hidden_layers=1, num_attention_heads=4, num_key_value_heads=4)
model = LlamaForCausalLM(config).to("mps").eval()
ids = torch.tensor([[1, 2, 3]], device="mps")
reference = model(ids).logits
model.set_use_kernels(True)
print((model(ids).logits - reference).abs().max())

@vasqu vasqu 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.

Thanks, there might be more since im not on mps to verify :/

@tarekziade

Copy link
Copy Markdown
Collaborator Author

Thanks, there might be more since im not on mps to verify :/

Yeah I wished we had MPS hardware to run test on CI...

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@tarekziade
tarekziade added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit c748111 Nov 13, 2026
128 checks passed
@tarekziade
tarekziade deleted the fix-mps-rmsnorm-kernel-repo branch November 13, 2026 12:10
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.

3 participants