Add support for MLU kernelize
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend, documentation, machine-learning, testing
Research direction
Compare the runtime patterns in PR #155 and PR #285, then inspect the Python package under kernels/ and the Rust bindings in kernels-data/. Run the proposed mlu_only tests, including test_hub_forward_mlu(), and review the benchmark CLI and nix-builder/README.md hardware table. Done means MLU detection, validation, backend bindings across config versions, tests, CLI support, and documentation are covered.
Written by the indexing model from the issue text.
Description
Summary
I'd like to propose adding runtime device support for Cambricon MLU accelerators to the kernels Python package. This would follow the same pattern as PR #155 (NPU) and PR #285 (Neuron), enabling the kernels library to recognize, route, and load kernels targeting MLU hardware.
Motivation
Cambricon MLU is a custom AI accelerator used in several production environments. Currently, attempting to use kernelize() with an MLU device raises: ValueError: Unknown device type: mlu. This prevents MLU users from participating in the kernel hub ecosystem, even when using MLU-compatible kernels registered via register_kernel_mapping().
Proposed scope
Runtime support only — this PR would not touch kernel-builder or nix-builder. Specifically:
kernels/Python package:_MLUReposclass, MLU backend detection viatorch.mlu.device_count(), device validation, benchmark CLI supportkernels-data/Rust library:Backend::Mluvariant across all config versions (v1–v5) and Python bindings (Backend.MLU)- Tests:
mlu_onlypytest marker,test_hub_forward_mlu()(with fallback allowance since no MLU kernels exist in kernels-community yet) - Documentation: update
nix-builder/README.mdhardware support table (Tier 3, same as NPU/Neuron)
References
- PR: https://github.com/huggingface/kernels/pull/700 (will link once PR is created)
- Similar work: #155 (NPU), #285 (Neuron)
Looking forward to your feedback!
- Dominant language
- Python
- Stars
- 781
- Forks
- 141
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 57
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/kernels
-
kernels-common: hash_variant loads entire file into memory, causing high RSS on large .so filesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
huggingface/kernels#956 ·
Maintainers usually reply within 1 day
-
kernels benchmark pulls from the old model repos and says every gpu is cpuPossibly taken @drbh claimed this 7 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
huggingface/kernels#914 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
huggingface/kernels#949 ·
Maintainers usually reply within 1 day
-
Add `kernels describe-api` to the "use layers" cookbookPossibly taken @ariG23498 claimed this 18 days ago. Open
huggingface/kernels#906 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Support multiple upstreams (make `upstream` a list)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 58/100
huggingface/kernels#850 ·
Maintainers usually reply within 1 day
All issues in huggingface/kernels
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
elviskahoro/sdk-python-attio#144 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
RenyiELBO raises TypeError when model has no sample sitesPossibly taken @alibb007 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day