transformers icon indicating copy to clipboard operation
transformers copied to clipboard

How about adding local kernel loading to `transformers.KernelConfig()`

Open zheliuyu opened this issue 2 months ago • 3 comments

Feature request

As title.

Motivation

Currently, the class KernelConfig() creates the kernel_mapping through the LayerRepository provided by huggingface/kernels. The LayerRepository downloads and loads kernel from the hub. I think adding the ability for it to load kernel locally should be very helpful for the debugging process.

Your contribution

huggingface/kernels already has LocalLayerRepository built in. Maybe we should consider adding it to KernelConfig().

zheliuyu avatar Dec 09 '25 12:12 zheliuyu

cc @MekkCyber

Rocketknight1 avatar Dec 09 '25 13:12 Rocketknight1

Hi @zheliuyu ! Yes it totally makes sense, we can have a use_local_kernels flag inside KernelConfig to do that, do you want to open a PR for that ?

MekkCyber avatar Dec 09 '25 13:12 MekkCyber

Hi @zheliuyu ! Yes it totally makes sense, we can have a use_local_kernels flag inside KernelConfig to do that, do you want to open a PR for that ?

Of course. Let's get started.

zheliuyu avatar Dec 09 '25 15:12 zheliuyu

WIP on https://github.com/zheliuyu/transformers-kernels

zheliuyu avatar Dec 10 '25 09:12 zheliuyu

https://github.com/huggingface/transformers/pull/42800 PR merged. Documentation will be updated accordingly, but this issue can be closed.

Thanks to everyone who followed this issue.❤

zheliuyu avatar Dec 17 '25 01:12 zheliuyu